Skip to content

Instantly share code, notes, and snippets.

@frame
Last active May 20, 2021 14:20
Show Gist options
  • Save frame/55141081793b7bfaf0c2f36fdb0b06a0 to your computer and use it in GitHub Desktop.
Save frame/55141081793b7bfaf0c2f36fdb0b06a0 to your computer and use it in GitHub Desktop.

Retropie Setup

Preparations on Windows/MacOS

hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=16

(Power up external HDMI screen and set resultion to 1024x768@60Hz)

Picade first boot

  • Connect USB keyboard
  • F4 to exit Emulationstation
  • $ sudo raspi-config
2 Network Option
	N1 Hostname
		picade
	N2 Wi-fi
		AT Austria
			OK, Enter SSID, Enter Password
5 Interface Options
	P2	SSH
			Ok
Leave
  • $ sudo reboot

Via SSH

  • $ passwd
  • nano ~/.bash_aliases
alias ll='ls -al'
alias vol0='amixer set 'PCM' 0%'
alias vol1='amixer set 'PCM' 70%'
alias volup='amixer set 'PCM' 10%+'
alias voldown='amixer set 'PCM' 10%-'
  • $ sudo RetroPie-Setup/retropie_setup.sh
U Update
	Ok
C Configuration / tools
	802 autostart
		1 Start Emulation Station at boot
	805 configedit
		2 Advanced configuration
			1 Configure Libretro options
				0 all/retroarch.cfg
					14 video_scale_integer (true)
				14 mame-libretro/retroarch.cfg
R Reboot
  • $ curl -sS https://get.pimoroni.com/picadehat | bash
  • $ mkdir ~/picade-hat && cd "$_"
  • $ git clone https://github.com/pimoroni/picade-hat .
  • $ sudo ./install.sh
Picade HAT: Installer
Notice: building picade.dtbo
Notice: copying /boot/config.txt to /boot/config.txt.picade-preinstall
Installed: /boot/overlays/picade.dtbo
Installed /etc/udev/rules.d/10-picade.rules
Installed /etc/asound.conf
Config: Added "dtoverlay=picade" to /boot/config.txt
Config: Added "dtparam=audio=off" to /boot/config.txt
Config: Skipped "hdmi_force_hotplug=1", already exists in /boot/config.txt
  • $ sudo reboot
  • $ sudo apt-get install qt5-default
  • $ mkdir ~/skysource && cd "$_"
  • $ wget -q -O - https://raw.githubusercontent.com/muldjord/skyscraper/master/update_skyscraper.sh | bash
  • # killall emulationstation
  • # Skyscraper
  • $ nano ~/.skyscraper/skyscript.sh && chmod +x "$_"
#!/bin/bash
Skyscraper -p mame-libretro -s arcadedb --pretend
Skyscraper -p mame-libretro -s screenscraper --pretend
Skyscraper -p mame-libretro -s localdb
  • $ nano ~/.skyscraper/config.ini
[main]
gamelistFolder="/home/pi/.emulationstation/gamelists"
mediaFolder="/home/pi/.emulationstation/media"
videos="true"
brackets="false"
unattend="true"
interactive="true"

[mame-libretro]
artworkXml="artwork_mame-libretro.xml"
  • $ nano ~/.skyscraper/artwork_mame-libretro.xml
<?xml version="1.0" encoding="UTF-8"?>
<artwork>
  <output type="screenshot" width="640" height="480">
    <layer resource="screenshot" x="20" width="520" height="390" align="center" valign="middle">
    </layer>
    <layer resource="wheel" width="250" x="-10" align="right">
      <shadow distance="5" softness="5" opacity="70"/>
    </layer>
  </output>
</artwork>

Start random mame game every 19 minutes:

  • $ nano /opt/retropieconfigs/all/retroarch-core-options.cfg
mame2003-skip_disclaimer = "enabled"
mame2003-skip_warnings = "enabled"
  • $ mkdir ~/random-mame && cd "$_"
  • $ nano random-mame.sh
#!/bin/bash
killall -q emulationstation retroarch

ROM=`xmlstarlet sel -B -T -t -c "/gameList/game[$RANDOM mod last() + 1]/path" ~/.emulationstation/gamelists/mame-libretro/gamelist.xml`
echo launching $ROM

/opt/retropie/emulators/retroarch/bin/retroarch \
-L /opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so \
--config /opt/retropie/configs/mame-libretro/retroarch.cfg \
"$ROM" \
--appendconfig /dev/shm/retroarch.cfg \
&
  • crontab -l | { cat; echo "*/19 * * * * /home/pi/random-mame/random-mame.sh"; } | crontab -

Emulationstation:

D-PAD UP/DOWN/LEFT/RIGHT -> Stick
START -> Right button
SELECT -> Left button
A -> Yellow upper row
B -> Red upper row
X -> Yellow lower row
Y -> Red lower row
LEFT SHOULDER -> Blue upper row
RIGHT SHOULDER -> Blue lower row
HOTKEY ENABLE -> Front left

Keep things up to date

Note: Don't run apt upgrade or apt dist-upgrade because it will overwrite optimized packages and kernels. Only use retropie_setup.sh to update the system.

System

  • $ sudo RetroPie-Setup/retropie_setup.sh
U Update

Skyscraper

  • $ cd ~/skysource
  • $ ./update_skyscraper.sh

picade-hat

  • $ cd ~/picade-hat
  • $ git pull
  • # sudo ./install.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment