Build your own Commodore 64 cartridge

I’m a geek, you’re a geek, we’re all geeks.

And geeks likes their retrogaming experience to be as similar to the good ol’ days, yet can’t wait for load up time. Particularly when it comes to Commodore 64 and it’s legendarily slow load process.

Some games were delivered by cartridge in the best days of the Commodore 64. Some didn’t and geeks from around the world had to load up from cassette tape or floppy disks, both of which are much slower to execute.

Lots of those games have since been adapted to Cartridge format either for emulation or physical carts.

In today’s article we explore the making of custom physical Commodore 64 cartridges.


Click here for more articles on the Commodore 64

here is a follow up article on the magic desk type of C64 cartridges

Straight from the beginning, the Commodore 64 was half gaming platform and half home computer. It’s predecessor, the flopped Max Machine (also named Commodore Max) was meant to be a gaming platform and that architechture was the base of what would become the Commodore 64. Needless to say, Cartridge was at the core of the functionality of the computer and could add functionality, take control over the Kernal and possibilities were endless.

At some point during the C64 production time, Commodore made a console variant of the Commodore 64 named the Gaming System – or C64GS. It too was a flop but for other reasons.

If Commodore architecture and history is of interest, there’s a good series of documentary from The 8-bit guy on YouTube and particularly this one about the Commodore 64:

The history of the Commodore 64 – 8-bit guy on Youtube

Now, there are multiple ways the cartridges can be loaded into the C64, depending what modes and what architecture is to be used. Some carts take control of the whole system and therefore don’t even require a fully functionnal Commodore 64 to execute – think dead test carts – while other carts only load tools, routines or data into memory and return to BASIC – think fast-load cartridges.

Essentially, all of the C64 RAMs and ROMs are addressable together within the same set of address available to the CPU, with banks to switch trough different components. When a cart is inserted, it’s memory is also mapped to the same memory address and depending what setup lines are chosen on the cart, the CPU will behave differently.

Bank switching is at the heart of this shared address philosophy. The Kernal – the C64 operating system – is at the same address as some of the BASIC memory, but not on the same bank. Same goes for the Character map used to display characters on screen, which also shares the same addresses as the inputs and outputs (I/O) – switching trough the different bank is what makes possible the capacity of addressing wider memory location than what the CPU can natively do. A Programmable Logic Array is responsible for bank switching – nicknamed simply the P.L.A. – here’s an article on the PLA and how to build a replacement.

Some of the signals that are available on the expansion ports include EXROM, GAME, ROML, ROMH.

GAME and EXROM are signals directly linked to the PLA’s logic to allow for a cart to map one or two 8kbyte ROM into the system, by wiring the ROM’s enable pins to ROML or ROMH lines of the port. Essentially, ROM on the cartridge becomes one with the system and can be instantly accessible by the CPU trough the bank switching logic.

Cartridge PCB have been designed to exploit these lines in the most possible comprehensive way – simply put, the configuration of the expansion port is exposed to the PCB as well as the configuration of the ROMs from the port.

One such PCB is the OpenC64Cart by Giorgio SukkoPera – it is open hardware, and also available as shared project on PCBway.

The EXROM pin is directly exposed to the pin headers, same for the GAME pin. ROML/ROMH are selectable on the HI/LO ROM pin header and changes how the IC (an EPROM) is addressed. The extra A13, A14 and A15 pins are hardware switches to addresses bigger-than-addressable, essentially making a switch-selectable multi-ROM cartridge. With the proper setup, a cartridge can have 2, 4 or even up to 6 ROMs externally selectable. This can be useful for multiple versions of a game, but require a physical way to change the active ROM, such as a switch or jumper.

There are also simpler PCBs out there with less functionality – no EXROM selection, no GAME… only a premade PCB with address selection for the large EPROM.

Geek note: simple 16k cartridges don't expose EXROM or GAME, they are simply set low to get into 16k mode; there is no way for a software to access the basic ROM when in 16k mode. Basic software or software accessing the ROM such as diagnostic carts won't fully work in that mode.

One such PCB is the 16K Commodore 64 cart designed by iNimbleSloth of youtube fame. His cart design is also available as shared projects.

We’ll keep the more complexe cart building for another day. Here’s an article on diagnostic tools that includes discussions on advanced carts. For today let’s focus on the basic and build one cart.

Burn the EPROM

The EPROM needs to be burned with the binary required for it to run. Those aren’t the .CRT used by emulators, but some .CRT do include binaries. the VICE emulator v1.20 comes with a handy cartconv.exe (+cartconv.txt) for this purpose.

This PCB expects binaries to be 16k or smaller. We could put up to 2 standard 16k carts on a 27C256 EPROM, and up to 4 on a 27C512.

To combine several binaries (that will be addressed trought the various jumpers) we need the same technique as was described when we prepared ROM replacement chips.

Bill of material

  • Cartridge PCB
  • EPROM (size vary depending on needs)
  • 100 nF Capacitor
  • 10k resistor
  • 1N4148 diode (x2)
  • Shell (3d printed or store-bought online)
  • Socket if wanted (recommended)
  • Switches, pushbutton, wires and jumpers as needed

Construction

It is recommended to at least build one prototyping cart with sockets to test the specific setup before soldering everything. For a basic cart that holds only one software ROM, the various pins can be blotch-soldered; otherwise jumpers are a versatile option. Switches are always nice for multiple-ROM carts. Most PCBs add the possibility to add one RESET button that is tied directly to the expansion port’s RESET and is used to reset the whole computer.

The EPROM selection is mainly a matter of ROM size and availability. It is possible use 27C512 and 27C256 for most everything. Of course, smaller EPROM leads to less possibilities in a single cart, but for snigle-game cartridge this won’t be an issue.

Assembly

The components are properly identified – only need to ensure diods and eproms are facing the correct direction.

Once the PCB is soldered, the proper memory location must be addressed on the J1 and J2 location to make loading the C64 how we want. Some experimenting may be handy to get the hang of it, that is why it is preferrable to have a prototype PCB for initial testing of a cart.

Enjoy!

[addition – here is a follow up article on the Magic Desk type C64 cartridges]

Related Articles

VICE – the Versatile Commodore Emulator (vice-emu.sourceforge.io)
The Commodore MAX (wikipedia)
The Commodore 64 Gaming System (wikipedia)
History of C64 by 8-bit guy (youtube)
The Commodore 64 architecture (atarimagazine)
16k C64 Cart shared project (PCBway)
Build a PLA replacement (wereallgeeks)
OpenC64Cart (github)
OpenC64Cart 16k v2 shared project (PCBway)
Diagnostics tools (wereallgeeks)
C64 diagnostic and dead test cart (Sven’s website)
Versa64 PCB (github)
Versa64 PCB Shared project (PCBway)
C64 dead test & diagnostic cart by Jan Beta (youtube)
C64 ROM replacement (wereallgeeks)

3 thoughts on “Build your own Commodore 64 cartridge

  1. Pingback: Commodore 64 debuging – Diagnostic tools – We are All Geeks!

  2. Pingback: What is a Commodore 64 Magic Desk Cart ? – We are All Geeks!

  3. Pingback: C64 cartridge LED mods – We are All Geeks!

Comments are closed.