Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-peacock committed Aug 2, 2018
0 parents commit 17e25a6
Show file tree
Hide file tree
Showing 8 changed files with 320 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# RetroPie 4.4 for Sixteenbit Systems

Scripts for setting up RetroPie on a Gameboy Zero.

## What's in the box

1. Optimized [config.txt](settings/config.txt) which includes overclocking
1. Download Gameboy Zero splashscreen by [AJRedfern](https://www.sudomod.com/forum/viewtopic.php?f=8&t=1440)
1. Install the gbz35 theme and set it as default
1. Install the gbz35-dark
1. Enable 30sec autosave on roms
1. Disable 'wait for network' on boot

## Flashing the pre-configured image

A preconfigured image is available to flash at https://github.com/sixteenbit/retropie-i2s/releases. Download the latest release and flash the .img to an SD card (e.g. using [Etcher](https://etcher.io/) or [Apple Pi Baker](https://www.tweaking4all.com/software/macosx-software/macosx-apple-pi-baker/))

## Running the installer

1. Download RetroPie from the [official site](https://retropie.org.uk/download/)
1. Flash the .img to an SD card (e.g. using [Etcher](https://etcher.io/) or [Apple Pi Baker](https://www.tweaking4all.com/software/macosx-software/macosx-apple-pi-baker/))
1. Enable WIFI and SSH
1. `git clone https://github.com/sixteenbit/retropie-i2s.git`
1. `cd retropie-i2s`
1. `sudo ./install.sh YES`
1. `sudo reboot now`

## Post installation

### Update all the things

```bash
sudo apt-get update; sudo apt-get upgrade -y;
```

### Install Retrogame

```bash
cd; curl https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/retrogame.sh >retrogame.sh
sudo bash retrogame.sh
```

### Install i2s Script

```bash
curl -sS https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/i2samp.sh | bash
```

### Install Battery Monitor

This is a [modified version](https://github.com/sixteenbit/Mintybatterymonitor) of HoolyHoo's [Mintybatterymonitor](https://github.com/HoolyHoo/Mintybatterymonitor).

1. `wget https://raw.githubusercontent.com/sixteenbit/Mintybatterymonitor/master/MintyInstall.sh`
1. `sudo git clone https://github.com/sixteenbit/Mintybatterymonitor.git`
1. `sudo chmod 777 MintyInstall.sh`
1. `sudo ./MintyInstall.sh`
1. `sudo reboot now`


## Credits

- Installer script originally built by [Kite](https://github.com/kiteretro/Circuit-Sword) for the Circuit Sword but has been re-purposed for Gameboy Zero.
- MintyBatteryMonitor is a modified version of [HoolyHoo's](https://github.com/HoolyHoo/Mintybatterymonitor).
- Splashscreen was created by [AJRedfern](https://www.sudomod.com/forum/viewtopic.php?f=8&t=1440)
160 changes: 160 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#!/bin/bash

#
# Author: Justin Peacock
#
# THIS HEADER MUST REMAIN WITH THIS FILE AT ALL TIMES
#
# This firmware is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This firmware is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this repo. If not, see <http://www.gnu.org/licenses/>.
#

if [ "$EUID" -ne 0 ]
then echo "Please run as root (sudo)"
exit 1
fi

if [ $# == 0 ] || [ $# == 3 ] ; then
echo "Usage: ./<cmd> YES [branch] [fat32 root] [ext4 root]"
exit 1
fi

#####################################################################
# Vars

if [[ $3 != "" ]] ; then
DESTBOOT=$3
else
DESTBOOT="/boot"
fi

if [[ $4 != "" ]] ; then
DEST=$4
else
DEST=""
fi

GITHUBPROJECT="custom-systems"
GITHUBURL="https://github.com/sixteenbit/$GITHUBPROJECT"
PIHOMEDIR="$DEST/home/pi"
BINDIR="$PIHOMEDIR/$GITHUBPROJECT"
USER="pi"

if [[ $2 != "" ]] ; then
BRANCH=$2
else
BRANCH="master"
fi

#####################################################################
# Functions
execute() { #STRING
if [ $# != 1 ] ; then
echo "ERROR: No args passed"
exit 1
fi
cmd=$1

echo "[*] EXECUTE: [$cmd]"
eval "$cmd"
ret=$?

if [ $ret != 0 ] ; then
echo "ERROR: Command exited with [$ret]"
exit 1
fi

return 0
}

exists() { #FILE
if [ $# != 1 ] ; then
echo "ERROR: No args passed"
exit 1
fi

file=$1

if [ -f $file ]; then
echo "[i] FILE: [$file] exists."
return 0
else
echo "[i] FILE: [$file] does not exist."
return 1
fi
}

#####################################################################
# LOGIC!
echo "INSTALLING.."

# Checkout code if not already done so
if ! exists "$BINDIR/LICENSE" ; then
execute "git clone --recursive --depth 1 --branch $BRANCH $GITHUBURL $BINDIR"
fi
execute "chown -R $USER:$USER $BINDIR"

#####################################################################
# Copy required to /boot

#if ! exists "$DESTBOOT/config_ORIGINAL.txt" ; then
# execute "cp $DESTBOOT/config.txt $DESTBOOT/config_ORIGINAL.txt"
# execute "cp $BINDIR/settings/config.txt $DESTBOOT/config.txt"
#fi

#####################################################################
# Copy required to /

# Copy splashscreens
execute "cp $BINDIR/splashscreens/GBZ-Splash-Screen.mp4 $PIHOMEDIR/RetroPie/splashscreens/GBZ-Splash-Screen.mp4"

# Copy retrogame config
#execute "cp $BINDIR/settings/retrogame.cfg $DEST/boot/splashscreens/retrogame.cfg"

# Copy USB sound
#execute "cp $BINDIR/settings/asound.conf $DEST/etc/asound.conf"

# Fix splashsreen sound
if exists "$DEST/etc/init.d/asplashscreen" ; then
execute "sed -i \"s/ *both/ alsa/\" $DEST/etc/init.d/asplashscreen"
fi
if exists "$DEST/opt/retropie/supplementary/splashscreen/asplashscreen.sh" ; then
execute "sed -i \"s/ *both/ alsa/\" $DEST/opt/retropie/supplementary/splashscreen/asplashscreen.sh"
fi

# Install the gbz35 theme and set it as default
if ! exists "$DEST/etc/emulationstation/themes/gbz35/gbz35.xml" ; then
execute "mkdir -p $DEST/etc/emulationstation/themes"
execute "rm -rf $DEST/etc/emulationstation/themes/gbz35"
execute "git clone --recursive --depth 1 --branch master https://github.com/rxbrad/es-theme-gbz35.git $DEST/etc/emulationstation/themes/gbz35"
execute "cp $BINDIR/settings/es_settings.cfg $DEST/opt/retropie/configs/all/emulationstation/es_settings.cfg"
execute "sed -i \"s/carbon/gbz35/\" $DEST/opt/retropie/configs/all/emulationstation/es_settings.cfg"
execute "chown $USER:$USER $DEST/opt/retropie/configs/all/emulationstation/es_settings.cfg"
fi

# Install the gbz35-dark theme
if ! exists "$DEST/etc/emulationstation/themes/gbz35-dark/gbz35.xml" ; then
execute "mkdir -p $DEST/etc/emulationstation/themes"
execute "rm -rf $DEST/etc/emulationstation/themes/gbz35-dark"
execute "git clone --recursive --depth 1 --branch master https://github.com/rxbrad/es-theme-gbz35-dark.git $DEST/etc/emulationstation/themes/gbz35-dark"
fi

# Enable 30sec autosave on roms
execute "sed -i \"s/# autosave_interval =/autosave_interval = \"30\"/\" $DEST/opt/retropie/configs/all/retroarch.cfg"

# Disable 'wait for network' on boot
execute "rm -f $DEST/etc/systemd/system/dhcpcd.service.d/wait.conf"

#####################################################################
# DONE
echo "DONE!"
30 changes: 30 additions & 0 deletions settings/i2s/retrogame.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Sample configuration file for retrogame.
# Really minimal syntax, typically two elements per line w/space delimiter:
# 1) a key name (from keyTable.h; shortened from /usr/include/linux/input.h).
# 2) a GPIO pin number; when grounded, will simulate corresponding keypress.
# Uses Broadcom pin numbers for GPIO.
# If first element is GND, the corresponding pin (or pins, multiple can be
# given) is a LOW-level output; an extra ground pin for connecting buttons.
# A '#' character indicates a comment to end-of-line.
# File can be edited "live," no need to restart retrogame!

# Here's a pin configuration for the PiGRRL 2 project:

LEFT 23 # Joypad left
RIGHT 24 # Joypad right
UP 27 # Joypad up
DOWN 22 # Joypad down
LEFTCTRL 13 # 'A' button
LEFTALT 12 # 'B' button
Z 20 # 'X' button
X 16 # 'Y' button
SPACE 5 # 'Select' button
ENTER 6 # 'Start' button
A 17 # Left shoulder button
S 26 # Right shoulder button

# For configurations with few buttons (e.g. Cupcade), a key can be followed
# by multiple pin numbers. When those pins are all held for a few seconds,
# this will generate the corresponding keypress (e.g. ESC to exit ROM).
# Only ONE such combo is supported within the file though; later entries
# will override earlier.
6 changes: 6 additions & 0 deletions settings/usb/asound.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pcm.!default {
type hw card 1
}
ctl.!default {
type hw card 1
}
42 changes: 42 additions & 0 deletions settings/usb/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
gpu_mem_256=128
gpu_mem_512=256
gpu_mem_1024=256
overscan_scale=1
dtparam=i2c_arm=on

# Disable Pi Status LED
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on

# Disable Bluetooth
# dtoverlay=pi3-disable-bt

# Disable Rainbow Splash
disable_splash=1

# Overclocking
arm_freq=1000
gpu_freq=500
core_freq=500
sdram_freq=500
sdram_schmoo=0x02000020
over_voltage=2
sdram_over_voltage=2

# Rotate display
display_rotate=2
17 changes: 17 additions & 0 deletions settings/usb/es_settings.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<bool name="BackgroundJoystickInput" value="false" />
<bool name="DrawFramerate" value="false" />
<bool name="EnableSounds" value="true" />
<bool name="ParseGamelistOnly" value="false" />
<bool name="QuickSystemSelect" value="true" />
<bool name="SaveGamelistsOnExit" value="true" />
<bool name="ScrapeRatings" value="true" />
<bool name="ShowHelpPrompts" value="true" />
<int name="MaxVRAM" value="100" />
<int name="ScraperResizeHeight" value="0" />
<int name="ScraperResizeWidth" value="400" />
<int name="ScreenSaverTime" value="300000" />
<string name="Scraper" value="TheGamesDB" />
<string name="ScreenSaverBehavior" value="dim" />
<string name="ThemeSet" value="carbon" />
<string name="TransitionStyle" value="fade" />
Binary file added splashscreens/GBZ-Splash-Screen.mp4
Binary file not shown.

0 comments on commit 17e25a6

Please sign in to comment.