WIP emulator state

This commit is contained in:
2023-05-07 23:08:23 -05:00
parent 356a963aee
commit 8333eb13cb
4 changed files with 34 additions and 3 deletions
+2 -2
View File
@@ -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),
}
}
}
+4
View File
@@ -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;
}
}