mirror of
https://github.com/FranLMSP/snes.git
synced 2026-01-01 07:21:35 -05:00
fix JSR absolute indexed indirect
This commit is contained in:
@@ -25,7 +25,7 @@ impl CPUInstruction for JSR {
|
||||
let (bytes, cycles) = cycles::increment_cycles_jsr(self.addressing_mode);
|
||||
registers.increment_pc(bytes - 1); registers.cycles += cycles;
|
||||
let value = registers.get_pc_address();
|
||||
if is_long {
|
||||
if matches!(self.addressing_mode, AddressingMode::AbsoluteLong) {
|
||||
push_common::do_push(registers, bus, &[
|
||||
(value >> 16) as u8,
|
||||
(value >> 8) as u8,
|
||||
|
||||
@@ -150,7 +150,7 @@ pub fn map_opcode_to_instruction(opcode: u8) -> Box<dyn CPUInstruction> {
|
||||
0xDC => Box::new(JMP{addressing_mode: A::AbsoluteIndirectLong}),
|
||||
// JSR
|
||||
0x20 => Box::new(JSR{addressing_mode: A::Absolute}),
|
||||
0xFC => Box::new(JSR{addressing_mode: A::AbsoluteIndexedIndirect(I::X)}), // TODO: Broken
|
||||
0xFC => Box::new(JSR{addressing_mode: A::AbsoluteIndexedIndirect(I::X)}),
|
||||
0x22 => Box::new(JSR{addressing_mode: A::AbsoluteLong}), // same as JSL
|
||||
// LDA
|
||||
0xA9 => Box::new(LDA{addressing_mode: A::Immediate}),
|
||||
|
||||
Reference in New Issue
Block a user