Retrocube
Retrocube is a project of using a GameCube case for a retropie project (retro gaming using raspberry pi) This first part describe the hardware of this project.
Project
The aim is to build a retro gaming console using :
- A GameCube case
- A Raspberry Pi (with retropie)
- 2 GameCube gamepad
The console should run :
- Without keyboard
- The original power button from the GameCube should be working
- The original reset button from the GameCube should be working
- The front gamepad connectors (2) should be working
- The GameCube should be powered through the original power supply unit or any other supply unit
Hardware Part
GameCube opening tool
The GameCube uses 4 special screw. We need to build a tool to open it. Such a tool can be made using a simple Bic :
- Remove the ballpoint part
- Carefully, burn the end of the pen with a lighter
- Quickly put the burned end of the pen onto one of the 4 screw and wait for the pen to cool down
- Then you can use this tool to remove the 4 screw
GameCube dismantling
Safely dismantle all the parts
GPIO to gamepad
The gamepad will use the gamecon_gpio_rpi driver which use the following GPIO rev2 pins:
Carefully identify each pins, i use small paper to identify the interesting wire :
- 3.3V
- 5V
- PAD1
- PAD2
- PAD3
- GROUND
I found an adapter in an old dvd reader to connect the GPIO to the GameCube front panel. Each ( port 1 and port 2 ) gamecube controller should be connected to
- Pin2 to PAD2 or PAD3
- Pin3 to GROUND
- Pin6 to 3.3V
- Led to 5V
- Reset switch to PAD1
I used a continuity tester and the following connecter pinout to identify the wire.
and here is the result :
Power unit
To feed the pi with any power supply, i order an DC/DC converter on eBay ( 3A 5V ). So the Pi can be powered from the original power supply of the GameCube (12V) or by any other power supply (lower than 24V). The original power switch and the fan is used :
after the original power switch i soldered the DC/DC converter.
and the output of the power supply is feeding the Pi.
Final hardware
The position of the Raspberry Pi allow to put and remove the pi SD card in the original GameCube memory hole. The HDMI and Ethernet ports are available and the wire can go through the original video holes of the GameCube back. Here is the result :
Software Part
The software is based on RetroPie. The first step is to download the RetroPie project and to install it on the SD Card
RetroPie installation and configuration
dd if=Downloads/RetroPieImage_ver1.9.1.img of=/dev/rdisk2 bs=1m
Then boot the RetroPie with a HDMI screen and a usb keyboard then
F4 # to quit the menu
sudo raspi-config
> set date and time
> set keyboard layout
> overclock medium
> expand the root fs
> memory split 128M
sudo reboot
F4 # to quit the menu
- At this step it is possible to connect to the pi using SSH : ssh pi@raspberrypi.local
sudo apt-get update
cd RetroPie-Setup
chmod +x retropie_setup.sh
sudo ./retropie_setup.sh
> UPDATE SETUP (4)
> UPDATE BINARIES (5)
> SETUP
2 Latest firmware
sudo reboot
sudo ./retropie_setup.sh
> SETUP
11 install multi console gamepad
12 Enable gamecon_gpio_rpi with SNES-pad config
Gamecon patch and compilation
The original gamecon driver has some defects witch GameCube gamepad.
sudo cp -r /usr/src/gamecon_gpio_rpi-0.9 /usr/src/gamecon_gpio_rpi-0.9-bak
cd /usr/src/gamecon_gpio_rpi-0.9
sudo vi gamecon_gpio_rpi.c # Change the following lines :
sudo modprobe -r gamecon_gpio_rpi && sudo dkms remove gamecon_gpio_rpi/0.9 --all && sudo dkms install gamecon_gpio_rpi/0.9 && sudo modprobe gamecon_gpio_rpi map=0,0,3,0,0,3
echo "gamecon_gpio_rpi map=0,0,3,0,0,3" >> /etc/modules
sudo /etc/modules # To verify the new added line
sudo reboot
To disable some emulators, backup the original config file :
sudo cp .emulationstation/es_systems.cfg .emulationstation/es_systems.cfg-orig
then edit the configuration file to delete the emulator you don't want to see in the menu
Reset button
To allow the original reset button to quit a running game, we need to install pidkey, a software which trigger a keyboard event when the pooled GPIO is put to ground :
wget https://codeload.github.com/mmoller2k/pikeyd/zip/master
unzip master
cd pikeyd-master
make
sudo cp pikeyd /bin/pikeyd
sudo vi /etc/pikeyd.conf
/etc/pikeyd.conf is the config file which contain the key and the GPIO number
KEY_ESC 2
sudo vi /etc/rc.local
Add the following line to rc.local :
/bin/pikeyd &
References
GameCube opening http://www.ifixit.com/Teardown/Nintendo+GameCube+Teardown/1727
gamecon_gpio_rpi driver https://github.com/petrockblog/RetroPie-Setup/wiki/gamecon_gpio_rpi
GameCube gamepad pinout http://www.int03.co.uk/crema/hardware/gamecube/gc-control.html
RetroPie http://blog.petrockblock.com/retropie/