Skip to content

Commit

Permalink
PC becomes known on RST
Browse files Browse the repository at this point in the history
  • Loading branch information
hoglet67 committed Nov 24, 2017
1 parent 80103f7 commit 20ee040
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static void analyze_instruction(int opcode, int op1, int op2, int read_accumulat
printf("\n");

// Look for control flow changes and update the PC
if (opcode == 0x40 || opcode == 0x00 || opcode == 0x6c || opcode == 0x7c || intr_seen) {
if (opcode == 0x40 || opcode == 0x00 || opcode == 0x6c || opcode == 0x7c || intr_seen || rst_seen) {
// RTI, BRK, INTR, JMP (ind), JMP (ind, X), IRQ/NMI/RST
pc = ((read_accumulator & 0xFF00) >> 8) | ((read_accumulator & 0x00FF) << 8);
} else if (opcode == 0x20 || opcode == 0x4c) {
Expand Down

0 comments on commit 20ee040

Please sign in to comment.