EasyFlash and other cartridges

append delete rosettif

Is there any EasyFlash support planned? Whether in a "hard" or "soft" way: the physical cartridge itself or a CRT file emulation mounted up.

If so, then could it also work in native mode?

I am working on some EF stuff at the moment that I am trying to provide with a kind of combined C64/C128 support (including to start it up in native mode), and I would like to enhance that support to the C65/MEGA65 if possible.

Besides, a little bit more generally speaking about native mode cartridges: the C128 has a rather flexible and user-friendly way of up to four independent custom expansion codes to co-exist within the same system at the same time, 2 x 32K or 4 x 16K in total (internal and external). Had any of the same scheme been inherited by the C65 world?

How should one prepare a cart boot code that at least partly survives on all machines?

Reply RSS


append delete #1. rosettif

I currently have two independent cart boot codes within the first two 8K blocks of EasyFlash:

1.) In C64 mode (or on a C64) it always powers up in Ultimax mode, so the 2nd 8K is mapped to $E000 where you have to jump through the RESET vector at $FFFC. (I assume it works the same on C65 in C64 mode.)

2.) The 1st 8K however is mapped to $8000, which can be used on C128 in native mode instead (by being keyed as cold + warm start entries + "cbm" string signature that the system searches for).

My main question is that if the latter solution can also be used on C65 in native mode the same way (or it has some other technique for this case).

append delete #2. gardners

Well, first question is whether you mean a MEGA65 with C64-compatible cartridge port, or C65 with its port that actually has more pins.

On the MEGA65, any C64 cartridge should just work, at least when we have everything right. Treat the C65 as a fancy C64, is my general recommendation.


append delete #3. rosettif

I mean the question from my software development point of view (I am not making a real cartridge, just writing a CRT file for that in general). That would be the best scenario if the MEGA65 had some built-in hypervisor support in the future for mounting up a CRT image as an EasyFlash cartridge emulation (similarly e.g. the Turbo Chameleon does). Then it should be compatible in the C64 mode at least, of course.

On the other hand, I mean the C65 as a system, i.e. what the Kernal does to such expansion codes it finds. (How much it had been derived from the C128 source before, or whether is this feature implemented at all here... etc.)

append delete #4. gardners

The memory model of the MEGA65 makes this a little harder to do. I'll have a think about how we might be able to do it, by mapping the planned 8MB expansion memory in a way that it can be used to emulate an easyflash cartridge.

As for how the C65 kernal does cartridge checking, I'm not really sure, other than the usual C64 cartridge detection happens in C64 mode first, before the C64 mode kernal escalates to C65 mode if there isn't a cart and C= isn't held.


append delete #5. rosettif

The C65 Preliminary briefly mentions that empty 256K over the ROM area reserved "for future cartridges", but that's all I've read about it by now. Maybe there is something in the Kernal taken from the C128 source codes untested (like the fast serial routines and some other things).

On C128 the contents are also only indirectly accessible by the MMU (in bank 4 or bank 8 etc.), but the operating system brings them to context and calls their cold start entries if the "cbm" signature is found (after the other initializations, still right before checking the floppy disk for boot record).

append delete #6. gardners

I'm guessing it will be something like that, but I haven't had a look into the C65 ROM source to see if it is already there or not. The source for the ROM is publicly available if you want to have a dig. I'd search for MAP instructions to help narrow it down.


append delete #7. rosettif

@gardners: Where are those sources on the net? I can't seem to find them (only the 64-mode Kernal's disassembly and some other things).

append delete #8. gardners
append delete #9. rosettif

Thanks. I try to take a look at it at the weekend.

As I have seen it in the meantime, on C128 the Phoenix routine calls the ROM entries, which is started from the Basic cold start (where it ends and steps forward to warm start).

The C65 also has a Phoenix routine, but it has some slightly different function (system diagnostic tests).

So it must be somewhere around the Basic cold start the most likely (unless it is removed).

:: @rosettif added on 15 Jun ’19 · 16:03

By the way, I have already prepared my program so that it can be called at any location: it gets its actual address by a stack trick first, then relocates itself to a safe RAM place (which is free on all machines) and runs from there.

So if any routine from any OS finds and calls it at any place in any way one day, it should run. (Though not tested yet, of course.)


(Leave this as-is, it’s a trap!)

There is no need to “register”, just enter the same name + password of your choice every time.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Deft, gardners, Ralph Egas