From 353f12f7d9392a280b651b11f3118000cdbefeaf Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 23 Nov 2021 20:33:26 -0800 Subject: [PATCH] Fixes --- src/cpu/mod.rs | 4 ++-- src/main.rs | 2 +- src/ppu/rendering.rs | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cpu/mod.rs b/src/cpu/mod.rs index 6b7c4d8..9a5a082 100644 --- a/src/cpu/mod.rs +++ b/src/cpu/mod.rs @@ -665,11 +665,11 @@ impl Cpu { self.delay -= 1; return 1; } - + let clock = self.clock; self.handle_interrupts(); // back up clock so we know how many cycles we complete - let clock = self.clock; + self.before_clock = self.clock; let opcode = ::from(self.read(self.pc)); self.addresses_fetched.insert(self.pc); diff --git a/src/main.rs b/src/main.rs index 20f4932..2d9b916 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,7 +43,7 @@ const RNG_SEED: u32 = 0x35234623; const DISABLE_START_PRESSES_AFTER: usize = usize::MAX; // The rate at which seed inputs become corrupted.. -const MUTATION_RATE: f64 = 0.025; +const MUTATION_RATE: f64 = 0.05; // The rate at which seed inputs may become soft resets.. const MUTATION_RATE_SOFT_RESET: f64 = 0.00; diff --git a/src/ppu/rendering.rs b/src/ppu/rendering.rs index 26abf46..3c5aa5d 100644 --- a/src/ppu/rendering.rs +++ b/src/ppu/rendering.rs @@ -106,13 +106,11 @@ impl super::Ppu { palette_address += background_pixel; // Pixel value from tile data } else if background_pixel != 0 && sprite_pixel != 0 { if self.sprite_indexes[current_sprite] == 0 { - if x != 255 { + if x != 255 && y != 0 { // Sprite 0 does not hit At x=255, for an obscure reason related to the pixel pipeline. // don't access index current_sprite. need to know which sprite we're on horizontally. self.sprite_zero_hit = true; } - // TODO sprite zero should not hit when y == 255 (+1) == 0... - // } if self.sprite_attribute_latches[current_sprite] & (1 << 5) == 0 { // sprite has high priority