Retro Pie

More Raspberry Pi Projects

Project 9 — Retro Gaming with RetroPie

What you will build A polished retro gaming console with a beautiful game library, controller support, save states, achievements, and optional Home Assistant integration
Difficulty Beginner-friendly for the basics; goes deep if you want to fine-tune shaders, scrapers, and automations
Time to complete 1 – 2 hours to a working console; a pleasant afternoon to fully polish it
What you will need Raspberry Pi 3B+ or 4, microSD card (32 GB+), USB or Bluetooth controller, HDMI display

A Note on ROMs and Copyright

RetroPie is legal. ROMs are complicated. RetroPie itself is open-source software with no legal issues. ROMs (game files) are a different matter — they are copies of copyrighted software. Downloading ROMs for games you do not own is generally illegal in most countries. The legally safe options are: (1) dump your own cartridges using a cartridge reader; (2) download ROMs for games that have been officially released as freeware by their rights holders; (3) use open-source homebrew games, of which there are hundreds. This chapter covers the technical setup — what you do with it is your responsibility.

What You Will Need

🍓 Raspberry Pi 3B+ or 4 The Pi 4 is recommended — it handles N64, Dreamcast, and PSP emulation well. The Pi 3B+ is excellent for everything up to and including SNES and PS1. Pi 5 also works but RetroPie support is still maturing.
💾 microSD card (32 GB+) A fast card improves load times. SanDisk Endurance or Samsung Pro Endurance are good choices for a device that reads constantly. 64 GB or 128 GB gives comfortable room for game libraries.
🎮 Controller USB controllers are simplest — any USB gamepad works. Bluetooth controllers (PlayStation DualShock 4, Xbox Wireless, 8BitDo) give a cleaner setup. Genuine SNES/NES USB pads are a satisfying period-authentic choice.
📺 HDMI display or TV RetroPie works with any HDMI TV or monitor. For an authentic CRT look, the shader options later in this chapter recreate scanlines and phosphor glow convincingly on modern displays.
⌨️ USB keyboard (setup only) Needed for the initial setup and for accessing the RetroPie configuration menu. You can remove it once everything is configured.
🌐 Network connection Wi-Fi or Ethernet for downloading updates, scraping artwork, and setting up RetroAchievements. Ethernet is more reliable for large scraping operations.

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.gz file
  • 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
Alternatively, install RetroPie on top of an existing Raspberry Pi OS installation using the setup script — useful if you want to run RetroPie alongside other services on the same Pi. The standalone image is simpler and more reliable for a dedicated gaming device.

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 retropie on 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 (StartQuitRestart 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.

EmulationStation — Super Nintendo
Super Mario World
The Legend of Zelda: A Link to the Past
Super Metroid
Donkey Kong Country
Chrono Trigger

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 StartRetroPie ConfigurationRetroPie-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:

NES / Famicomlr-fceumm✓ Flawless on any Pi
SNESlr-snes9x✓ Perfect on Pi 3+
Game Boy / GBClr-gambatte✓ Flawless on any Pi
Game Boy Advancelr-mgba✓ Perfect on Pi 3+
Mega Drive / Genesislr-genesis-plus-gx✓ Perfect on any Pi
PlayStation 1lr-pcsx-rearmed✓ Full speed on Pi 3+
Arcade (MAME)lr-mame2003-plus✓ Most games on Pi 4
Nintendo 64lr-mupen64plus-nx⚠ Variable — Pi 4 recommended
Dreamcastlr-flycast⚠ Many games — Pi 4 only
PSPlr-ppsspp⚠ Lighter games — Pi 4
PlayStation 2PCSX2✗ Not viable on Pi
GameCube / WiiDolphin✗ Not viable on Pi

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)

ActionDefault hotkey
Save state (slot 0)Select + R1
Load state (slot 0)Select + L1
Change save slotSelect + Left / Right
Rewind (hold)Select + L2
PauseSelect + A
Exit gameSelect + Start
RetroArch menuSelect + 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
Rewind requires buffering many frames in memory. For demanding systems (N64, Dreamcast) it can cause performance drops. Keep it disabled for those and use regular save states instead.

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 ShadersLoad Shader Preset
  • Navigate to shaders_glsl/crt/ (or shaders_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
The crt-pi shader is optimised for performance and looks excellent. Heavier shaders like zfast-crt or mame-phosphor look even better but may drop frames on older systems running demanding games. Test with a fast-moving game to check for slowdown.

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 ConfigurationRetroArch
  • 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
🏆
It's Dangerous to Go Alone The Legend of Zelda — Nintendo Entertainment System +10 points · Obtained the sword from the old man in the first cave

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:

configuration.yaml (or automation editor) — game starts
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 — game ends (restore lights)
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

⚠ Controller not detected or buttons mapped incorrectly
Re-run the controller configuration: in EmulationStation press StartConfigure Input — hold a button on the controller you want to reconfigure. If a controller isn't detected at all, check it's plugged in before EmulationStation loads (hotplug support varies). For Bluetooth controllers, they must be paired each time the Pi boots unless you configure them to reconnect automatically — check the RetroPie Bluetooth docs for your specific controller model.
⚠ Games appear in file manager but not in EmulationStation
Two common causes: (1) the ROM file extension is wrong — each system expects specific extensions (e.g. SNES ROMs should be .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.
⚠ Emulator runs but game performance is poor — slowdown or audio stuttering
First check the Pi's CPU temperature: 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 scrapes but artwork doesn't appear in EmulationStation
Skyscraper has two steps: gather (download resources to cache) and generate (create the gamelist.xml and composite artwork). If you only ran gather, run the generate step: 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.
⚠ No sound through HDMI
RetroPie sometimes defaults to the analogue audio jack. Force HDMI audio: edit /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.
⚠ Home Assistant webhook not triggering
Test the webhook manually from the Pi: 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

TaskAction / Location
Configure controllerEmulationStation → Start → Configure Input
Access RetroPie configEmulationStation → Start → RetroPie Configuration
Open RetroArch menu in-gameSelect + X
Save stateSelect + R1
Load stateSelect + L1
Exit gameSelect + 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 systemSkyscraper -p snes -s screenscraper -u "user:pass"
Generate artworkSkyscraper -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 temperaturevcgencmd measure_temp
Network file share\\retropie (Windows) / smb://retropie (Mac)
RetroPie documentationretropie.org.uk/docs
RetroAchievementsretroachievements.org
ScreenScraper (artwork)screenscraper.fr
🎉 More Raspberry Pi Projects — Complete! You've finished all nine chapters of the second course.

You've built a personal cloud, a mail server with full authentication, a monitoring dashboard, containerised apps, a Tor relay, an aircraft radar, an AI camera, and a retro gaming console — all from a tiny ARM computer running from a microSD card. Each project is a real, production-quality system you've assembled yourself, from first principles. That's genuinely impressive.

Nextcloud ✓ Email Server ✓ Grafana ✓ Docker ✓ Tor Relay ✓ ADS-B ✓ Pi AI Kit ✓ RetroPie ✓