Skip to content

M65 project status

LGB edited this page Aug 19, 2022 · 33 revisions

You may also want to visit Xemu's github issues page.

Note, DONE does not mean that it's 100% complete or 100% bug-free necessarily. It merely means, it's "good enough" in most cases, minor issues can still exists. Always read the comments column as well. And remember, even MEGA65 is not "100%" or "ready", Xemu emulation of MEGA65 is certainly the same, or "worse" as it also requires to follow/write the emulation on MEGA65 design changes with very limited human resources to write the emulator. Please note, that this information can be outdated, though I try my best not to forget to update this page regularly.

I may not include every features which are natural to have (to be able to have a working emulator at all for practical reasons), so there can be seemingly "too many" unresolved issues and "MISSING" designations in this table by first glance. For completeness though, I include many "DONE" and "MOSTLY DONE" entries where it's handy to have some comments.

Feature matrix

Feature Status Comments

CPU and MEMORY
Full 65CE02 CPU opcode set + MAP/EOM DONE 6502/65C02 (with Z=0) test suite passes, decimal mode test OK (though MEGA65 and Xemu uses NMOS BCD behaviour rather than CMOS), some opcode cycle-time may differ from MEGA65 (on-going changes in MEGA65), RMW opcode behaviour is not CMOS (following the design choice of MEGA65 - helps a lot with C64 compatibility in contrast of a real C65).
NMOS 6510 opcodes MISSING,
NOT-ON-HW
Note: AFAIK even real MEGA65 does not implement yet the planned "NMOS CPU persona" mode for better C64 compatibility to be able to execute programs using "illegal opcodes" of the NMOS 65xx CPUs.
MEGA65 32-bit addressing DONE OP [ZP],Z format (must be prefixed with NOP), using 4 bytes of ZP locations to form a 32 bit address (actually only 28 bits are used), the extra time needed for this addressing mode is not emulated though. Note: the "32-bit" addressing with 32-bit "Q" opcodes is not this line, but the next.
MEGA65 32-bit "Q" register and associated opcodes DONE Detailed report: MEGA65 specific opcodes
CPU clock selection MOSTLY DONE 1/2/3.5/40.5 MHz, clock fine tuning is not supported (but I don't know if it's ever used feature so far)
Timing EVOLVING CPU "cycles per opcode" may not be the same as with real MEGA65 in some cases. Note, that even a real MEGA65 does not have the notion too much for sub-opcode timing, ie "when happens read/write during execution of an opcode" (ISSUE-303).
C64/C65 style memory banking DONE C64 memory banking, C65 VIC-III controlled ROM mapping, C65 MAP instructed memory mapping
MEGA65 style memory mapping MOSTLY DONE there can be some missing features, like mapping in the the FDC or ethernet buffer into the "legacy" I/O space
Memory DONE 384K main/fast RAM, "ROM" (RAM for real) write protect via hypervisor, 8M of Attic RAM (aka HyperRAM or slowRAM), the slower timing of Attic RAM is not emulated though
F018 DMAgic MOSTLY DONE F018A and F018B mode, MEGA65 extensions (SWAP and MIX is not supported by MEGA65), but lacking MEGA65's line drawing capabilities currently (ISSUE-198)

AUDIO
Note: all audio emulation in Xemu currently affected by the design issue that register change of an audio device (SID, OPL3, audio-DMA) only takes effect on certain discrete time intervals (about 10-20 msec) thus, for example digi playback using SID is not so much possible (though for that, audio-DMA is much more better choice on MEGA65).
SID DONE four SIDs (at $D400, $D420, $D440, $D460), emulated by 'webSID' (other "heavier" - but more precise - solutions are too heavy for Xemu at the moment ...)
OPL3 DONE,
NOT-ON-HW
implemented using Nuked-OPL3, note: OPL3 does not work on MEGA65 yet (because of some unknown VHDL issue) but it does work in Xemu
Audio-DMA MOSTLTY DONE there can be minor issues because of lacking testing material
Register driven PCM MISSING currently it's not possible to implement because of the current design of the emulator, though for digi playback, audio-DMA is a much better choice
MEGA65 Mixer MISSING no Xemu implementation yet (ISSUE-272), though some parametrs can be adjusted manually via Xemu's context menu

VIDEO
Note: video/VIC emulation is scanline based, thus limited in precision. This design choice is more or less a must, as MEGA65 is too fast (by CPU and also by pixel clock of VIC-IV, also overloaded with features for VIC-IV) to have real-time emulation on an average PC with pixel timing accuracy See the list of pending issues.
Video standards and screen DONE PAL/NTSC software/user controllable, with/without reduced border, emulator-specific auto-resize window to avoid non-integer scaling if it's possible (not in full-screen mode)
Resolutions DONE H640/H320 (note, the obscure H1280 mode of C65 is not supported by MEGA65 either), V200/V400
Palettes DONE four of 256-element programmable palettes (C65 supported a single palette), RGB
VIC-II features PARTLY DONE C65 (VIC-III), MEGA65 (VIC-IV) and Xemu: none of them have full VIC-II compatibility, as all of these implementations are fundamentally different from VIC-II. Thus, some can't expect to run very-tech-nature VIC-II demo effects. Though, MEGA65's and Xemu's VIC-II compatibility in some respects are already better than C65 ever had (there was not even designed to have full VIC-II compatibility)
VIC-III bitplanes MOSTLY DONE bitplanes are not so much preferred by MEGA65 (native VIC-IV solutions are recommended) since bitplanes for a 8 bit system (especially how VIC-III solved it) is kind of odd thing to do. Some features can be missing from Xemu, but probably from MEGA65 as well (most notably: H1280 support, combined hardware attributes with bitplanes, I'm not sure). MEGA65's ability to relocate bitplane bank (not a C65 feature) is supported.
VIC-III hardware attributes MOSTLY DONE there can be some missing features especially when combined with some modes (see above with bitplanes for example)
Sprites (in general) MOSTLY DONE there is no sprite-overflow to the left from the right when extreme X coordinates are used, sprite collision "under the border" won't work
VIC-IV advanced sprites DONE 16 colour sprites, relocatable sprite pointers, sprite Y size enhancements. But note about the general issue(s) with sprite mentioned at "Sprites (in general)", above.
VIC-IV specific video modes MOSTLY DONE 16 bit char mode, FCM (full-colour, 256 colours), NCM (nybble-colour, 16 colours) cell modes. There can be several "minor" issues as this is the part of MEGA65 which is very complex, and hard to emulate especially with good performance
VIC-IV RRB MOSTLY DONE RRB = Raster Rewrite Buffer, MEGA65 does not have framebuffer (it's not an emulator, unlike Xemu, but real hardware) but it does have a single raster worth of memory which can be used to "jump back" and create interesting effects with this technique, quite powerfull - hard to emulate well ;)

OTHER HARDWARE ELEMENTS
CIA PARTLY DONE "CIAs" (actually part of 4510 on C65) have a rudimentary Xemu emulation currently, suitable for running the ROM itself, but may lack advanced features even compared to a C64 only. Interrupt/timer precision is limited, missing some MEGA65 extensions of the CIAs. TOD is not writable, always represents the current system time. Also the timer resolution of CIAs cannot be more precise than one scanline time.
MEGA65 RTC, NVRAM MOSTLY DONE NVRAM state is load/saved from/to a file by Xemu on start/exit to keep values. Currently it's not possible to set RTC, it's always reflects the current system time.
Hardware multiplier/divider DONE BASIC65 also uses it to speed up some routines.
Hardware "FPU" (fixed point unit) MISSING,
NOT-ON-HW
Note: even on MEGA65 it currently does not work, AFAIK
Ethernet OUTDATED AND
LINUX ONLY
MEGA65's Ethernet controller was emulated by Xemu, but it was Linux only (used Linux specific feature). Also, meanwhile MEGA65 changed the behaviour of the Ethernet controll in the design, so Xemu's implementation currently does not reflect how it should work. Should be rewritten for the current behaviour, and probably trying to support non-Linux OS'es as well (ISSUE-242).
MEGA65 SD controller MOSTLY DONE for most uses-cases it works, however it can have its issues especially when combined with newer Hyppos. Timing is incorrect.
F011 FDC controller MOSTLY DONE for most uses-cases it works, however it can have its issues especially if a software want to directly controlling it (bypassing ROM) and depends on accurate timing and accurate FSM (finite-state-machine) transitions. Bugs: emulation problem in case of rapid change of active drive (like when copying files/blocks between disks). Missing: MEGA65-style "HD images", anything over the standard D81 constraints.
IEC bus and IEC devices MISSING C65 and MEGA65 has IEC bus, you can even hook up 1541, or your SD2IEC, whatever (note, the internal floppy drive of C65/MEGA65 is not IEC based solution!). Xemu currently does not even emulate the IEC bus, surely not then devices on IEC bus
Cartridges MISSING C65 has its own cartridge port, not compatible with C64 at all. MEGA65 changed that to a C64-compatible cartridge port. Currently there is even not plan Xemu to support any kind of cartridges though (like CRT files, or whatever). To my best knowledge, there are no MEGA65 specific cartridges yet, an existing "soft-cartridge" (ie CRT file or something) must be C64 cartridge, which is then much better to be used with a C64 emulator, not a MEGA65 emulator

SYSTEM SOFTWARE/FUNCTIONALITY
HYPPO INCLUDED, WORKS HYPPO is the "system software" - also known as hypervisor - of MEGA65. Xemu uses an embedded real MEGA65 Hyppo.
FREEZER MISSING Freezer cannot be used inside MEGA65 emulation yet. To remedy the problem, first, a newer HYPPO must be used, see above. In fact, FREEZER is not so much useful inside emulation, but still, it's a good measure of emulation quality if it's able to run (also can be important for the users to have a quick look on MEGA65 features without a real MEGA65 at all).
MATRIX MODE MISSING Matrix mode itself is just the "HUD console" itself, for the actual functionality, it's the debug monitor capabilities, see below.
DEBUG MONITOR PARTLY DONE,
EVOLVING
MEGA65 has a serial (over USB) console to be able to used with external debuggers/monitors. Xemu has similar interface but implemented over TCP/IP because of the constraint not being a real hardware. This interface lacks some features and also have various problems currently, unfortunately. Matrix mode itself is just a "HUD console" to access that (command line driven) interface without any client attached as a debugger.

EMULATED INPUT DEVICES
Keyboard DONE,
KEYMAP DIFFICULTIES
It's very hard to create a positional based (which Xemu depends on) universal keymap which is great for everybody, especially for even accounting different platforms and special keyboards, like some Macs does not have INSERT key, etc ...
Mouse DONE Emulated via the SID as should be. Normally Xemu does not emulate a mouse, you have to enable "mouse grab mode", then you can enter into the grab/emulation mode with left clicking into the emulator window. It has been done this way because of user complains that accidentallty clicking into the emulator window causes to enter "grab mode".
Joystick DONE,
ONE JOY ONLY
Joystick is emulated via numeric keypad, or using an USB attached game controller / joystick. Currently there is not possible to emulate two joysticks at once, like with two USB game controller attached (or using two different controls of the same controller). Of course it's still possible to set which joystick port is used.
Lightpen ?? Place holder, I have to look after the status, even I can't remember :-O Note, on the MEGAphone, lightpen would mean the touch screen. Surely Xemu currently does not emulate different MEGA65 "flavours" (like the desktop one vs the MEGAphone) but at some point in the future, it can be a new Xemu feature as they have slight differences.

EMULATOR-SPECIFIC FEATURES
Command line DONE Command-line framework is implemented on project level
Config file DONE,
NO SAVE
Xemu can use config file for default values (same as with the command line), though currently you must edit such a file by hand, and you can't save a config file from the emulator itself to store the current settings as a config file.
Snapshot BAD, OUTDATED Snapshot framework on project level, hw emu components have savers/loaders. However currently the MEGA65 emulator inside the Xemu projects superseeded the state info saving code almost everywhere, thus cannot be expected at the moment that it works at all. Currently there are no plans to fix this, till Xemu emulation of MEGA65 becomes about feature complete and some work can be done on a relative stable state then. On the long term, I am not sure if I even want this, as MEGA65's FREEZER makes that possible to save state of the machine, and with furute Xemu support, it's even possible - in theory - to exchange saved states between a real machine and the emulator.
Screenshot DONE Screenshots are saved into PNG format files. The PNG files themselves are stored in the Xemu "system folder" in sub-directory "screenshosts".
GUI menu / dialog boxes DONE On Mac, and Windows native GUI is used (though for Mac users, it can be "strange" to have context menu not the usual global one), for Linux/UNIX the GTK3 based one is suggested. Xemu uses an abstraction layer for simple GUI elements, and "backends" implement the low-level features. See "EMULATOR PLATFORMS" chapter above for possible platform specific problems.
Included ROM IMPOSSIBLE Though it would be nice to have ROM included for "instant install" emulator experience, this is impossible because of legal problems with the copyrighted ROM image. I would love to make the life simple to include it, but it simply cannot be done, unfortunately.

EMULATOR PLATFORMS
Linux/UNIX WORKS The main platform I use for evelopment (Linux, though it should be OK on other UNIX-like systems as well, at least FreeBSD has been tried). Xemu can utilize GTK3 as UI elements on this platform. It's said it's also OK on Rapsberry-Pi, though the performance can be a bottleneck there.
Windows WORKS There can be some issues, but nothing show stopper to my best knowledge. For windows, even a version is provided with an Installer.
Mac WORKS Xemu on Mac lacks some UI capabilities currently, namely no 'tick marks' and lack of save dialog support (ISSUE-227). For Mac, even a version is provided as a DMG file.
"Esoteric" platforms At least tested at some point of time on: FreeBSD, OpenBSD, HaikuOS
HTML/JS (in browser) NOT WORKING With emscripten, it's possible to compile Xemu to be able run inside a web browser. In theory. The current state of MEGA65 emulation required some hacks which breaks the support, and even if it works, it's questionable that the emulation is usable at all

Compatibility tests

You may want to check out the very current status HERE.

This section below is especially a "TODO" kind of place :)

Software Status Comments
MEGA65 HYPPO WORKS no known issues
C65-ROM WORKS no known issues