Skip to content

MEGA65 ROM "how to get it" tutorial for Xemu

LGB edited this page Aug 18, 2022 · 29 revisions

Description of the problems with the ROMs

To be able to use Xemu's MEGA65 emulation, you need the ROM file for it. The current MEGA65 ROM is a well enhanced and bug-fixed version of the original C65 ROM. The original C65 ROM - unfortunately, yes it bothers me too - cannot be distributed or shared because of legal reasons. The mentioned MEGA65 enhanced version (often called "closed-ROMs" project in MEGA65 terminology) is still a derived work of the original C65 ROM, thus the same rule applies here. For MEGA65 buyers, the current owner of the original Commodore(TM) rights licenses the ROM, so there is no problem here. However, if you are an emulator user and don't have a MEGA65, it's certainly a problem. Yes, there is an open source ROM project called "Open-ROMs" project but that ROM is far from being used by an average user, and only recommended for people who want to join the free ROM development or other curious minds.

Your options to have some MEGA65-capable ROM

(Pro-tip in advance: you may want to check out the last option from this list)

  • If you are a MEGA65 owner, you can use the legally owned copy on your MEGA65's SD-card for example, or other methods (provided filehost access). If this applies to you, your journey ends here, and you don't need to read the rest of this page at all, but you want to jump to the very end of this page instead. This is the easiest solution but may not apply to you if you haven't bought MEGA65
  • Use the free open-ROMs project, but as I've said above, that is not ready yet for general usage, and also may not be compatible with currently written software for the MEGA65. This is probably NOT what you want!
  • Use an original C65 ROM, and that's it. Be aware that the original C65 ROM - though works on MEGA65 - is full of bugs, incomplete implementations, massive limitations, lack of MEGA65 new features from BASIC, and so on. It may be worth trying how a real C65 would feel, but not so useful on a longer term other than being curious about the C65. This is may NOT what you want!
  • Use an original C65 ROM with "patching" it yourself up to the current MEGA65 ROM status, as the patch itself is only the delta, thus it is useless without the original ROM, that is, can be distributed at least. This is probably what you want

Surely, the second two options mean, you need the original C65 ROM then.

Your options to have the original C65 ROM (to be used as-is, or with patching for MEGA65)

Foreword: if you plan to use a relative up-to-date and decent MEGA65 ROM you need original C65 ROM version 910828. That is often filename 910828.bin as you can find. If you want to try an old MEGA65 ROM with a BDF patch older than 920282 then you need 911001.bin. Do not confuse these, as patching will work just the patched ROM will be unusable with some strange "full of characters" display then, like this one (using the patched ROM in Xemu, or even on a real MEGA65):

bad-patch-screen

If you have anything like this, it's a clear sign that you used the wrong C65 ROM as "patch base" for patching.

As users mostly would like to use up-to-date ROMs, this documentation from now only talks about using decent BDF patches and the patch base being C65 original ROM version 910828.

  • If you have a real Commodore 65, you can dump its ROM ;)
  • best way: Cloanto (owner of the rights on C65 ROMs as well, among many things) has the "C64 forever" package which has a free-to-download version, it also includes the mentioned C65 ROM! Also you may want to consider to support them with purchasing the full version (no, I am not paid to advertise them, or anything like that!)
  • If you forget where your Commodore 65 is (surely you have one!); it's rumoured that its ROM dump can also be google'd and found as 910828.bin. I cannot take any legal responsibility about this action though, also it's just a rumour has something to do with "Zimmers".

Assuming you have the mentioned version of the original C65 ROM now. As I've written, you can use as-is, and you can stop here (by jumping to the last section of this page). Though, it's full of bugs, unfinished implementations and limitations and lack of any MEGA65 feature for sure. Many newly written MEGA65 software won't work with it at all. Surely, you can use it to check out how the C65 felt.

If you need the most commonly used MEGA65 ROM then you need to patch this ROM with a binary patch. Please back up this original C65 ROM though and keep it safe: you may need it in the future to patch it multiple times, you always need this original C65 ROM version to apply newer patches on, as well!

Yes, this is complicated and annoying, and yes, I'm really sorry to disappoint you. I would be the happiest to be able to include the ROM with Xemu by default, it's not up to me!

Patching C65 ROM 910828 to become MEGA65 ROM

So you have your C65 ROM version 910828 described in the previous section. If you decide the bare C65 ROM is not enough (and this is probably what you want to decide as well) then you need to patch it with the developments/enhancements done by the MEGA65 team.

To grab the BDF file (the binary patch file) visit this link https://files.mega65.org/ and click on the "Files" button on the top. Look for "BDF" ("C65 ROM diff files") and download the BDF file. If there are multiple ones, you may want the latest, of course.

Now you need the bspatch utility.

Use the command line (hey, no need to be afraid; with 8 bit micros you usually use the command line ... unless something like with GEOS):

bspatch 910828.bin new-920364.bin 920364.BDF

where 910828.bin is the C65 ROM file (thus needed to be in your current directory), and 920364.BDF here is an example (the exact file name depends on which version you've downloaded) only. If everything goes well, you have a new new-920364.bin file now, which is the MEGA65 ROM you get with patching the original 910828.bin with the binary bs-patch of 920364.BDF.

(this part of this wiki page is based on the short tutorial at https://gist.github.com/ricardoquesada/9f6cf7bef3e6952d21ee792524a57aaa)

Finally, how to update the ROM on your emulated SD-card in Xemu

So now you have your ROM of choice you want Xemu to use. Great.

Right click into the running emulator window, select the menu item "Disks" -> "SD-card" -> "Update files on SD image". If you have a question "Use the previously installed ROM" from Xemu, say "no", as you want to install a new ROM (this question should only appear if a MEGA65.ROM file already exists in the preferences directory of Xemu). Then you'll be prompted for the ROM, so you need to select it. Xemu will update the SD-card image for you. At this point, if you encounter any problem after the update, you can try to exit Xemu and re-start, though in decent enough Xemu versions this shouldn't be an issue any more.