Mesen on Ubuntu: Emulating and Upgrading Classic NES Games

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
372
Reaction score
433
Credits
13,798
Mesen is a Nintendo emulator (NES Em backwards). The program emulates NES, SNES Game Boy (Color) and PC Engine ROMS. This is for Ubuntu 20.04 and above.

Not only is this an emulator, but it also allows for the sprites to be updated to allow for a higher resolution of the original NES 8-bit games.

We will get to that later in the article, with pictures.

Installation

Of course, Mesen runs on Windows, but I'm only covering the Linux installation and setup.

To begin, update and upgrade your packages.

Next, you need to install two dependency packages. One is from a Linux Repository called SDL2. Use the command:

Code:
sudo apt install libsdl2-dev -y

Once you complete installing the SDL2 packages, you need the Linux version of the '.NET 6.0 Runtime', which is installed with:

Code:
sudo apt install dotnet-runtime-6.0 -y

After you install the dependencies, you get the Mesen package from 'mesen.ca'. You can download The Linux Dev Build at:

https://nightly.link/SourMesen/Mesen2/workflows/build/master/Mesen (Linux - ubuntu-20.04 - clang).zip

You may notice that this is a ZIP file, and it needs to be extracted. Once you have extracted the 'Mesen' file, you can move it where you want it and you need to make sure it is executable. You can right-click the file in a file manager and select the 'Permissions' tab. Check mark the option to 'Allow executing file as program', then close the Properties window.

If you want to mark the file as executable in the Command-Line Interface (CLI). You need to open a terminal in the folder where the 'Mesen' file exists. Use the command:

Code:
chmod +x Mesen

You should be able to start the program from the CLI.

An example location may be '~/Mesen' for placing the 'Mesen' file.

Configuration

After starting Mesen, you can configure the program to your needs. Click on 'Settings' and select 'Preferences'.

In the left pane, click on 'NES'. In the right pane, be sure to check the option 'Enable HD Packs'. I'll cover this later, but this is necessary to use HD Packs. Be aware that you only use the HD Packs for NES ROMS.

The default data storage for Mesen is '~/.config/Mesen2'. Mesen stores the settings in a file named 'settings.json'. All the saved games, screenshots, etc. are in this folder.

Go through the controller settings to make sure you configure the controller as you need.

Keyboards have a fairly basic default setup:

Select q
Start w
A button s
B button a
A turbo x
B turbo z
Movement arrow keys
Pause Esc


If you have ever used an NES system, there was a controller called the NES Advantage. On this controller, you could enable turbo for Buttons A and/or B. There was a dial to set the repeat speed for a held down button. This is what the 'A turbo' and 'B turbo' buttons do in the game. Instead of repeatedly pressing 'A' or 'B', use 'X' or 'Z'.

Starting ROMS

After you have an NES ROM on your system, you select 'File' and then 'Open' to have a folder window to find the ROM. Once you have selected it, click on 'Select' to open the ROM.

The ROM file is usually a ZIP file or extracted as an NES extension.

You can place the ROM files into the same folder as the 'Mesen' file, or wherever you may prefer.

Saving and Loading States

When you are in a game, you can save your game by selecting 'File' and then select 'Save State'. A drop-down menu will appear, letting you choose one of ten save slots. This saves all your current progress in the game.

If you want to go back to a specific point where you saved the state, you go to 'File' and then down to 'Load State'. At the drop-down list, select the slot that you want to load.

At the bottom of the drop-down menu is an option called either 'Save State Menu' or 'Load State Menu', depending on which option you chose under 'File'. In this selection, there is a visual list of the save or load slot. Black slots are empty and contain no saved game information.

Keep in mind that every game has its own set of ten save slots.

HD Packs

If you remember the old NES games, you'll remember that they didn't look as good as today's games. The 'sprites', or graphics used, were based on 8-bit graphics. So, to improve on this, you can take the 8-bit graphics and improve them. Let's look at some examples. In Figure 1, you can see the original 'Super Mario Bros.'.

Figure 1.jpg

FIGURE 1

But, after updating the 'sprites', one artist made the game look better, as shown in Figure 2.

Figure 2.JPG

FIGURE 2

When you install an HD Pack, Mesen saves the HD Pack to '~/.config/Mesen2/HdPacks/', then by the game name. If you want to remove an HD Pack, just remove the game folder in 'HDPacks'.

So, to install an HD Pack, you need to find one on the Internet. Just do a search and hope someone has created one. If you find one, then download it. It should be a 'ZIP' file.

After you save it, load your game and then click on 'Tools', then 'HD Packs (NES)' and finally select 'Install HD Pack'. A window should appear to let you select a file, which will be your HD Pack. Once selected, Mesen will inform you that the pack successfully loaded or failed. If it’s loaded, it will ask if you want to reset the game for the HD Packs to be in effect.

If you get an error, the problem may be the ROM version of the game. Try a different ROM. Sometimes, when you find an HD Pack, there may be information about a specific ROM.

HD Packs contain the sprites in a PNG file. The background of the sprites is transparent. You can see an example in Figure 3, but since the file is a JPG and not a PNG, the background is black.

Figure 3.jpg

FIGURE 3

Conclusion


For better memories of the good old days of gaming, you can update the game with a ROM Pack, if one exists. If not, make one yourself, but that is beyond the scope of this article. There is information available to walk you through creating new sprites.

For fun's sake, give Mesen a try to play some of the old games you loved on your Linux system.
 
Last edited:

Members online


Latest posts

Top