How to Create a C64 Cartridge From a PRG File
- Posted by DIY Chris
- On October 11, 2020
- 1 Comments
- 64, c64, c64 cartridge, commodore, CRT to BIN, make commodore cartridge, PRG to BIN, prg to cartridge, prg to eeprom
I’ve found myself recently needing a few utilities but for quick access I wanted to have them on a cartridge. I wasn’t able to find any clear cut information on how to exactly go about doing that so I decided to put this quick tutorial together.
Note: I’m doing this on MacOS so it should also work the same in any Linux environment. I’m not sure about Windows.
The first thing you’ll need to do is to make sure that you have Python installed.
The syntax is simple:
python prg2crt.py test.prg test.crt
This will convert the PRG file to a CRT file which can be used by any C64 emulator such as VICE but is not suitable for burning onto an EEPROM because it includes a header which is needed for it to work with emulators.
So what we need to do is to strip the header out and the easiest way to do that is to remove the last 8192 bytes from the file.
Fortunately, MacOS and Linux provide just the tool for the job.
tail -c 8192 test.crt > test.bin
Typing the above command will grab the last 8192 bytes from test.crt and output that into test.bin leaving us with a perfectly suitable file for burning onto an EEPROM.
Hope this tutorial helps someone. I mainly just post these for my own reference because as they are mostly just one-offs I tend to forget the process and often find myself digging through Google for that information again. So this will save some time in the future.