-
Notifications
You must be signed in to change notification settings - Fork 32
MEGA65 emulator for testing
Please note, that some of the options here are not so much well tested and can be buggy or even de-funct. Also, there can be serious conflicts between some options. Unfortunately this area of the emulator is the least used in general, so it gives too little love from me, because of my limited free time for my Xemu hobby project. Anyway, any bug reports are welcome, though I cannot promise in advance that I can deal with those "ASAP" or "at all" in some cases. Thanks for the understanding.
-
-besurecauses to answer "Yes" automatically for "Are you sure?" kind of prompts from the emulator -
-hickup FILENAMEloads an external HYPPO, instead of Xemu's built-in one. Beware, Xemu is not very well tested with newer HYPPO versions! -
-rom FILENAMEinstructs Xemu to use the given file as the ROM, must be a 128K valid C65 or MEGA65 ROM image -
-gui GUINAMEselects GUI for Xemu, can be useful in some cases to avoid GUI stuff, like with-gui none. Also in general-gui osdcan be interesting (but not so much for testing) it causes the internal emulator screen is used to draw the GUI instead of using things like GTK2 or native windows/Mac GUI (specify-gui osdand then right click into the emulator window ...) -
-extbanner-extchrwom-extcramutils-extflashutil-extfreezer-extinitrom-extonboard: all of these needs filename as parameter! These CLI options load external binaries instead of Xemu's built-in ones. In most cases people don't ever needs these -
-skipunhandledmemcan be useful if you are not interested in getting Xemu warning windows on referencing memory areas which are not decoded (ie "nothing there"). In 99.99% of cases these kind of events are bugs, so it's enabled by default to help people to find bugs (real MEGA65 would not warn you of course)
-
-8 FILENAME.D81does not load anything, but attaches a disk image automatically. The same description goes for the-9 FILENAME.D81option -
-autoloadautomatically loads the first program from the attached disk image -
-prg FILENAMEinjects a program directly into a memory and RUNs it, but it should be a BASIC program or at least an ML program with the "BASIC stub". Detecting C64 ("GO64") or C65/M65 is aumatical based on the load address of the PRG (two first bytes). Auto detection can be overriden with an additional option:-prgmode nwherenmust be64or65 -
-importbas FILENAMEimports a BASIC program from ASCII text form. Beware, this is very much not tested well, and problematic because of the upper/lower case problems, and special PETSCII characters. It may also conflict with-8as it uses an in-memory D81 to do the trick utlizing BASIC65's ability to load a SEQ type text file as a BASIC program rather than a tokenized one
Sometimes the testing is done from script, and output is also parsed automatically, thus you don't need or want the emulator window at all. You can achieve this with the -headless CLI option.
Often, it's more desired the test to run quickly, more quicker than real-time emulation. For this, two CLI options are provided:
-
-fastbootcauses to shorten the time needed for HYPPO to initialize the machine (running the emulation as fast as possible by your PC/Mac), but as soon the ROM code starts to run, real time emulation speed is restored -
-sleeplesscauses the entire emulation to run as fast as possible, not just the "boot" part -
-fastclock Nsets a given MHz value for "fast" clock, ie the standard 40.5MHz MEGA65 usually have in fast mode can be overriden this way
Do not use the two option togerher, which would not make sense either, as -sleepless covers both the HYPPO init, and rest of the emulation session already.
Option -testing must be set for this to work! The reason is security, do not allow normally for random programs to make the emulator exit (either by will, or by chance).
If -testing is used, storing value $42 into register $D6CF will cause Xemu to exit. If -testing is not used, this would be an "FPGA reconfigure"
request on the real MEGA65 which causes the emulator to restart emulation (exit only happens with -testing, again).
For sure, you may want to create some sort of information during testing, which can be examined later. Some of the possibilities:
- Attach a disk image with
-8and save a file on it by the test program. You can then extract that file and process - Use the
-dumpmem FILENAMECLI option to dump the content of the "fast" RAM on exit, then you can process the memory content later - Use the
-dumpscreen FILENAMECLI option to dump the content of the screen in form of ASCII to file, which can be processed later. Of course it makes sense only if the screen was in text mode originally, also the screen code to ASCII conversion can cause problems. Probably you may want to use-dumpmem FILENAMEin most cases when you're free to parse the memory content as you wish - Use the
-screenshot FILENAMECLI option to save a PNG file (of the screen) on exit - Use the
-hyperserialfile FILENAMECLI option to save the content written to the "hyper serial port" to a file. You can also specify the-hyperserialasciiswitch to instruct the emulator to convert stored data into ASCII, however it can causes unwanted results depending on the nature of the written data
The last one is probably the most mystical as the first glance. There is a HYPPO trap which can write that port, thus you must utilize that.