Read or Write your Game Boy games save data with an Arduino and PC.
While searching for a way to read save games from my game boy cartridges (because you know...if the battery dies you say goodbye to save data) I didn't come across any cheap solution.
After some search I stumbled on ATmega1284p from way back when I started using Arduino and learning about AVR. I did remember this ATmega1284p (already on breadboard!!!) had maniacbug code to work with Arduino! Lucky me!!
Then I started reading about cartridges and how to communicate with them, destroyed an Nintendo DS to get the cartridge connector, removed the protection to be compatible with GB and GBC cartridges and it was time to code!
You will need an RS232 to USB converter (like the FT232R) to connect the ATmega1284p to PC.
This works with ATmega1284p (Mighty 1284P from maniacbug) and MightyCore. Use the default configurations with 16Mhz external crystal.
ATmega1284p | Cartridge |
---|---|
PD4 | WritePin |
PD5 | ReadPin |
PD6 | ChipSelectPin |
PC0 | A0 |
PC1 | A1 |
PC2 | A2 |
PC3 | A3 |
PC4 | A4 |
PC5 | A5 |
PC6 | A6 |
PC7 | A7 |
PA0 | A8 |
PA1 | A9 |
PA2 | A10 |
PA3 | A11 |
PA4 | A12 |
PA5 | A13 |
PA6 | A14 |
PA7 | A15 |
PB0 | D0 |
PB1 | D1 |
PB2 | D2 |
PB3 | D3 |
PB4 | D4 |
PB5 | D5 |
PB6 | D6 |
PB7 | D7 |
I've developed and tested on macOS Catalina version 0.15.7 (19H2) and also tested on Debian x64 machine with GCC 8. The code should be compatible with any POSIX OS.
On Windows I recommend installing Visual Studio to compile the code or use the provided x86 executable.
- Follow the pinout to connect the cartridge connector to ATmega1284p
- Connect any compatible RS232 to USB converter to pins
PD0
andPD1
- Upper right corner: Code -> Download ZIP
$ git clone git@github.com:DMRodrigues/Arduino-GBx-Reader-Writer.git
$ cd Arduino-GBx-Reader-Writer
- macOS:
/dev/cu.usbmodem*
or/dev/cu.usbserial-*
- Linux:
/dev/ttyUSB*
or/dev/ttyACM*
(you need to be root or in group-mode) - Windows:
COM*
- Connect the Arduino to your PC and upload the sketch
- Navigate to executables folder and open the command line
- Execute the
GBx-Reader-Writer.exe
and provide the USB port- USB port e.g.
COM9
- USB port e.g.
- Interact with the shell by choosing 0 - 4.
- Connect the Arduino to your PC and upload the sketch
- Open the command line
- Compile the C program with
make
- Execute
gbx-reader-writer
and provide the USB port- USB port e.g.
-p /dev/ttyUSB0
- USB port e.g.
- Interact with the shell by choosing 0 - 4.
GBx-Reader-Writer.exe COM9
./gbx-reader-writer -p /dev/ttyUSB0
- Game Boy Advance games (WARNING: 5v from Arduino will damage the GBA cartridges that works with 3.3v)
MIT License
Copyright (c) 2020 Diogo Rodrigues
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.