1
0
mirror of https://github.com/mre/mos6502.git synced 2024-12-23 03:29:51 +00:00

decrement_y_test passes

This commit is contained in:
Sam M W 2022-10-20 09:32:51 +01:00
parent c406965560
commit 41b9b19be2

View File

@ -209,6 +209,12 @@ impl CPU {
(Instruction::DEC, OpInput::UseAddress(addr)) => self.decrement_memory(addr), (Instruction::DEC, OpInput::UseAddress(addr)) => self.decrement_memory(addr),
(Instruction::DEY, OpInput::UseImplied) => {
let mut r = u8::from_ne_bytes(self.registers.index_y.to_ne_bytes());
self.decrement(&mut r);
self.load_y_register(i8::from_ne_bytes(r.to_ne_bytes()));
}
(Instruction::DEX, OpInput::UseImplied) => { (Instruction::DEX, OpInput::UseImplied) => {
self.dec_x(); self.dec_x();
} }