Mednafen (Emulator) configuration (GBC/GBA/SNES/NES)


Mednafen is a large collection of emulators that you can use on chip. it took me a while to configure but i got it working smoothly thanks partly to a tip i found by @joshuajon in this thread

First things first

sudo apt-get install mednafen libsdl2-dev

Go ahead and open the app first, it doesnt make its config files until you run it at least once. So open terminal on the pocketchip and run mednafen

Now we are ready to open /home/chip/.mednafen/mednafen.cfg (yours may have a different name)

Using your favorite text editor, find the line video.driver opengl and change it so it says video.driver sdl


Find the following lines and make them look like this:

gba.xscalefs 2.000000 gba.yscalefs 2.000000 gba.stretch full gba.yres 272 gba.xres 480


GBC is configured in a different area, if you want to use it,do this
gb.stretch aspect gb.xres 480 gb.xscalefs 2.000000 gb.yres 272 gb.yscalefs 2.000000


For now snes does not work, and will crash. I think this is a problem with SDL but here are the bindings. they are the same as gba.:

snes.stretch full snes.xres 480 snes.xscalefs 2.000000 snes.yres 272 snes.yscalefs 2.000000


nes is also untested but it should be the same as the gbc

nes.stretch aspect nes.xres 480 nes.xscalefs 2.000000 nes.yres 272 nes.yscalefs 2.000000

If you come up with other configs post them here and ill add them to the main post with your name :smile:



That should be all you have to do! Now, when we want to call our emulators we have to do this:

mednafen -fs 1 /path/to/rom

Now that its running, to edit our button mappings we have to press Shift+Alt+1 and then tell mednafen how we want them. I noticed that the F10 and F12 keys that PICO uses are mapped to internal mednafen keys. My setup uses o and p for A and B. k and l for L and R. enter for START and the Shift below enter for SELECT

You can take this same config and apply it to other entries, for example im about to edit the gbc one (but it wont be fullscreen as the gameboy wasnt widescreen)

Play around with it and find what works for you. Sonic advance plays PERFECTLY but has a tiny screen tearing. I hope the opengl driver will be ready soon so we wont have to rely on sdl



cd /home/chip/roms
system=$(eval zenity --list --column System $folderpath --width=480 --height=272)

if [ "$?" -eq 1 ]; then
   echo "Cancelled."
   cd $system
   files=$(ls -Q)
   rom=$(eval zenity --list --column "Roms" $files --width=480 --height=272)

   if [ "$?" -eq 1 ]; then
      echo "Cancelled."
      mednafen -fs 1 "$rom"

Im also working on a menu icon and a way to launch it without terminal, but i have no gui…if someone more skilled than i can get mednaffe to scale correctly i think it could work beautifully

Here is a custom launcher icon i made by editing /usr/share/pocket-home/appIcons/alex4.png to look how i wanted

Here are my keys for anyone who doesnt want to bother configuring input:

;gba, Built-In, Gamepad: A gba.input.builtin.gamepad.a keyboard 111 ;gba, Built-In, Gamepad: B gba.input.builtin.gamepad.b keyboard 112 ;gba, Built-In, Gamepad: DOWN ↓ gba.input.builtin.gamepad.down keyboard 274 ;gba, Built-In, Gamepad: LEFT ← gba.input.builtin.gamepad.left keyboard 276 ;gba, Built-In, Gamepad: Rapid A gba.input.builtin.gamepad.rapid_a keyboard 111 ;gba, Built-In, Gamepad: Rapid B gba.input.builtin.gamepad.rapid_b keyboard 112 ;gba, Built-In, Gamepad: RIGHT → gba.input.builtin.gamepad.right keyboard 275 ;gba, Built-In, Gamepad: SELECT keyboard 303 ;gba, Built-In, Gamepad: SHOULDER L gba.input.builtin.gamepad.shoulder_l keyboard 107 ;gba, Built-In, Gamepad: SHOULDER R gba.input.builtin.gamepad.shoulder_r keyboard 108 ;gba, Built-In, Gamepad: START gba.input.builtin.gamepad.start keyboard 13 ;gba, Built-In, Gamepad: UP ↑ gba.input.builtin.gamepad.up keyboard 273

My icon edits and config.json edits will be kept here for anyone to view and change

Classic Console Emulators
Emulator with GUI like EmulationStation
Best emulator solution?
OpenGLES or OpenGL Support for any NES Emulator
RetroPIe for C.H.I.P?
PocketInstaller (v5.0)
PocketInstaller (v5.0)
Game (and emulators) compatibility list
Gaming on pocket chip
What apps work well with resolution of PocketCHIP?
Hacking the PocketCHIP case to add "GameBoy-like" buttons
10 things the new Pocket C.H.I.P. owner should know
Gamepad talk, solutions and alternatives
Emulators on PocketCHIP (my tests)
Emulators on PocketCHIP (my tests)
Hacking the PocketCHIP case to add "GameBoy-like" buttons
Mednafen Keyboard Binding Wizard
Gameboy on pocket chip?
Gaming on pocket chip
Pocket Chip Setup Script (Install Cool Communitty Programs in a Single Script!)
Gngeo NEOGEO emulation [W.I.P.]
I can't seem to get mednafen to work, even if my life depended on it

This looks good, but can you add the video.driver sdl ? this greatly improves video performance.


@joshuajon I see you didnt read the whole post:

“Using your favorite text editor, find the line video.driver opengl and change it so it says video.driver sdl”


Oh true, some of the settings you have standing out on their own line, and others are inline. I’ll admit I didn’t read carefully enough. Good work, hope it can make it to the wiki :slight_smile:


This is awesome!


I have been working on this since I got my Pocket Chip about a week ago. This looks great! Thanks!


Also, forgot to mention, I got the sound working by changing “sound.device default” to “sound.device sexyal-literal-default”

I’ve noticed the sound can be a bit choppy, I will look into that further.


I have no sound output on mine yet, so i havent run into this. I want to add a speaker though…


I ordered a amp board, and a speaker today. I cant wait to get it in. Just been using headphones for the time being.


SWEET! I ordered a mono amp board too! I cant wait for it either lol


So I installed mednafen, but there is no such file in that directory. I can’t even run mednafen because it’s looking in that spot for the file and not finding it. Any clue where it is? Or could you post yours?


what will happen to your other apps you replaced? Oxicl33n@


Sorry! You have to run mednafen at least once before it makes the config files in your home folder! ill add that to the guide


They went nowhere, the gui just gives you an easy access to them.


Thank you. I tried to run it but it failed with an error message I haven’t seen in years! “Abort, Retry, Ignore, Fail?”

It did generate the config file though, and I made the edits for the video driver and the snes bits, but it still crashes. It’s apparently looking for a few files and not finding them, including a custom palette in /.mednafen/palettes/snes.pal, cheat codes in /.mednafen/cheats/snes.cht

I also tried the gba settings, and got a little further–it launches to a white screen, but that’s it.


What rom are you trying to run? I get this with Pokemon emerald. It’s because some things refuse to emulate via sdl… Don’t worry about not finding the cht files, those are “cheat codes” - like gameshark codes

Try a few other roms, it’s probably sdl messing up.

I get the same error sometimes with some games, i think with those we may have to wait for opengl to be ready.


Bingo. That’s exactly what I was trying to run. I tried sapphire, and Sonic and those work. Thanks, @0xicl33n!


I am having issues with snes also


OMG, @0xicl33n. You are my hero. I can’t wait to try this when I get mine. It’s the main reason why I bought Pocket CHIP to begin with.

Thanks so much for sharing.

BTW: Is there a working Commodore 64 emulator that comes with it?


your quite welcome! but no sadly mednafen doesnt come with a c64 emulator. you can however try

which should be sudo apt-get install vice and then configure it how you want! i dont know much of anythihg about the c64 so if you wanna dig into the configs and find what works be my guest :slight_smile: