diff --git a/src/emulator.rs b/src/emulator.rs index 0bce48b..ebccee3 100644 --- a/src/emulator.rs +++ b/src/emulator.rs @@ -287,15 +287,13 @@ where ProcessorInstruction::ShiftLeft(vx, vy) => { trace!("ShiftLeft VX={vx:04x} VY={vy:04x}"); // Original chip8 behavior - self.registers[0xF] = (self.registers[vy as usize] & 0x10) >> 4; - self.registers[vx as usize] = self.registers[vy as usize]; + self.registers[0xF] = (self.registers[vx as usize] & 0x10) >> 4; self.registers[vx as usize] <<= 1; } ProcessorInstruction::ShiftRight(vx, vy) => { trace!("ShiftRight VX={vx:04x} VY={vy:04x}"); // Original chip8 behavior - self.registers[0xF] = self.registers[vy as usize] & 0x01; - self.registers[vx as usize] = self.registers[vy as usize]; + self.registers[0xF] = self.registers[vx as usize] & 0x01; self.registers[vx as usize] >>= 1; } ProcessorInstruction::JumpWithOffset(address) => { diff --git a/src/main.rs b/src/main.rs index 11f2dd6..25672e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ fn main() -> Result<(), anyhow::Error> { let mut emulator = Emulator::new(RatatuiDisplay::new()); - emulator.emulate(String::from("./roms/ibm-logo.ch8"))?; + emulator.emulate(String::from("./roms/3-corax+.ch8"))?; Ok(()) }