The Raspberry PI 4 is great for emulating old games consoles and in this guide I will show you how to set up an emulator for playing SNES, NES and Sega Megadrive games using an emulator called mednafen.
There are Linux distributions for the Raspberry PI 4 dedicated to emulator and retro gaming such as Retropie and Lakka. This guide is for people who want to continue using their Raspberry PI 4 as a desktop computer as well as playing emulated games.
How To Install Mednafen
To install Mednafen open a terminal window by pressing CTRL, ALT and T at the same time.
Run the following command to update your repositories.
sudo apt-get update
Now run this command to install mednafen.
sudo apt-get install mednafen
How To Run Mednaffen
You can run Mednafen by clicking on the menu, navigate down to the “Games” sub menu and then select “mednaffe”.
Alternatively from within a terminal window (press CTRL, ALT and T if you don’t have one open) type the following command:
The ampersand at the end of the line runs the application as a background process so that you can continue to use the terminal or indeed close it if you don’t need it anymore.
The mednaffen screen has 4 tabs:
- Game list
- Global Settings
Setting The Games Folder
By default on the Raspberry PI the default games folder is /home/pi which as you can see from my screenshot isn’t the best place to start.
To add a folder click on the “Add Folder” button on the right side of the screen.
Now navigate to the folder where your games are going to be installed.
If you don’t yet have a designated games folder click on the folder with a plus icon in the top right corner and when prompted enter games or as the term for emulated games are called ROMS you can also call the folder ROMS.
Click “Open” to set the highlighted folder at the top of the screen as the default location for running games.
If you have simply created a new folder for storing games then you will see that the folder is empty.
Before you download any games it is worth knowing which systems are emulated by Mednaffen.
Click on the “Systems” tab.
The following systems are emulated:
- Atari Lynx
- Gameboy (Color)
- Gameboy (Advance)
- Neo Geo (Pocket)
- NES / Famicon
- PC Engine
- Sega Game Gear
- Sega Megadrive / Genesis
- Sega Master System
- Sega Saturn
- Sony Playstation
- SNES / Super Famicon
- Virtual Boy
- Wonderswan (Color)
It is recommended that if you wish to play Sony Playstation games that you follow this guide as PCSXR is a better option.
The legality of downloading ROMS is sketchy at best and in some countries illegal.
If you use Google however and search for instance “SNES ROMS” then a large number of sites appear and they have been there for a long time and haven’t been taken down, therefore you might assume that it is safe to use them.
For the purposes of this tutorial I am using emulatorgames.net.
You can search for the games you wish to download by entering the name in the search box in the top right corner or you can browse by scrolling down the page and navigate through several pages of results.
When you have found a game you would like to play click on the image.
Information will appear about the game you wish to download. To download the game click on the “Save Game” button.
A timer will start and then the file will begin to download. After the file has downloaded click on the little arrow and choose “Open”.
Click on the files within the zip file and click “Extract”.
Navigate to the folder where you want your games to be installed (for example /pi/ROMS). Uncheck the box that says “Re-create folders”.
If you click on the “Games List” tab you might be surprised to see that your file doesn’t appear. The Mednaffen screen doesn’t automatically refresh.
To get around this you can either close and re-open Mednaffen (not recommended) or you can click on the folder dropdown, choose another folder and then repeat and choose the games folder again.
Add a controller
The PI supports a wide range of controllers and I recommend using any generic controller with a USB cable. Simply attach the USB cable via one of the remaining USB ports.
You will need to configure the controller and this can be done once you have loaded a ROM.
To play a game simply click on the name of the game you wish to run and click “Launch”.
To map the controller actions press ALT, Shift and 1 at the same time.
You will be asked to press the key, button or direction for up on your gamepad. Simply press upwards on your controller.
You will then be asked for up (2). If you want to map another key to up press it now or simply press up on your controller again.
Repeat this action for down, left, right, select, start, Y, B, X, A, left shoulder and right shoulder,
Playing Games In Full Screen
To play a game in full screen go to the “global settings” tab and place a check in the box “Enable Fullscreen”.
This guide has shown you how to run Mednaffen, how to download and install games, how to configure the controllers and how to play in full screen.
There are a whole host of other options available within Mednaffen for you to explore. For the full documentation visit https://mednafen.github.io/documentation/.