Last active
September 19, 2025 16:44
-
-
Save fommil/99aadd19418eca65b510345bd2628398 to your computer and use it in GitHub Desktop.
RetroStart: kid-friendly gaming UX for raspberry pi 500s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Copyright 2025 Sam Halliday | |
| # License BSD-3 | |
| # This allows for a kid-friendly UX to a Raspberry Pi 500 whereby you plug in a | |
| # colour coded USB thumbdrive to start a specific game. If no drive is present | |
| # it powers off, and a parent drive can be used to eenter the desktop. | |
| # I bought the cheapest colour coded drives I could find at | |
| # https://www.amazon.co.uk/dp/B074DWKG7Q but be aware that they have an | |
| # embedded LED. | |
| # | |
| # It is just looking to see if a pre-defined file exists, it isn't doing | |
| # arbitrary code execution, so it is safe in that sense. | |
| # | |
| # The examples below use amiberry, scummvm, and various console emulators. It | |
| # can be extended to support any app. There is a momentary flash of the desktop | |
| # and it's possible to exit the emulators and get a terminal so don't consider | |
| # this to have kiosk levels of security... it's just to simplify | |
| # starting up games for kids who don't know how to read or use a desktop. | |
| # | |
| # To automatically start, put this file into the home directory and make | |
| # it executable, then create an entry in ~/.config/autostart/retrostart.desktop | |
| # containing | |
| # | |
| # [Desktop Entry] | |
| # Type=Application | |
| # Name=RetroStart | |
| # Exec=/home/pi/retrostart.sh | |
| # | |
| # ScummVM (and others) are available through the regular Raspberry Pi OS channels. | |
| # Amiberry is available at https://github.com/BlitterStudio/amiberry/releases/ | |
| # SNES9X must be compiled from https://github.com/snes9xgit/snes9x | |
| # | |
| # Many titles and ROMS are available on https://archive.org/ | |
| # | |
| # MAME is a PITA to set up, best avoid using the UI at all and just edit the | |
| # .mame/mame.cfg, e.g. the following | |
| # autoframeskip 1 | |
| # frameskip 1 | |
| # unevenstretch 0 | |
| # filter 0 | |
| # plus manually editing the cfg files to bind a button to insert coins etc. | |
| # I found it was still pretty laggy even on an rpi5 for early 1990s games. | |
| # Games must go into mame/roms, and match the expected set of the emulator. Pack | |
| # 0.251 seems to be corrupted but the next version seems ok, even though our binary says it is 0.251 | |
| # https://archive.org/download/mame-0.260-roms-non-merged/MAME%200.260%20ROMs%20%28non-merged%29/MAME%200.260%20ROMs%20%28non-merged%29/ | |
| # | |
| # Amiga games can be synced from whdload with | |
| # | |
| # lftp -u ftp,any ftp2.grandis.nu <<EOF | |
| # set ftp:ssl-allow no | |
| # set ssl:verify-certificate no | |
| # cd "Retroplay WHDLoad Packs/Commodore_Amiga_-_WHDLoad_-_Games" | |
| # mirror --verbose --only-missing --no-perms --target-directory=. . | |
| # bye | |
| # EOF | |
| # | |
| # clean up old mount points | |
| sudo rmdir /media/pi/* 2&>/dev/null | |
| #echo "RETROSTART" | |
| # assumes we're using a udisksctl managed desktop environment | |
| for dev in /dev/sd?* ; do | |
| [ -b $dev ] || continue | |
| udisksctl mount -b $dev 2>/dev/null | |
| done | |
| cd $HOME | |
| # set up the snes emulator to use multitap | |
| if [ $(lsusb | grep -c gamepad) -ge 3 ] ; then | |
| echo "enabling multitap" | |
| sed -i 's/ControllerPort1 = joypad/ControllerPort1 = multitap/' .config/snes9x/snes9x.conf | |
| else | |
| echo "disabling multitap" | |
| sed -i 's/ControllerPort1 = multitap/ControllerPort1 = joypad/' .config/snes9x/snes9x.conf | |
| fi | |
| # cd ~/.local/share/vice | |
| # mv c64 C64 | |
| # cd C64 | |
| # for f in characters.* ; do mv $f -v ${f/characters./chargen-} ; done | |
| # for f in basic.* ; do mv $f -v ${f/basic./basic-} ; done | |
| # for f in kernal.* ; do mv $f -v ${f/kernal./kernal-} ; done | |
| # give a moment for drives to mount | |
| sleep 1 | |
| # TODO shout down if the hdmi isn't connected to a live tv | |
| # otherwise the audio doesn't work when we turn it on. | |
| # TODO carousel GUI mode to select games | |
| for mount in /media/pi/*; do | |
| [ -d "$mount" ] || continue | |
| # echo " RETROSTART checking $mount" | |
| if [ -e "$mount/admin" ]; then | |
| exit 0 | |
| fi | |
| if [ -e "$mount/swos" ]; then | |
| amiberry --autoload Amiberry/lha/S/SensibleWorldOfSoccer_v2.3_0840.lha | |
| fi | |
| if [ -e "$mount/swos9596" ]; then | |
| amiberry --autoload Amiberry/lha/S/SensibleWorldOfSoccer9596_v2.3_1755.lha | |
| fi | |
| if [ -e "$mount/swos9697" ]; then | |
| amiberry --autoload Amiberry/lha/S/SensibleWorldOfSoccer9697_v2.3_0842.lha | |
| fi | |
| if [ -e "$mount/swos9798" ]; then | |
| amiberry --autoload Amiberry/lha/S/SensibleWorldOfSoccer9798_v2.3.lha | |
| fi | |
| if [ -e "$mount/swos2425" ]; then | |
| amiberry --autoload Amiberry/lha/S/SensibleWorldOfSoccer2425_v2.3.lha | |
| fi | |
| if [ -e "$mount/lemmings" ]; then | |
| amiberry --autoload Amiberry/lha/L/Lemmings_v1.5_Files_2089.lha | |
| fi | |
| if [ -e "$mount/cannonfodder" ]; then | |
| amiberry --autoload Amiberry/lha/C/CannonFodder_v2.0_0860.lha | |
| fi | |
| if [ -e "$mount/sf2t" ]; then | |
| snes9x-gtk "SNES/Street Fighter II Turbo - Hyper Fighting (U) [!].smc" | |
| fi | |
| if [ -e "$mount/bomberman" ]; then | |
| snes9x-gtk "SNES/Super Bomberman (U).smc" | |
| fi | |
| if [ -e "$mount/bomberman2" ]; then | |
| snes9x-gtk 'SNES/Super Bomberman 2 (U) [!].smc' | |
| fi | |
| if [ -e "$mount/marioworld" ]; then | |
| snes9x-gtk 'SNES/Super Mario World (U) [!].smc' | |
| fi | |
| if [ -e "$mount/zelda" ]; then | |
| snes9x-gtk 'SNES/Legend of Zelda, The - A Link to the Past (U) [!].smc' | |
| fi | |
| if [ -e "$mount/pilotwings" ]; then | |
| snes9x-gtk "SNES/Pilotwings (U) [!].smc" | |
| fi | |
| if [ -e "$mount/shadowrun_snes" ]; then | |
| snes9x-gtk "SNES/Shadowrun (U) [!].smc" | |
| fi | |
| if [ -e "$mount/tmnt4" ]; then | |
| snes9x-gtk "SNES/Teenage Mutant Ninja Turtles IV - Turtles in Time (U) [!].smc" | |
| fi | |
| if [ -e "$mount/supermario1" ]; then | |
| nestopia -f "NES/Europe/Super Mario Bros. (E) (V1.1) [!].nes" | |
| fi | |
| if [ -e "$mount/wwfwfest" ]; then | |
| mame wwfwfest | |
| fi | |
| if [ -e "$mount/pacman" ]; then | |
| mame pacman | |
| fi | |
| if [ -e "$mount/alexkidd" ]; then | |
| mednafen "mastersystem/Alex Kidd in Miracle World (USA, Europe, Brazil) (Rev 1).sms" | |
| fi | |
| if [ -e "$mount/shadowrun_sega" ]; then | |
| mednafen "megadrive/Shadowrun (USA).md" | |
| fi | |
| if [ -e "$mount/streetsrage2" ]; then | |
| mednafen "megadrive/Streets of Rage 2 (USA).md" | |
| fi | |
| if [ -e "$mount/monkey" ]; then | |
| cd SCUMM | |
| scummvm monkey | |
| fi | |
| done | |
| /usr/sbin/poweroff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment