Area536 :: Rebooted

Sep 7, 2023 - 2 minute read - C64 gamedev

Back on the project, EasyFlash still not completely understood

Had a few days off this project. Obviously that doesn’t mean that no on-topic thinking takes place, and it’s been fruitful. The Easyflash generator works correctly now as far as I can tell. Not releasing it to the world just yet, but for now I can generate a working EasyFlash cartridge.

That’s to say that my code appears in LOROM ($8000) as well as HIROM ($E000). What still stumps me, is how to get from Ultimax mode into something I can actually use. That begins with the boot process, which requires a RESET vector at address $FFFC.

The example code I’m seeing across the internet isn’t very clear on the bare minimal requirements for this. I’m quite sure that Ultimax mode gets rid of all useful ROM routines, so I’m assuming the RESET vector that lives at hard-wired $FFFC must jump to a location within the HIROM bank itself (so from $E000 on up), and I’ll get control of the machine from there.

Haven’t been able to pull that off yet though.

The EasyFlash guide tells me to do a few things in order:

  • Provide the reset vector
  • Initialize the CPU registers $01 and $00 (in this order)
  • Initialize all I/O you need (SID, VIC-II etc.)
  • Scan the keyboard
  • Set up $DE02 and start the game.

Scanning the keyboard is something of a convention on EasyFlash. The user may press a few keys in order to kill the cartridge even while it’s attached. I intend to honor this convention. Users expect it and I intend to be a good citizen in this regard.

Need to think through each of the steps above. Especially bank switching5 is a complicated can of worms. Larry isn’t a complex game logic-wise but it’s very heavy on the graphics assets and dialogue text. I’d like to avoid duplication, but a full megabyte of ROM sure does look tasty.

Also: I/O initialization looks simple enough but I have no idea what it really means in practice. I’m seeing example routines with no documentation, which is very annoying.