While the Mednafen emulator isn’t included in the Linux repositories to prevent aiding in piracy, it serves as an excellent means for playing public-domain and open-source ROM files on any Linux machine. If you wish to find out more about this program and how you can configure your own controls, a few simple tricks could help you. This is of particular significance if you have a wireless controller or any USB device connected to your system. Certain PS3 controllers, especially ones with standard USB wires, can work using these same techniques, provided that your operating system recognizes them as generic controllers.
Configurations for various emulated consoles may behave differently, and these may even vary between games. Furthermore, some systems may require an emulated mouse cursor. To use this with the handful of games that need it, you will require not only a mouse or touchpad but also a Scroll Lock key. Unfortunately, some new ultrabooks and other compact Linux machines no longer include this key. If you are using mednafen prompts on a portable device that uses the Fn key to combine functions, make sure to press and hold this key whenever pressing the required key. For example, if you need to press F2 but it doubles up with another function on your keyboard, simply press Fn and F2 simultaneously to restore its primary function.
Method 1: Getting Help During Games
Press the F1 key to bring up a help chart. This key binding was selected to ensure compatibility with many other pieces of software with a similar binding. Keep in mind that you cannot access this help screen without a game already running. Running Mednafen without a ROM file loaded will simply return you to the command line. When you press F1, a window will pop up over the emulated game running inside your Mednafen graphical window. If you ever encounter a graphics problem where a save state pop-up or other information screen lingers behind the emulated video game images, cycling this help screen might help get rid of these ghost images.
The pop-over merely provides a list and isn’t interactive, so you can press F1 whenever you wish to close it. It doesn’t pause the game either, allowing you to leave it open while the game’s opcode continues to execute. Pay special attention to the F10 binding, as some emulated systems lack a soft reset feature. In other cases, a soft reset might be necessary to continue playing certain types of games.
Note that the F9 binding to take a screenshot isn’t related to the Print Screen or SysRq/ALT+Print Screen combinations used by desktop environments emulating Microsoft Windows bindings. It instead takes a screenshot and saves it straight to disk in the ~/.mednafen/snaps/ directory. This way you can actually use it even if you’re running just a window manager, like Openbox without a desktop environment.
Method 2: Setting Controls While Running Games
Command keys and actual game controls are configured separately in mednafen. Press F2 if you wish to configure a command key. This is particularly useful if you want to change the F11 binding, especially if you are accustomed to using it for maximizing windows, or if you want to assign emulator commands to unused buttons on USB or wireless game controllers. If you plan to do this, ensure that your controller is attached before launching the ROM.
Once you’re ready, press F2 to receive a prompt about which command you want to reconfigure. Press the key that currently performs the function you’re trying to change. For instance, if you want to set a fast-forward key to your controller so you can speed up the game directly from a shoulder button, then press the ` key when the prompt appears asking which command needs to be reconfigured.
A simple prompt at the bottom will read ‘fast_forward (1)’ with no other instructions. The command would, of course, be different if you were configuring a different command. You have to press the key or controller button you want the command to be assigned to in response to this prompt. Once it recognizes the button you wish to use, it will read ‘fast_forward (2)’, which is a request for you to press it a second time. The process might continue more than once if there was a problem with the wireless connection when using a wireless controller, or if you pressed two separate buttons during the mapping process. Configuring controller buttons follows an almost identical procedure, simply with different command key bindings. Ports 1-8 are assigned to the number keys on the system’s keyboard. If you’ve made no custom assignments yet, then all of these bindings are spelled out in the chart that appears whenever the F1 key is pressed.
For some systems like GameBoy and its derivates, only the first controller port really matters. Even though these handheld systems actually lacked detachable controllers, mednafen emulates them by mapping them to the first assignment. For most games made for hardware of the 8-bit and 16-bit era, you will only need one or two controllers. This is especially true of public domain NES and Famicom ROM files. Some games used an extender to provide support for more than two controllers.
If you’re playing a single-player game, ensure your wireless or USB controller is connected. Then, simultaneously press ALT, Shift and 1. You can also map controls to buttons on a standard keyboard. You’ll receive a prompt at the bottom of the screen, typically asking you to map the ‘up’ control. Press the button you wish to assign to ‘up’ twice. If simultaneous presses were detected or in case of confusion, the software will prompt you to try again, similar to the ‘fast_forward’ example. After satisfying the ‘up’ control prompt, the software will cycle through the other cardinal directions before requesting the action buttons associated with the console.