This repository contains the firmware source code for a master system game cartridge reader and programmer.
For more information about this, and use examples and instructions, please visit the project page:
Current features are:
- Cartridge ROM dumping
- Flash cartridge programming
- Auto-detects ROM size, or set manually
- Supported cartriges:
- Supports SMS 50 pin cartridges
- SMS 44 pin (Japan) /Mark-III cartriges
- SG-1000 Cartridges
- Sega Cards (through a card catcher)
- Game Gear (using an appropriate adapter)
On a Linux or Unit system, with make, gcc-avr and avr-libc installed and in your path, it should be a simple matter of typing "make".
You will also need dfu-programmer to program the micro-controller. If you have the correct permissions set in udev, you should be able to type "make flash" to program the micro-controller for the first time.
If you are reprogramming or upgrading, you must enter bootloader mode first by using the "boot" command in the virtual com port.
You will need WinCUPL, which is at this date (2021-02) available for free from microchip here:
I could not get the GUI to work reliably on my system (it kept crashing, especially in simulation) so instead I use batch files. But it's probably better like this anyway.
Run setup.bat once (optionally edit it first if the paths are different on your system), then run compile.bat to compile and generate a new .JED file and use the ATMISP tool to program the CPLD.
There is now a user interface based on FreeSimpleGUI. At the moment it is only distributed in source code format, but eventually I plan to use pyinstaller to make something easier. Dependencies are:
- FreeSimpleGUI
- python3-serial
- xmodem
The client/ directory contains a python tool called carttool.py which opens the device (ttyACMx) and types commands for you. If you are producing a large batch of cartridges, this is recommended as it is much faster (less typing!), and can be more convenient than using the GUI.
The following python packages are required:
- python3-serial
- xmodem
usage: carttool.py [-h] [-i] [-b] [-r outfile.sms] [-p rom.sms] [-d DEVICE] [-l] [-v] [--bootloader]
[--verify] [--update_firmware firmware.hex]
Control tool for smscprogr
options:
-h, --help show this help message and exit
-i, --info Provide information about the programmer and cartridge
-b, --blankcheck Check if a FLASH cartridge is blank
-r outfile.sms, --read outfile.sms
Read the cartridge contents to a file.
-p rom.sms, --prog rom.sms
(Re)program the cartridge with contents of file
-d DEVICE, --device DEVICE
Use specified serial port device.
-l, --listports List serial ports
-v, --verbose Enable verbose output
--bootloader Restart programmer in bootloader for FW update
--verify Read back and compare after programming
--update_firmware firmware.hex
Update programmer firmware with hexfile
The cartridge reader/programmer can be controlled using your favorite serial terminal software. For instance, under Linux the programmer should appear as /dev/ttyACMx and you can simply fire minicom -D /dev/ttyACMx and type ? followed by enter to get a list of available commands.
ROMs can be dumped or programmed (supported Flash cartridge only) using XModem transfers.
For examples, please visit the project homepage.
- Raphael Assenat
GPL. See LICENSE for more information.
