From 6f4f8727651e42ddb7f3b439be330b9cf54126a3 Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Thu, 22 Apr 2021 20:38:13 -0500 Subject: [PATCH] fix(cpu): pass SLA (HL) and SRA (HL) tests from blargg --- src/instruction.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/instruction.rs b/src/instruction.rs index 1d3b615..ecb444e 100644 --- a/src/instruction.rs +++ b/src/instruction.rs @@ -1245,7 +1245,7 @@ impl Instruction { let shifted = value << 1; - cpu.write_byte(addr, value); + cpu.write_byte(addr, shifted); (Cycle::new(16), (value >> 7) & 0x01, shifted) } }; @@ -1279,7 +1279,7 @@ impl Instruction { let msb = (value >> 7) & 0x01; let shifted = msb << 7 | value >> 1; - cpu.write_byte(addr, value); + cpu.write_byte(addr, shifted); (Cycle::new(16), value & 0x01, shifted) } };