Closed lgblgblgb closed 6 years ago
At least for 6502 (NMOS) there should be a cycle exact version as well.
It seems, sooner or later I have to take this step, if not for other thing, than for Mega65 ...
Some hint points: ability to generate MOS version with illegal opcodes etc (VIC-20 emulator currently), 65C02 (C-LCD), 65CE02+MAP (C65), 65CE02+M65 (Mega-65). The generated source doesn't need to be extra compact (with using macros etc always) since the generator itself should be well-maintainable not the generated source (and even with tricky macros, whatever, the result for the compiler is more flat anyway). Some analysis also needed to check ASM output on typical x86_64 compilation for "ideal" situation. Multiple-opcode execution at once should be supported, for time critical (ie M65) emulators. Disasm is not scope at all (should be moved to m65dbg like "external" lib/util solution, though generator for the disasm module is another point, but not within the emulation itself!).
It's questionable that should be happened soon ... Now, the CPU emulation core under heavy clean-up, some bug fix, multiple modes (M65, 65CE02, 65C02, NMOS, also with NMOS persona for M65), multiple bugs conforming (I mean original NMOS CPU bugs), also NMOS illegal opcodes will be supported. It would be not so much realistic to rewrite it fully at this point.
Instead of the "super ugly" over-hacked C source, let's write a Python script able to generate a 65xx (at least: 6502, 65C02, 65CE02, maybe DTV6502, and 65816 in the future) emulators for C, and probably Javascript as well for future usage in JS projects.