Skip to content

Commit

Permalink
6502tube: fix behavior of opcode #2.
Browse files Browse the repository at this point in the history
This was a Klaus Dormann test suite failure.  See
https://www.stardot.org.uk/forums/viewtopic.php?p=440921#p440921 and
#239

Opcode 02 is HLT (undocumented) on the NMOS 6502 but is a NOP on the
65C02.  The Dormann test suite tested that this opcode causes the byte
immediately after it to be skipped rather than executed, i.e. it is a
two-byte instruction.  This commit makes that so and fixes the test
failure.
  • Loading branch information
Steve Fosdick committed Dec 1, 2024
1 parent f1f3f2b commit a579ccd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/6502tube.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,8 @@ void tube_6502_exec()
case 0x02:
if (dbg_tube6502)
debug_trap(&tube6502_cpu_debug, oldtpc, 1);
else
polltime(1);
polltime(2);
readmem(pc++);
break;

case 0x04: /*TSB zp */
Expand Down

0 comments on commit a579ccd

Please sign in to comment.