diff --git a/src/main.rs b/src/main.rs index 217ea73..9f2ee17 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,7 +34,7 @@ macro_rules! verbose_print { }; } -/// Simple program to greet a person +/// Gameboy (DMG-A/B/C) emulator #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] #[command(group(ArgGroup::new("prints").args(["verbose","cycle_count"])))] @@ -70,7 +70,7 @@ struct Args { static mut PAUSE_ENABLED: bool = false; static mut PAUSE_QUEUED: bool = false; -// static mut VERBOSE: bool = false; + static VERBOSE: RwLock = RwLock::new(false); const WIDTH: usize = 160; diff --git a/src/processor/gpu.rs b/src/processor/gpu.rs index 7a4456a..237bfb1 100644 --- a/src/processor/gpu.rs +++ b/src/processor/gpu.rs @@ -151,7 +151,6 @@ impl Cpu { } fn enter_vblank(&mut self) { - // let gamepad = self.gamepad_handler.gamepads().last(); while self.gamepad_handler.next_event().is_some() {} if self .memory diff --git a/src/processor/memory.rs b/src/processor/memory.rs index 8fac7aa..7f058ae 100644 --- a/src/processor/memory.rs +++ b/src/processor/memory.rs @@ -144,10 +144,7 @@ impl Memory { 0xFE00..0xFEA0 => self.oam[(address - 0xFE00) as usize], 0xFEA0..0xFF00 => 0xFF, 0xFF00..0xFF4C => self.get_io(address), - 0xFF4C..0xFF80 => { - // println!("empty space 2 read"); - 0xFF - } + 0xFF4C..0xFF80 => 0xFF, 0xFF80..0xFFFF => self.cpu_ram[(address - 0xFF80) as usize], 0xFFFF => self.interrupts, } @@ -174,9 +171,7 @@ impl Memory { 0xFE00..0xFEA0 => { self.oam[(address - 0xFE00) as usize] = data; } - 0xFEA0..0xFF00 => { - // println!("empty space write: {:#X} to addr {:#X}", data, address); - } + 0xFEA0..0xFF00 => {} 0xFF00..0xFF4C => { self.set_io(address, data); stdout().flush().unwrap(); diff --git a/src/processor/mod.rs b/src/processor/mod.rs index af3aae8..b064df3 100644 --- a/src/processor/mod.rs +++ b/src/processor/mod.rs @@ -40,7 +40,6 @@ pub struct Cpu { // Hz const CLOCK_SPEED: usize = 4194304; const SPEEDUP: f64 = 1.; -// const FF04_SPEED: f64 = 16384.; impl Cpu { pub fn new(