[HowTo] Mupen64Plus on Vero 4K: building and installing the N64 emulator

Retropie on the RPi3 is brilliant.
RetrOSMC on the RPi3 is brilliant ++ @mcobit
The Vero 4K is faster than the RPi3, but has no emulation support. Oh, wait a minute…

The purpose of this guide is to get Mupen64Plus onto your Vero 4K.
I know Kodi 18 (Leia) promises RetroPlayer, but that as far as I can see is:

  • A long way off;
  • Limited to Retroarch cores - which is what I use mostly, but some emulators such as Mupen64Plus perform better as a standalone;
  • Running from within Kodi, perhaps diminishing some of the performance gains from the RPi3 to Vero4K upgrade.

This guide assumes:

  • NO RESPONSIBILITY FOR DATA LOSS!! Backup backup backup;
  • You have git installed - sudo apt-get install git
  • You can use SSH and have some familiarity working in a linux console;
  • You are familiar with Mupen64Plus and the miriad of settings/plugins to get various ROMs to work;
  • You have migrated from an RPi running RetrOSMC or Retropie and therefore have already got config files for your controllers.

This guide DOES NOT currently provide a:

  • Launcher from OSMC;
  • Graphical front-end to select ROMS.

Installation Instructions
Run the following:

cd
git clone https://github.com/hissingshark/mupen64plus-vero4k.git
cd mupen64plus-vero4k
./m64p_builder.sh

Kodi will stop whilst the build goes on and return when it’s finished (<15mins).

Usage instructions

Before you play:

cd
sudo systemctl stop mediacenter
mv .asoundrc.hidden .asoundrc

Launch the emulator:

cd
cd mupen64plus/emulator/
./mupen64plus --gfx <name-of-video-plugin> <path-to-rom>

Note - wishing to avoid the obvious error but that means you’ll need to insert you own choice of video plugin and the path to your own choice of game ROM, wherever you may be keeping it. e.g:

./mupen64plus --gfx mupen64plus-video-rice ~/myroms/SpaceInvaders.n64

After you play:
Stop the emulator with ctrl-c in the terminal, or from the hotkey you’ve assigned to your gamepad. Then-

cd
mv .asoundrc .asoundrc.hidden
sudo systemctl start mediacenter

That’s about it!
I’m trusting you to add your controller config to

~/mupen64plus/emulator/InputAutoCfg.ini

The main emulator config for your tweaking is

~/.config/mupen64plus/mupen64plus.cfg

The mupen64plus-video-n64 video plugin has a separate config at

~/mupen64plus/emulator/gles2n64.conf

For example I found MarioKart64, essentially the only reason I did this, to run best and fullscreen stretched as I like it using the mupen64plus-video-n64 plugin above. That was with the following items changed to

window width=1920
window height=1080
video stretch=1

That aside, configuration is largely beyond the scope of this HowTo.
Google and YouTube are your friends.

I wish you joy!

4 Likes

Great stuff, I’ll give it a try later. Have you managed to get emulationstation to work in combination with retroarch? Your repository and some manual scripting has helped me out to get it running directly from Kodi. I did not succeed yet in executing retroarch in combination with a core (e.g. fceux). Will look into that tomorrow.

As I recall I did, yes.

You need to edit es_systems.cfg as per their docs for each core you want to run under retroarch as a “system”.

I only did a rough and ready job on it at the time as, like the other repos it was largely a proof of concept. With a sufficient number successfully compiling on the Vero4k I could then justify porting retropie-setup, which will automagically do that kind of configuring for me.

Yes I did use the retroarch -L <core> %ROM% command but unfortunately it wont start, logs don’t reveal much, but I suspect some problems with using the proper gpu libraries. In case you have it running, perhaps you could send me a tar/zip. I’d be happy to test some of your stuff.

Oh hang on, I haven’t included my retroarch work in my repo yet. So to clarify you’ve been building that yourself and you’re just using my sdl2 and emulationstation repos with it?

Your launch command sounds about right, but I haven’t got a running system to check it against.

What makes you think it’s a GPU/lib problem? You say it (I assume retroarch) launched directly from Kodi but not from ES? Did Mupen64Plus fly ok?

You can use ldd <executable> to see what dependencies it’s looking for.

Thanks for that. At this point i am just using your emulationstation repos (I’m mostly interested in genesis/nes/snes emulation for now). Retroarch has been fetched through apt-get. Currently running cores goes wrong having the following error (just tested this on fceumm):

Failed to initialize SDL gfx context driver: No available video device

Do you have to compile this retrocore linked to your SDL2 lib or do i need to compile retroarch myself linked to SDL2 lib (I dont know much about its architecture)? Thanks for your help.

I’ll try mupen64 soon and will let you know

Anything fancy via apt-get like an emulator is unlikely to work unfortunately as that repo isn’t taking account of our GPU- hence a large portion of my “hobby time” going on building these things.

Retroarch, Emulationstation etc need building against the local video drivers especially, just as Mupen64Plus does with my script. And yes, all depend on our own SDL2. Once that ground work is done the individual cores you wanted are easy to build.

@jjdijkstra1
Continuing from the other thread as it’s not mine and I don’t wish to hijack.

After running I have the following for my controller:
/opt/retropie/configs/n64/InputAutoCfg.ini

; Goodbetterbest Ltd PC USB Controller_START
[Goodbetterbest Ltd PC USB Controller]
plugged = True
plugin = 2
mouse = False
AnalogDeadzone = 4096,4096
AnalogPeak = 32768,32768
Mempak switch = button(10)
Rumblepak switch = button(11)
C Button D = button(1) axis(3+)
C Button L = axis(2-)
L Trig = button(4)
Start = button(9)
C Button U = button(0) axis(3-)
DPad D = hat(0 Down)
X Axis = axis(0-,0+)
R Trig = button(5)
DPad R = hat(0 Right)
DPad L = hat(0 Left)
Z Trig = button(6)
Y Axis = axis(1-,1+)
DPad U = hat(0 Up)
A Button = button(2)
B Button = button(3)
C Button R = axis(2+)
; Goodbetterbest Ltd PC USB Controller_END

And in the main config:
/opt/retropie/configs/n64/mupen64plus.cfg

# Joystick event string for stopping the emulator
Joy Mapping Stop = “J0B8/B9”

So I get the normal “exit back to emulationstation” behaviour you expected.