mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 07:02:27 +01:00
byuu says: Changelog: - Game Boy (Color): STAT OAM+HBlank IRQs only trigger during LY=0-143 with display enabled - fixes backgrounds and text in Wacky Races - Game Boy (Color): fixed underflow in window clamping - fixes Wacky Races, Prehistorik Man, Alleyway, etc - Game Boy (Color): LCD OAM DMA was running too slow - fixes Shin Megami Tensei - Devichil - Kuro no Sho - Game Boy Advance: removed built-in frame blending; display emulation shaders will handle this going forward - Game Boy Advance: added Game Boy Player emulation - currently the screen is tinted red during rumble, no actual gamepad rumble support yet - this is going to be slow, as we have to hash the frame to detect the GBP logo, it'll be optional later on - Emulator::Interface::Palette can now output a raw palette (for Display Emulation shaders only) - color channels are not yet split up, it's just the raw packed value
80 lines
1.6 KiB
C++
80 lines
1.6 KiB
C++
#include <fc/fc.hpp>
|
|
|
|
namespace Famicom {
|
|
|
|
#include "serialization.cpp"
|
|
System system;
|
|
|
|
void System::run() {
|
|
scheduler.enter();
|
|
if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) {
|
|
interface->videoRefresh(video.palette, ppu.buffer, 4 * 256, 256, 240);
|
|
}
|
|
}
|
|
|
|
void System::runtosave() {
|
|
scheduler.sync = Scheduler::SynchronizeMode::PPU;
|
|
runthreadtosave();
|
|
|
|
scheduler.sync = Scheduler::SynchronizeMode::All;
|
|
scheduler.thread = cpu.thread;
|
|
runthreadtosave();
|
|
|
|
scheduler.sync = Scheduler::SynchronizeMode::All;
|
|
scheduler.thread = apu.thread;
|
|
runthreadtosave();
|
|
|
|
scheduler.sync = Scheduler::SynchronizeMode::All;
|
|
scheduler.thread = cartridge.thread;
|
|
runthreadtosave();
|
|
|
|
scheduler.sync = Scheduler::SynchronizeMode::None;
|
|
}
|
|
|
|
void System::runthreadtosave() {
|
|
while(true) {
|
|
scheduler.enter();
|
|
if(scheduler.exit_reason() == Scheduler::ExitReason::SynchronizeEvent) break;
|
|
if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) {
|
|
interface->videoRefresh(video.palette, ppu.buffer, 4 * 256, 256, 240);
|
|
}
|
|
}
|
|
}
|
|
|
|
void System::load() {
|
|
string manifest = string::read({interface->path(ID::System), "manifest.bml"});
|
|
auto document = Markup::Document(manifest);
|
|
|
|
serialize_init();
|
|
}
|
|
|
|
void System::power() {
|
|
cartridge.power();
|
|
cpu.power();
|
|
apu.power();
|
|
ppu.power();
|
|
input.reset();
|
|
scheduler.power();
|
|
reset();
|
|
}
|
|
|
|
void System::reset() {
|
|
cartridge.reset();
|
|
cpu.reset();
|
|
apu.reset();
|
|
ppu.reset();
|
|
input.reset();
|
|
scheduler.reset();
|
|
}
|
|
|
|
void System::init() {
|
|
assert(interface != 0);
|
|
input.connect(0, Input::Device::Joypad);
|
|
input.connect(1, Input::Device::None);
|
|
}
|
|
|
|
void System::term() {
|
|
}
|
|
|
|
}
|