Skip to content

Commit

Permalink
65816: add Absolute,Y addressing mode to STA
Browse files Browse the repository at this point in the history
  • Loading branch information
twvd committed Oct 15, 2023
1 parent 7a277fb commit 0a02a72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/snes/cpu_65816/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ where
.wrapping_add(Address::from(self.regs.read(Register::X)))
& ADDRESS_MASK
}
AddressingMode::AbsoluteY => {
(Address::from(self.regs.read(Register::DBR)) << 16
| Address::from(instr.imm::<u16>()?))
.wrapping_add(Address::from(self.regs.read(Register::Y)))
& ADDRESS_MASK
}
AddressingMode::StackS => Address::from(
self.regs
.read(Register::S)
Expand Down
2 changes: 1 addition & 1 deletion src/test/processortests_65816.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ cpu_test!(instr_95, 0x95);
cpu_test!(instr_96, 0x96);
cpu_test!(instr_97, 0x97);
cpu_test!(instr_98, 0x98);
//cpu_test!(instr_99, 0x99);
cpu_test!(instr_99, 0x99);
cpu_test!(instr_9a, 0x9a);
cpu_test!(instr_9b, 0x9b);
cpu_test!(instr_9c, 0x9c);
Expand Down

0 comments on commit 0a02a72

Please sign in to comment.