Skip to content

Commit

Permalink
Fix stack-relative indirect indexed address calculation involving the…
Browse files Browse the repository at this point in the history
… direct page by mistake (#293)
  • Loading branch information
Fulgen301 authored Aug 16, 2024
1 parent a494e6a commit c09206e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cpu/modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static void sr() { // absolute,S
static void sridy() { // (indirect,S),Y
uint16_t eahelp, startpage;
eahelp = regs.sp + (uint16_t)read6502(regs.pc++);
ea = (uint16_t)read6502(direct_page_add(eahelp)) | ((uint16_t)read6502(direct_page_add(eahelp + 1)) << 8);
ea = (uint16_t)read6502(eahelp) | ((uint16_t)read6502(eahelp + 1) << 8);
startpage = ea & 0xFF00;
ea += (uint16_t)regs.y;

Expand Down

0 comments on commit c09206e

Please sign in to comment.