Retro Pie
More Raspberry Pi Projects
Project 9 — Retro Gaming with RetroPie
A Note on ROMs and Copyright
What You Will Need
Step 1 — Flash the RetroPie Image
RetroPie provides pre-built SD card images that boot directly into EmulationStation (the game launcher front-end). This is the fastest way to get started.
- Download the RetroPie image for your Pi from retropie.org.uk/download — choose the correct version for your Pi model (Pi 4/400, Pi 3/3B+, etc.)
- Flash the image to your microSD card using Raspberry Pi Imager — click Choose OS → Use custom and select the downloaded
.img.gzfile - Insert the card, connect a controller and keyboard, connect to your TV, and power on
- The first boot expands the filesystem — this takes 1–2 minutes; a second automatic reboot follows
Step 2 — Configure Your Controller
On first boot, EmulationStation immediately asks you to map your controller. Hold down a button on the controller you want to configure — EmulationStation detects it and walks you through each button.
- Hold any button on your controller when prompted — it detects the device
- Follow the on-screen prompts: D-Pad, face buttons (A/B/X/Y), shoulder buttons, Start, Select
- For buttons your controller doesn't have, hold any button for a moment to skip them
- When done, press the button you mapped to A to confirm
Bluetooth controller pairing
For wireless controllers, pair them first via the RetroPie configuration menu:
- From EmulationStation, press Start → RetroPie Configuration
- Select Bluetooth
- Choose Register and Connect to Bluetooth Device
- Put your controller in pairing mode (hold the pairing button — varies by controller), then select it from the list
- For PS4/PS5 DualShock: hold the PlayStation button + Share button together until the light bar pulses
- For Xbox Wireless: hold the pairing button on the back of the controller until it flashes rapidly
Step 3 — Transfer ROMs
ROMs are stored on the Pi in /home/pi/RetroPie/roms/, with each system in its own subfolder. There are three ways to transfer them:
Method 1 — USB drive (simplest)
- Format a USB drive as FAT32 or exFAT
- Create a folder called
retropieon the drive - Plug the drive into the running Pi — RetroPie detects it and creates the correct folder structure on the drive automatically (takes about 30 seconds)
- Unplug, copy your ROMs into the appropriate system subfolders on the drive
- Plug the drive back into the Pi — RetroPie copies the ROMs to the SD card automatically
Method 2 — Network file share (SAMBA)
# RetroPie's SAMBA share is enabled by default # On Windows: open File Explorer and type in the address bar: \\retropie # On Mac: Finder → Go → Connect to Server → smb://retropie # Drag ROMs into the appropriate system folder
Method 3 — SCP / SFTP
# From your PC terminal (replace with your Pi's IP): scp SuperMarioWorld.smc pi@192.168.1.42:~/RetroPie/roms/snes/
After transferring ROMs, restart EmulationStation to see them (Start → Quit → Restart EmulationStation).
Step 4 — Scrape Artwork with Skyscraper
A bare list of ROM filenames is functional but uninspiring. Scrapers fetch box art, screenshots, descriptions, ratings, and video previews from online databases, transforming your game list into a beautiful visual library.
With scraped artwork, each game shows its box art, rating, description, and release year. Video previews play as you browse. It makes the whole experience feel genuinely polished.
RetroPie includes Skyscraper as its recommended scraper. Run it from the RetroPie Setup menu:
- Press Start → RetroPie Configuration → RetroPie-Setup
- Navigate to Configuration / Tools → skyscraper
- Select Gather resources → choose your source (ScreenScraper is recommended — create a free account at screenscraper.fr for higher rate limits)
- Select which systems to scrape
- After gathering, select Generate game list & artwork
- Restart EmulationStation to see the results
Command-line scraping (faster for large collections)
# Scrape all SNES ROMs from ScreenScraper, then generate artwork pi@raspberrypi:~$ Skyscraper -p snes -s screenscraper -u "username:password" pi@raspberrypi:~$ Skyscraper -p snes # The second command (without -s) generates the gamelist from cached resources
Step 5 — Emulator Performance by System
Different systems require different levels of Pi hardware. Here's what to expect:
Step 6 — Save States and Rewind
Save states let you save and load your exact game position at any moment — no more hunting for in-game save points. Rewind lets you roll back a few seconds of gameplay, effectively giving you infinite retries on tricky sections.
Save state controls (default)
| Action | Default hotkey |
|---|---|
| Save state (slot 0) | Select + R1 |
| Load state (slot 0) | Select + L1 |
| Change save slot | Select + Left / Right |
| Rewind (hold) | Select + L2 |
| Pause | Select + A |
| Exit game | Select + Start |
| RetroArch menu | Select + X |
Enable rewind
Rewind is disabled by default because it uses extra memory and CPU. Enable it per-system if needed:
- During a game, press Select + X to open the RetroArch menu
- Go to Settings → Frame Throttle → Rewind → set to ON
- Quick Menu → Overrides → Save Core Override to save for all games on this system
Step 7 — CRT Shaders
Modern flat displays show retro games as sharp pixel art — technically accurate but not how they looked on the CRT televisions they were designed for. RetroArch shaders simulate the soft scanlines, phosphor glow, and colour blending of CRT screens with impressive accuracy.
- During a game, press Select + X to open the RetroArch menu
- Go to Shaders → Load Shader Preset
- Navigate to
shaders_glsl/crt/(orshaders_slang/crt/on Pi 4) - Try crt-pi.glslp first — it's designed specifically for the Pi and runs at full speed
- For a more authentic look: crt-aperture.glslp simulates an aperture grille monitor (like a Sony Trinitron)
- Press Apply Changes, then save as a core or game override to make it permanent
Step 8 — RetroAchievements
RetroAchievements is a free service that adds modern achievement systems to classic games — just like Xbox Achievements or PlayStation Trophies, but for your retro collection. Over 400,000 achievements exist across thousands of games.
- Create a free account at retroachievements.org
- In EmulationStation, go to RetroPie Configuration → RetroArch
- Navigate to Settings → Achievements
- Enable Achievements, enter your Username and Password
- Enable Hardcore Mode (optional) — disables save states and rewind for a purist experience with double the achievement points
- Save and exit — achievements now unlock in-game with a pop-up notification
Step 9 — Home Assistant Integration
If you set up Home Assistant in Course 1 Project 5, you can create an automation that reacts when gaming starts or stops — dimming the lights, switching on the TV, or sending a notification. RetroPie can call a webhook when a game launches or exits.
Create a RetroPie runcommand script
RetroPie runs scripts at specific points in the game lifecycle. Create a script that fires when a game starts:
pi@raspberrypi:~$ nano /opt/retropie/configs/all/runcommand-onstart.sh
#!/bin/bash # Called when a game starts # $1 = system name (e.g. "snes"), $2 = emulator, $3 = ROM path, $4 = command SYSTEM="$1" ROM="$(basename "$3" | sed 's/\.[^.]*$//')" # ROM filename without extension # Fire a webhook to Home Assistant curl -s -X POST \ "http://homeassistant.local:8123/api/webhook/retropie_start" \ -H "Content-Type: application/json" \ -d "{\"system\": \"$SYSTEM\", \"game\": \"$ROM\"}"
pi@raspberrypi:~$ chmod +x /opt/retropie/configs/all/runcommand-onstart.sh
Create a matching script for when a game ends:
pi@raspberrypi:~$ nano /opt/retropie/configs/all/runcommand-onend.sh
#!/bin/bash curl -s -X POST \ "http://homeassistant.local:8123/api/webhook/retropie_end" \ -H "Content-Type: application/json" \ -d "{\"event\": \"game_ended\"}"
pi@raspberrypi:~$ chmod +x /opt/retropie/configs/all/runcommand-onend.sh
Home Assistant automation
In Home Assistant, create two automations triggered by the webhooks:
automation: alias: "RetroPie — Game Started" trigger: platform: webhook webhook_id: "retropie_start" action: # Switch on the TV via HDMI-CEC or smart plug - service: media_player.turn_on target: entity_id: media_player.living_room_tv # Dim the lights to 30% for gaming ambience - service: light.turn_on target: entity_id: light.living_room data: brightness_pct: 30 color_temp: 370 # warm white # Optional: send a notification - service: notify.mobile_app data: message: "🎮 Gaming started: {{ trigger.json.game }}"
automation: alias: "RetroPie — Game Ended" trigger: platform: webhook webhook_id: "retropie_end" action: - service: light.turn_on target: entity_id: light.living_room data: brightness_pct: 100
Step 10 — Useful RetroPie Tweaks
Enable SSH
# SSH is disabled by default on RetroPie images # Enable it via the RetroPie Configuration menu: # RetroPie Configuration → RetroPie-Setup → Configuration / Tools → sshd → Enable # Or enable at first boot by placing an empty file called 'ssh' in /boot/
Overclock the Pi 4 (optional)
pi@raspberrypi:~$ sudo nano /boot/config.txt
# Pi 4 overclock — improves N64 and Dreamcast emulation # Requires a good heatsink or case with active cooling over_voltage=6 arm_freq=2000 gpu_freq=750
Run RetroPie on top of Raspberry Pi OS
pi@raspberrypi:~$ sudo apt update pi@raspberrypi:~$ git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git pi@raspberrypi:~$ cd RetroPie-Setup pi@raspberrypi:~/RetroPie-Setup$ sudo bash retropie_setup.sh # Choose: Basic install → installs EmulationStation and all core emulators
Set up automatic backups of save files
# Save files are in /home/pi/RetroPie/saves/ # Add a cron job to back them up nightly to an external drive or network share pi@raspberrypi:~$ crontab -e
# Backup saves every night at 2am 0 2 * * * rsync -av /home/pi/RetroPie/saves/ /media/usbdrive/retropie-backup/saves/
Troubleshooting
.smc, .sfc, or .zip; check the supported extensions in the system's emulator docs); (2) the ROM is in the wrong folder — a Game Boy Color ROM placed in the gb (Game Boy) folder rather than gbc won't show up in the GBC system. Restart EmulationStation after fixing the location.vcgencmd measure_temp. If it's above 80°C, the Pi is throttling — improve cooling. For N64 and Dreamcast, try enabling the GLideN64 or parallel-n64 video plugin via the RetroArch menu (more GPU-accelerated). For all systems, ensure no other heavy processes are running — check with htop. If the game runs at 55–58 FPS instead of 60, try enabling Run-ahead with 1 frame in RetroArch settings to improve input feel even if raw speed is slightly below target.Skyscraper -p snes (no -s flag). The gamelist.xml should appear in /home/pi/.emulationstation/gamelists/snes/. If it's there but ES still shows no art, the image paths in the gamelist may be absolute — restart EmulationStation after generating./boot/config.txt and add or uncomment hdmi_drive=2. Also check RetroArch's audio settings: Settings → Audio → Output Device — set to hdmi. If using a Pi 4, the audio is managed by the vc4-kms-v3d driver and both audio outputs appear as separate ALSA devices — run aplay -l to list them and identify the HDMI device number.curl -s -X POST http://homeassistant.local:8123/api/webhook/retropie_start -H "Content-Type: application/json" -d '{"system":"test","game":"test"}'. If you get a connection refused, Home Assistant isn't reachable at that hostname — try the IP address instead. If it returns a 404, the webhook ID doesn't match what's in your automation. In Home Assistant, go to Settings → Automations and check the webhook ID is exactly retropie_start (case-sensitive, no spaces).Quick Reference
| Task | Action / Location |
|---|---|
| Configure controller | EmulationStation → Start → Configure Input |
| Access RetroPie config | EmulationStation → Start → RetroPie Configuration |
| Open RetroArch menu in-game | Select + X |
| Save state | Select + R1 |
| Load state | Select + L1 |
| Exit game | Select + Start |
| ROM directory | /home/pi/RetroPie/roms/ |
| Save file directory | /home/pi/RetroPie/saves/ |
| BIOS files directory | /home/pi/RetroPie/BIOS/ |
| Skyscraper config | /home/pi/.skyscraper/ |
| Scrape a system | Skyscraper -p snes -s screenscraper -u "user:pass" |
| Generate artwork | Skyscraper -p snes |
| Runcommand on-start script | /opt/retropie/configs/all/runcommand-onstart.sh |
| Runcommand on-end script | /opt/retropie/configs/all/runcommand-onend.sh |
| Check CPU temperature | vcgencmd measure_temp |
| Network file share | \\retropie (Windows) / smb://retropie (Mac) |
| RetroPie documentation | retropie.org.uk/docs |
| RetroAchievements | retroachievements.org |
| ScreenScraper (artwork) | screenscraper.fr |