GMod2

From IndividualComputers
Jump to: navigation, search
GMod2.jpg
GMod2 open.jpg

GMod2 is a C64 flash cartridge primarily aimed at OEM for use with games. It contains 512KiB flash ROM and 2KiB serial EEPROM and contains only very minimal logic as it was designed to be cost effective and is not meant to be used a generic flash cartridge.

Contents

Register

There is one register mapped to $DE00. The register is always active and there is no way to disable it.

bit r/w Flash ROM EEPROM Expansion Port
7 rw 1=write enable (write) Data output (read) -
6 w - Chip select (1=selected) EXROM (0=active)
5 w Bank Selection Bit#5 Clock -
4 w Bank Selection Bit#4 Data input -
3 w Bank Selection Bit#3 - -
2 w Bank Selection Bit#2 - -
1 w Bank Selection Bit#1 - -
0 w Bank Selection Bit#0 - -


bit7 bit6 mode
0 0 regular 8K Game mode, ROM readable at $8000
0 1 EEPROM selected, Flash inactive. EEPROM can be used via bits 4/5/7
1 0 illegal, do not use
1 1 Flash ROM writing enabled


At power-on/reset all bits default to 0. That means the cartridge starts in "8KGAME" mode in bank 0 with flash mode inactive and EEPROM not selected.

Flashing

  • to enable the flash mode, set bit7 and bit6 of the control register to 1
  • when the flash mode is enabled, ultimax mode will be enabled for all writes to addresses >= $8000
    • no write-through to C64 memory
    • writes to addresses >= $e000 go to the flash
    • I/O keeps working

Although it is unlikely to issue unintended EEPROM commands when flashing, it is recommended to program the flash ROM first, then initialize the EEPROM with its initial content.

CAUTION: Due to the minimalistic logic and hardware there is no way to bypass the cartridge startup (ie force flash mode) once the cartridge has been programmed with a valid cartridge header. For developers it is recommended to use either a Kernal-ROM that allows to bypass the CBM80 check (for example "SpeedDOS") or to use a cartridge expander or switch which allows to disconnect the EXROM line. During the development period of your cartridge you may also use some startup "magic key" that exits to BASIC, so you can use that to load/start a flasher program.

Again, due to the minimalistic logic, the flash mode will likely only work on ASSY 250469 ("ALDI" "short" board)

Have a look at the 'flash-identify' and 'flash-write' example code in our GMod2 repository

working with the cartridge ROM

  • GMod2 appears in the memory map like a standard "8KGAME" 8KiB cartridge (it can not be switched into "16KGAME" mode).
  • To disable (bank out) the cartridge ROM it is recommended to leave EXROM active and use the PLA ($01) to hide the ROM - that way no accidental EEPROM access can happen.
    • That means to make programs work that use the BASIC ROM, you must include a copy of the BASIC ROM in your cartridge image and copy it to RAM first.

Have a look at the 'cartridge-skeleton' example code in our GMod2 repository

using the EEPROM

  • the EEPROM on the Gmod2 operates in 16bit mode (x16 origination, ORG = 1). In particular that means that address offsets relate to 16bit words and not bytes. (refer to the datasheet for details)
  • since the chip select for the EEPROM is connected to the same I/O line as the EXROM line of the expansion port, the code that accesses the EEPROM must be executed in RAM.

Have a look at the 'eeprom-test' example code in our GMod2 repository

Links

Personal tools