git.phenomic.net/Gameboy-Color-Cart-Reader/develop This commit looks good
Details
git.phenomic.net/Gameboy-Color-Cart-Reader/master This commit looks good
Details
|
||
---|---|---|
.vscode | ||
Game-Boy-Cartreader-Client | ||
Game-Boy-Cartreader-Firmware | ||
eagle | ||
images | ||
.gitignore | ||
Game-Boy-Cartreader-Firmware.atsln | ||
Jenkinsfile | ||
LICENSE | ||
README.md |
README.md
Game Boy Cartreader & -Writer
This is a Game Boy Cartreader and -Writer for the Atmel AVR ATmega32 Microcontroller. It is able to read ROM, RAM Saves and the RTC Registers on Game Boy Cartridges. It also is able to write to the RTC Registers and RAM Saves.
Table of Contents
- Game Boy Cartreader & -Writer
Motivation
I started this project in 2014 and working on it further and overhauling it an will be used in combination with the Game Boy Emulator.
Circuit board
Schematic
Board with Parts
Board ready for Print
This Board can be printed out. The image has a DPI of 600. Afterwards you need to connect wire bridges, as shown in the top image with the red lines (Top Layer connections).
EAGLE
The schematic- and board layout project files are located in the ./eagle directory. The project files can be opened with Cadsoft EAGLE or Autodesk EAGLE.
Getting Started
Required Hardware
- AVR ISP Programmer (In-System-Programmer) to program the Microcontroller
- Game Boy Cartreader & -Writer Circuit Board
- USB 2.0 Cable Type B for the Cartreader
Prerequisites
In order to use this project you need to have all the required Hardware and have either AVR Toolchain installed for 8-Bit Controllers or use AtmelStudio to compile the project. Afterwards you want to use a Flashing tool such as avrdude to write the firmware on the controller. You also need to have the Go Binaries installed and having set the $GOPATH environment variable to your Go workspace.
Compiling the Firmware
sudo apt-get install gcc-avr avr-libc
cd Game-Boy-Cartreader-Firmware
make
Flashing the Firmware
sudo apt-get install avrdude
cd Game-Boy-Cartreader-Firmware
# Writing the Firmware
avrdude -c <programmer> -P <port> -p m32 -U flash:w:game-boy-cartreader-firmware.hex
avrdude -c <programmer> -P <port> -p m32 -U eeprom:w:game-boy-cartreader-firmware_eeprom.hex
# Setting the fuses
avrdude -c <programmer> -P <port> -p m32 -U hfuse:w:0xC1:m
avrdude -c <programmer> -P <port> -p m32 -U lfuse:w:0xFF:m
If you need a comprehensive guide on how to use avrdude please take a look here.
Installation of the Client
Currently only Windows is supported. Cross-Platform support will follow.
# Clone Project and receive dependencies
go get git.phenomic.net/phenom/gameboy-color-cart-reader/...
# Install Client
cd $GOPATH/src/git.phenomic.net/phenom/gameboy-color-cart-reader
go install ./...
Usage
Serial Commandlist
This describes the Protocol being used for Communication over the serial line. When rebooting the device the Baudrate is set to 9600 Symbols per second on reset.
+---------+-----------------------------------+-------------------------------------------------------------------------------+
| Command | Parameter List (Length Name, ...) | Description |
+---------+-----------------------------------+-------------------------------------------------------------------------------+
| 0x00 | - | Trigger CPU Reset and print READY(0x52 0x45 0x41 0x44 0x59) after back Online |
| 0x01 | 0x04 Baudrate | Set Baudrate (Initially 9600) |
| 0x02 | - | Reset Memory Banking Controller and print OK (0x4F 0x4B) after done |
| 0x03 | 0x02 Address | Read Byte from Address |
| 0x04 | 0x02 Address, 0x01 Value | Write Byte on Address |
| 0x05 | 0x02 Address, 0x02 Length | Read n Bytes from Address to (Address + Length) |
| 0x06 | 0x02 Address, 0x02 Length | Writes n Bytes from Serial from Address to (Address + Length) |
| 0x07 | 0x01 Value | Selftest: Returns the Value over Serial |
+---------+-----------------------------------+-------------------------------------------------------------------------------+
Go Cartreader Client
TODO: This will describe how to use the Client for the Cartreader device.
Dependencies
Game Boy Documentation used
- Cartridge Header
- Memory Bank Controllers
- Emulating a GameBoy Cartridge with an STM32F4
- Game Boy CPU Manual - Page 137-138: Typical Timings
License
Distributed under the MIT License. See LICENSE
for more information.