The 65org16 emulation core is almost finished. I only had to take the old 65c02 core from my AppleII emulator and extend it a bit. Now I plan to make the 65org16 an optional processor for the AppleII with the ability (unlike the real thing) to start emulation in compatibility mode and then switch to the 65org16.
1) What happens if the 65org16 hits an illegal undefined opcode? Since the FPGA core is based on a 6502 core I guess it might partly execute the illegal opcodes of the 6502 (except for the new 65c02 opcodes). Would it be possible to execute a special IRQ dedicated to "illegal instruction" instead?
2) How about accessing the memory when the 6502 performs its ALU operations? The original 6502 has the habit of always accessing the memory. For example, when executing the instruction 'DEC zp', the 6502 will perform the following cycles:
- read the zero page address
- read the value from the zero page
- decrement the value but also write the old value back to memory!
- write the new decremented value to memory
Though the 65c02 replaces the additional write with an additional read (*), the 65org16 nevertheless does not really need these superfluous memory accesses at all. So I wonder, since the 65org16 is based on the 6502, whether you leave them in (on purpose) or just drop them. Currently my little 65org16 emulator still emulates them (as it is also derived from the 65c02), but I thought, maybe this could reduce the code in the FPGA a bit, but I may be wrong here.
My apologies, if this has been asked before. I've already read quite a lot, but you have done so much developing and discussing throughout the years that it is quite hard to follow.
Cheers
Miles
* As a side note, IIRC some programmers used the two writes on the C64 to clear the IRQ signal in $d019.