lgblgblgb / xemu

Emulations (running on Linux/Unix/Windows/macOS, utilizing SDL2) of some - mainly - 8 bit machines, including the Commodore LCD, Commodore 65, and the MEGA65 as well.
https://github.com/lgblgblgb/xemu/wiki
GNU General Public License v2.0
208 stars 32 forks source link

Create 65xx emulator generator script #5

Closed lgblgblgb closed 6 years ago

lgblgblgb commented 8 years ago

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.

lgblgblgb commented 8 years ago

At least for 6502 (NMOS) there should be a cycle exact version as well.

lgblgblgb commented 8 years ago

It seems, sooner or later I have to take this step, if not for other thing, than for Mega65 ...

lgblgblgb commented 7 years ago

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!).

lgblgblgb commented 6 years ago

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.