M64Py is a Qt5 front-end Gui for Mupen64plus written in python. It is a much better gui n64 emulator to use than mupen64plus on the command line, because it is confusing to use, so if anyone is tired of using mupen64plus on command line, then install this emulator. M64py has a lot of cool stuff included like, it's better to configure controls, Roms have snapshots, you can configure video plugins easier, use cheats easier, and more. M64Py has more info here: http://m64py.sourceforge.net/.
First you need these packages for the mupen64plus build to work:
sudo apt install libboost-dev libboost-filesystem-dev libsdl1.2-dev libsdl2-dev
Now build & install mupen64plus:
wget https://github.com/mupen64plus/mupen64plus-core/releases/download/2.5.9/mupen64plus-bundle-src-2.5.9.tar.gz
tar -zxf mupen64plus-bundle-src-2.5.9.tar.gz
cd mupen64plus-bundle-src-2.5.9/
sudo CFLAGS='-mfpu=neon -mtune=cortex-a72 -march=armv8-a' ./m64p_build.sh NEON=1 USE_GLES=1 VFP_HARD=1 NEW_DYNAREC=1
sudo CFLAGS='-mfpu=neon -mtune=cortex-a72 -march=armv8-a' ./m64p_install.sh NEON=1 USE_GLES=1 VFP_HARD=1 NEW_DYNAREC=1
Mupen64plus is officially installed. If you have any issues that you ran into, post them here: https://github.com/mupen64plus/mupen64plus-core/issues. Now we can install m64py.
M64Py needs these packages installed in order for the emulator to work:
sudo apt install python3-pyqt5 pyqt5-dev-tools python3-pyqt5.qtopengl qt5-default libpcap-dev libncurses5-dev libprocps-dev libxtst-dev libxcb-util0-dev qttools5-dev-tools libdtkwidget-dev libdtkwm-dev pkg-config
pip3 install pysdl2
pip install pysdl2
Next install M64Py:
cd ..
git clone https://github.com/mupen64plus/mupen64plus-ui-python
cd mupen64plus-ui-python
python3 setup.py build
sudo python3 setup.py install
M64Py is officially installed. Just an FYI the location for M64Py is (/usr/local/bin). Run m64py by going to terminal and type
m64py
First go to Settings, Paths, and browse the location on where your roms are kept. You should have 2 video plugins, video-rice, and glide64mk2. I would do video-rice for the testing, and I know some might have the plugin flash a lot, and some roms that don't work, but the next step will show you what you need to do. Configure your controls by going to settings, plugins, configure mupen64plus-input-sdl, keyboard controls are set to default, if you want to use a wired or bluetooth gamepad, make sure the setting is fully manual so you can map the controls, choose your device you want to use, map the controls, and the settings should save automaticly, make sure your AnalogDeadzone x and y sensitivity is set to "4096", and the AnalogPeak x and y sensitivity is set to "32768", or your joystick will have problems. Refresh your roms by going to file, open rom, from list, and click refresh. Now you have the list of roms and snapshots. Open the rom you want, and then it should run. If you want the best emulation retropie used, move on to the next step. If you don't then your pretty much done.
To get the GlideN64 plugin, you will have to download the retropie n64 pack and find the plugin inside the pack and then copy it to /usr/local/lib/mupen64plus by doing this:
wget https://files.retropie.org.uk/binaries/buster/rpi4/kms/emulators/mupen64plus.tar.gz
tar -zxf mupen64plus.tar.gz
sudo cp mupen64plus/lib/mupen64plus/mupen64plus-video-GLideN64.so /usr/local/lib/mupen64plus/
The last thing you need to do is to make the GLideN64 plugin use the same settings that retropie used or it will lag, first go to >>settings, >>plugins, then configure the GLideN64 plugin, copy the following settings:
That will make it so when you do full screen or increase the window size, the emulation will look pixely like the same emulation graphics retropie used. So now we shouldn't have to worry about the emulation lagging.
Hopefully this guide helped you install m64py on your pi4. Feel free to add a comment as long as it's on topic, If you find serious bugs that needs to be fixed then post them here: https://github.com/mupen64plus/mupen64plus-ui-python/issues. This Guide will be updated when the newest update of M64Py or Mupen64plus comes out, or if anything needs to be changed.
Happy Gaming!