Consolidate SNES::Init

This commit is contained in:
scawful
2024-04-19 17:54:26 -04:00
parent a1558fd9a2
commit c906da46a0
2 changed files with 8 additions and 10 deletions

View File

@@ -107,6 +107,14 @@ RomInfo SNES::ReadRomHeader(uint32_t offset) {
}
void SNES::Init(Rom& rom) {
// Setup observers for the memory space
memory_.AddObserver(&apu_);
memory_.AddObserver(&ppu_);
// Load the ROM into memory and set up the memory mapping
rom_data = rom.vector();
memory_.Initialize(rom_data);
// Perform a long jump into a FastROM bank (if the ROM speed is FastROM)
// Disable the emulation flag (switch to 65816 native mode)
cpu_.E = 0;