Update to v087r04 release.
byuu says:
Changelog:
- gameboy/ -> gb/
- GameBoy -> GB
- basic memory map for GBA
- enough code to execute the first BIOS instruction (b 0x68)
I have the code resetting r(15) to 0 on an exception just as a test.
Since that flushes the pipeline, that means we're basically executing "b
0x68" at 8MHz, and nothing else.
... and I am getting __6 motherfucking FPS__ at 4.4GHz on an i7.
Something is seriously, horribly, unfuckingbelievably wrong here, and
I can't figure out what it is.
My *fully complete* ARM core on the ST018 is even less efficient and
runs at 21.47MHz, and yet I get 60fps even after emulating the SNES
CPU+PPU @ 10+MHz each as well.
... I'm stuck. I can't proceed until we figure out what in the holy fuck
is going on here. So ... if anyone can help, please do. If we can't fix
this, the GBA emulation is dead.
I was able to profile on Windows, and I've included that in this WIP
under out/log.txt.
But it looks normal to me. But yeah, there's NO. FUCKING. WAY. This code
should be running this slowly.
2012-03-18 12:35:53 +00:00
|
|
|
#include <gb/gb.hpp>
|
2010-12-28 06:03:02 +00:00
|
|
|
|
2012-04-26 10:51:13 +00:00
|
|
|
namespace GameBoy {
|
2010-12-28 06:03:02 +00:00
|
|
|
|
|
|
|
Scheduler scheduler;
|
|
|
|
|
2016-02-09 11:51:12 +00:00
|
|
|
auto Scheduler::power() -> void {
|
|
|
|
host = co_active();
|
|
|
|
resume = cpu.thread;
|
2015-11-21 07:36:48 +00:00
|
|
|
}
|
|
|
|
|
2016-02-09 11:51:12 +00:00
|
|
|
auto Scheduler::enter(Mode mode_) -> Event {
|
|
|
|
mode = mode_;
|
|
|
|
host = co_active();
|
|
|
|
co_switch(resume);
|
Update to v098r06 release.
byuu says:
Changelog:
- emulation cores now refresh video from host thread instead of
cothreads (fix AMD crash)
- SFC: fixed another bug with leap year months in SharpRTC emulation
- SFC: cleaned up camelCase on function names for
armdsp,epsonrtc,hitachidsp,mcc,nss,sharprtc classes
- GB: added MBC1M emulation (requires manually setting mapper=MBC1M in
manifest.bml for now, sorry)
- audio: implemented Emulator::Audio mixer and effects processor
- audio: implemented Emulator::Stream interface
- it is now possible to have more than two audio streams: eg SNES
+ SGB + MSU1 + Voicer-Kun (eventually)
- audio: added reverb delay + reverb level settings; exposed balance
configuration in UI
- video: reworked palette generation to re-enable saturation, gamma,
luminance adjustments
- higan/emulator.cpp is gone since there was nothing left in it
I know you guys are going to say the color adjust/balance/reverb stuff
is pointless. And indeed it mostly is. But I like the idea of allowing
some fun special effects and configurability that isn't system-wide.
Note: there seems to be some kind of added audio lag in the SGB
emulation now, and I don't really understand why. The code should be
effectively identical to what I had before. The only main thing is that
I'm sampling things to 48000hz instead of 32040hz before mixing. There's
no point where I'm intentionally introducing added latency though. I'm
kind of stumped, so if anyone wouldn't mind taking a look at it, it'd be
much appreciated :/
I don't have an MSU1 test ROM, but the latency issue may affect MSU1 as
well, and that would be very bad.
2016-04-22 13:35:51 +00:00
|
|
|
if(event == Event::Frame) ppu.refresh();
|
2016-02-09 11:51:12 +00:00
|
|
|
return event;
|
2010-12-28 06:03:02 +00:00
|
|
|
}
|
|
|
|
|
2016-02-09 11:51:12 +00:00
|
|
|
auto Scheduler::exit(Event event_) -> void {
|
|
|
|
event = event_;
|
|
|
|
resume = co_active();
|
|
|
|
co_switch(host);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Scheduler::synchronize(cothread_t thread) -> void {
|
|
|
|
if(thread == cpu.thread) {
|
|
|
|
while(enter(Mode::SynchronizeCPU) != Event::Synchronize);
|
|
|
|
} else {
|
|
|
|
resume = thread;
|
|
|
|
while(enter(Mode::SynchronizeAll) != Event::Synchronize);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Scheduler::synchronize() -> void {
|
|
|
|
if(co_active() == cpu.thread && mode == Mode::SynchronizeCPU) return exit(Event::Synchronize);
|
|
|
|
if(co_active() != cpu.thread && mode == Mode::SynchronizeAll) return exit(Event::Synchronize);
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Scheduler::synchronizing() const -> bool {
|
|
|
|
return mode == Mode::SynchronizeAll;
|
2010-12-28 06:03:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|