mirror of
https://github.com/FranLMSP/snes.git
synced 2026-08-03 08:30:01 -04:00
WIP emulator state
This commit is contained in:
@@ -54,7 +54,7 @@ impl Bus {
|
||||
match section {
|
||||
MemoryMap::WRAM => self.read_wram(address),
|
||||
MemoryMap::PPU => self.ppu.registers.read(address as u16),
|
||||
_ => todo!("Implement other memory sections"),
|
||||
_ => todo!("Implement other memory sections. Address: {:#08X}", address),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ impl Bus {
|
||||
match section {
|
||||
MemoryMap::WRAM => self.write_wram(address, value),
|
||||
MemoryMap::PPU => self.ppu.registers.write(address as u16, value),
|
||||
_ => todo!("Implement other memory sections"),
|
||||
_ => todo!("Implement other memory sections. Address: {:#08X}", address),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ pub struct Emulator {
|
||||
pub cpu: CPU,
|
||||
pub bus: Bus,
|
||||
pub rom: Box<dyn ROM>,
|
||||
pub is_frame_ending: bool,
|
||||
}
|
||||
|
||||
impl Emulator {
|
||||
@@ -15,6 +16,7 @@ impl Emulator {
|
||||
cpu: CPU::new(),
|
||||
bus: Bus::new(),
|
||||
rom: Box::new(LoROM::new()),
|
||||
is_frame_ending: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,5 +25,7 @@ impl Emulator {
|
||||
self.bus.ppu.tick(self.cpu.cycles);
|
||||
|
||||
self.cpu.cycles = 0;
|
||||
|
||||
self.is_frame_ending = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user