User Tools

Site Tools


development:flasher

Cartridge Flasher

The cartridge flasher is an interface for a PC to interact with a GameTank cartridge over USB. This tool is designed as a “shield” board that stacks on top of an Arduino Mega 2560 which has enough GPIO pins to connect to the cartridge directly without additional components.

All that's needed to build the Cartridge Flasher is:

  • Arduino Mega 2560
  • Cartridge Flasher PCB
  • Edgeboard connector with 36 contacts and 0.1“ pitch that accepts 1.6mm thick cards.

Flasher Firmware

The Arduino code for the flasher shield can be found in the eepromprogrammer git repo.

The flasher tool communicates with the PC through the serial device that the Arduino provides. On Windows this will be one of the COM ports and on Linux/Mac this will appear as a device in /dev like /ttyACM0 or /ttyUSB0.

The firmware for the flash tool exposes a serial console with a few different commands. Some of these are useful for debugging cartridge hardware but for the most part this is designed for a dedicated client program to interact with.

Client program

Programs are sent over the serial link as a hexadecimal text representation of the data. This would be supremely tedious to manually send, so a client program is used that can read GTRs (GameTank Roms) and send them to the flasher.

The current recommended program is GameTank Flashing Overhauled.

A typical invocation of the program looks like this:

./GTFO.exe -p COM3 ~/repos/fiend/bin/fiend.gtr.bank*

Bank files will have extensions ending with “bank” and a hexadecimal number such as “bank80”. “bank9A” or “bankFF”. The number will be used as the bank number on a 2MB flash cartridge in which to store the data in the file. If multiple bank files are given to GTFO either individually or using a wildcard, the program will flash the provided banks in a single session and handle the required bank changes in between.

Whole ROM files as used by the emulator, ie. *.gtr files without any “bank” extension, can also be flashed with GTFO in which case all banks of the cartridge will be flashed even if that part of the file is all zeroes.

development/flasher.txt · Last modified: 2023/09/04 18:19 by clyde