| 1 |
The original fake6502.c has been split up into subcomponents, rather than being one long file - |
| 2 |
support functions, 6502 instructions, address modes, data tables and 65c02 extensions. |
| 3 |
|
| 4 |
The file tables.h is now created from 6502.opcodes and 65c02.opcodes which are lists of instructions, |
| 5 |
cycle times, address modes and opcodes. |
| 6 |
|
| 7 |
The python script buildtables.py creates this. |
| 8 |
|
| 9 |
Minor changes have been made to modes.h and instructions.h to correct for 65C02 behaviour. These |
| 10 |
are documented in the files. |
| 11 |
|
| 12 |
Breaking Changes |
| 13 |
================ |
| 14 |
|
| 15 |
Note: these breaking changes are *only in the emulator*. The behaviour is correct for a 65C02, which is |
| 16 |
almost but not the same as a 6502. |
| 17 |
|
| 18 |
(1) BRK clears D after pushing on the stack. Probably unimportant as most routines in 6502 |
| 19 |
code CLD to get round this issue anyway. |
| 20 |
|
| 21 |
(2) ADC/SBC In Decimal Mode, these now set N and Z flags. They did not previously. It is |
| 22 |
possible that code may rely on this to preserve flag status through an ALU |
| 23 |
operation but unlikely. |
| 24 |
|
| 25 |
(3) JMP The absolute indirect mode JMP (xxxx) had a bug where JMP ($12FF) got its |
| 26 |
target address from $12FF and $1200. This bug is corrected. |
| 27 |
This could break code with oddly positioned jump tables. Even align any vector |
| 28 |
tables or memory vectors. |
| 29 |
|
| 30 |
(4) (Misc) Undocumented instructions now do not work. They don't work on a 65C02. |
| 31 |
|
| 32 |
Also note that read-modify-write instructions all now do not do the double write. ASL xx would do |
| 33 |
read xx ; write xx ; write shifted xx on a 6502. On a 65C02 it does not. However, the emulator did |
| 34 |
not emulate this behaviour anyway, so it doesn't actually matter. |
| 35 |
|
| 36 |
Paul Robson 4/Sep/19 |
| 37 |
|
| 38 |
Testing |
| 39 |
======= |
| 40 |
Fixed stz bug .... writing a ... duh ! |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|