sebas77
Posts: 2
Joined: Sun Jul 21, 2019 5:00 pm

Is there any working version of Mame for RPI4 in any form?

Sun Jul 21, 2019 5:02 pm

I tried already several options but no success for one reason or another. Did anyone manage to make it work yet?

jdonald
Posts: 432
Joined: Fri Nov 03, 2017 4:36 pm

Re: Is there any working version of Mame for RPI4 in any form?

Sun Jul 21, 2019 9:40 pm

As I understand it, emulators linking libbrcmGLESv2.so won't work on a Pi 4. That unfortunately includes anything forked from squidrpi's mame4all-pi and the RetroPie forks. For whichever builds you're testing, you can run ldd mame to see if it's got any /opt/vc stuff bound to fail.

My Pi 4 hasn't arrived yet, but this worked to get MAME running on Mesa:

Code: Select all

    sudo apt install -y mame
    mkdir -p ~/mame/roms
    cp path/to/your/pacman.zip ~/mame/roms/
    mame pacman
However, on my Pi 3B+ it's a bit slow because it doesn't have any speed hacks common to the RPi forks.

RetroPie has a MAME build that runs on ODROID, right? In theory if you could get that binary standalone it might work and provide a good experience.

altharic
Posts: 33
Joined: Sun Apr 29, 2018 7:27 pm

Re: Is there any working version of Mame for RPI4 in any form?

Mon Jul 22, 2019 7:47 am

I compile mame from source works fine on my pi4.

313Alf
Posts: 15
Joined: Sun Jul 07, 2019 12:55 am

Re: Is there any working version of Mame for RPI4 in any form?

Mon Jul 22, 2019 9:54 pm

Yes, the repository version works (0.206), at least for the few games I tested, e.g. Galaxian.
Sorry if you require a more up-to-date version, I'll post my findings anyway. I don't know how to compile a version.

Go to Preferences, Add/Remove Software, search for 'mame'.
Install 'Multiple Arcade Machine Emulator (MAME)' and 'Multiple Arcade Machine Emulator (MAME) - data files'.

Create a roms folder somewhere, I put it in /home/pi/.mame/roms. Copy your rom files into there.
The mame folder is hidden, so use 'view/show hidden' to reveal it in file explorer.

You can run mame from the rasp button/games/MAME.
Use tab key to select 'Configure Options/Configure Directories/ROMs' and navigate to your roms folder then press TAB to select.

Go down to 'Return to previous menu' to back out. Don't forget to 'Save Configuration' before exiting the menus.
In main Mame screen, TAB until you are on the leftmost column, and choose 'Available', it should show your roms.

I had previously tried to follow a guide on installing, so if it doesn't work for you I could try and see what else I installed that may have helped it work.

jdonald
Posts: 432
Joined: Fri Nov 03, 2017 4:36 pm

Re: Is there any working version of Mame for RPI4 in any form?

Mon Jul 22, 2019 11:34 pm

Getting MAME from the apt repository or building from mainline source works, but with ~v0.206 we lose something from the spirit of squid's mame4all-pi:
an old version of MAME it plays much faster than the newer versions and as the Pi is rather CPU underpowered it was chosen to get as many games working at full speed as possible
To get that back, someone would need to re-port the dispmanx codebase back into something not Broadcom-specific. Hacky for sure, so I could also see everyone just going forward with mainline, sacrificing bleeding-edge performance for more accurate emulation and maintainability. The increased horsepower on the Pi 4 might make up for it.

So far how is the framerate looking for you guys on the games you care about?

liamhayes
Posts: 1
Joined: Mon Jul 08, 2019 7:39 am

Re: Is there any working version of Mame for RPI4 in any form?

Tue Jul 23, 2019 3:19 am

I tried all possible options but it still didn't work on a Pi 4

313Alf
Posts: 15
Joined: Sun Jul 07, 2019 12:55 am

Re: Is there any working version of Mame for RPI4 in any form?

Wed Jul 24, 2019 10:47 pm

jdonald wrote:
Mon Jul 22, 2019 11:34 pm
So far how is the framerate looking for you guys on the games you care about?
Pressing F11 shows me a % readout.
Galaxians stays at 100%, Phoenix 99 to 100%, Defender 89 - 100%.

Defender is very playable, but shows a slight lag in the flight of the ship, the sound samples at bootup and the start of the game are glitched as if the processor is struggling. I have not attempted any tweaks to Pi or Mame yet (will need to read up on it), plus my desktop resolution is very high - would this affect game speed?

I was able to configure both a Wiimote and attached Classic Controller Pro in Mame which is great.

altharic
Posts: 33
Joined: Sun Apr 29, 2018 7:27 pm

Re: Is there any working version of Mame for RPI4 in any form?

Thu Jul 25, 2019 6:58 am

The sample rate would affect it as well as the resolution drop it down and it should run faster.

If you are purely playing these games use advancemame it runs better but less accurate.

pudding
Posts: 95
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: Is there any working version of Mame for RPI4 in any form?

Thu Jul 25, 2019 10:22 am

Retroarch compiles fine on the RPi 4 as it already has the required API support. You'll need to compile yourself though until RetroPie (or others) has been updated.

Follow the instructions on the Gist https://gist.github.com/AlexMax/32e5d03 ... nt-2960702 and follow the main part of the Gist at the top to configure the cores. You only need to compile retroarch as the cores from the build bot will work fine. MAME 2003 plus core is a good choice. You can compile cores yourself so things like N64 work great too (full speed!).

Don't use mame4all-pi on the RPi4 - it won't work anyway due to the graphics API changes and I won't update it as there are far better MAME emulators now that the RPi4 can run at full speed due to its superior performance. mame4all-pi was designed for RPi1 (Zero).
Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

altharic
Posts: 33
Joined: Sun Apr 29, 2018 7:27 pm

Re: Is there any working version of Mame for RPI4 in any form?

Fri Jul 26, 2019 6:56 am

I tried n64 and only got 20 fps what could I be doing wrong also the sound was choppy even when using tinyalsa?

jdonald
Posts: 432
Joined: Fri Nov 03, 2017 4:36 pm

Re: Is there any working version of Mame for RPI4 in any form?

Sun Aug 04, 2019 2:50 am

That's a super helpful tip there:
pudding wrote:
Thu Jul 25, 2019 10:22 am
You only need to compile retroarch as the cores from the build bot will work fine.
So just five minutes compiling for my configuration then the rest of those emulators can just download on demand from the GUI. Tried out both MAME 2003 and MAME 2003 Plus. Can build for X11, or when SDL2 is built for KMSDRM I can build retroarch with --disable-x11 --enable-kms
altharic wrote:
Fri Jul 26, 2019 6:56 am
I tried n64 and only got 20 fps what could I be doing wrong also the sound was choppy even when using tinyalsa?
I guess this topic has changed a bit from MAME to RetroArch. There's no libmupen64plus.so armhf from the builtbot so I had to compile that core myself as squid says. First went to https://github.com/libretro/mupen64plus-libretro-nx but linking that leads to an error of missing dynarec_jump() becausee src/device/r4300 has x86 and x86_64 asm implementations but no ARM. Could use mupen64plus-libretro but it says that it's deprecated in favor of mupen64plus-libretro-nx. altharic where are you getting your binary or what source are you building from?

altharic
Posts: 33
Joined: Sun Apr 29, 2018 7:27 pm

Re: Is there any working version of Mame for RPI4 in any form?

Sun Aug 04, 2019 5:29 pm

I used the guidance from this I have also built directly from the bundle source on the git hub for non libretro sources.

https://gist.github.com/ematysek/fc01a4 ... 226c53ff6e

jdonald
Posts: 432
Joined: Fri Nov 03, 2017 4:36 pm

Re: Is there any working version of Mame for RPI4 in any form?

Mon Aug 05, 2019 10:12 pm

Ha, it just says TODO for mupen64plus-libretro-nx.

I've proposed a patch to fix that: https://github.com/libretro/mupen64plus ... nx/pull/82

One of the RetroPie devs there says he gets better performance in KMS/DRM mode. So you could try building SDL2 with --enable-video-kmsdrm --disable-video-x11 --disable-video-rpi, and build retroarch with --enable-kms --disable-x11 to see if that makes a difference. There are also suggestions in the ticket to configure for GLES3, but I haven't seen a good argument for how this would help or if the code even works properly in that config.

No guarantee that -nx with KMS would fix the performance you're seeing. Things seem rather sloppy around the GLideN64 fork so I suspect there's other low-hanging fruit in the audio and CPU plugins once someone profiles the whole thing.

altharic
Posts: 33
Joined: Sun Apr 29, 2018 7:27 pm

Re: Is there any working version of Mame for RPI4 in any form?

Mon Aug 05, 2019 11:08 pm

I think this thread opens a can of worms we need a rpi4 emulation section to share what works and what doesn't.

Sadly the emulation sticky is woefully out of date.

Have you tried mednafen on a pi 3 or 4 it's amazing?

jdonald
Posts: 432
Joined: Fri Nov 03, 2017 4:36 pm

Re: Is there any working version of Mame for RPI4 in any form?

Tue Aug 06, 2019 12:58 am

At least we have someone to point the finger at for taking this thread off-topic from MAME... squid!

mednafen: for NES and Game Boy Color games just fine, but it doesn't do N64. Note for users of Pi 3B+ (and older boards): make sure to configure the right driver.

the_atmosphere
Posts: 20
Joined: Fri Jul 12, 2019 3:49 am

Re: Is there any working version of Mame for RPI4 in any form?

Fri Aug 09, 2019 7:44 am

altharic wrote:
Mon Aug 05, 2019 11:08 pm
I think this thread opens a can of worms we need a rpi4 emulation section to share what works and what doesn't.

Sadly the emulation sticky is woefully out of date.

Have you tried mednafen on a pi 3 or 4 it's amazing?
i discovered mednafen and although it works quite well for nes/genesis/snes, i've found with the default setting the sound drops out semi-regularly
the only way i found to fix this was set the buffer to 50 milliseconds
and then i realized snes would still have sound issues so i raised it to 65 and it seemed to fix that
anyway i don't totally like the idea of that small bit of latency, is there another way to fix it?

altharic
Posts: 33
Joined: Sun Apr 29, 2018 7:27 pm

Re: Is there any working version of Mame for RPI4 in any form?

Fri Aug 09, 2019 11:35 am

I use snes9x for super Nintendo seems to run most games without skipping.

User avatar
7F20
Posts: 51
Joined: Tue Jul 24, 2012 2:45 am
Location: New York

Re: Is there any working version of Mame for RPI4 in any form?

Thu Jan 16, 2020 7:24 pm

jdonald wrote:
Sun Aug 04, 2019 2:50 am

So just five minutes compiling for my configuration then the rest of those emulators can just download on demand from the GUI. Tried out both MAME 2003 and MAME 2003 Plus. Can build for X11, or when SDL2 is built for KMSDRM I can build retroarch with --disable-x11 --enable-kms
@jdonald, does this "when SDL2 is built for KMSDRM I can build retroarch with --disable-x11 --enable-kms" mean that there is a way to compile retroarch in raspbian lite with no x11 or pixel environment?

I'm using a CRT arcade setup and having trouble getting this to work.

Thanks

jdonald
Posts: 432
Joined: Fri Nov 03, 2017 4:36 pm

Re: Is there any working version of Mame for RPI4 in any form?

Sat Jan 18, 2020 6:02 am

Hi 7F20,

It's been a while so I ran through this again. Basically followed squid's instructions for RetroArch 1.7.7 that he linked above at https://gist.github.com/AlexMax/32e5d03 ... nt-2960702 for building, although added --prefix=/usr/local --disable-x11 --enable-kms on top of all the other options in the gist comment.

Then for a custom build of SDL2 without X11:

Code: Select all

sudo apt-get build-dep libsdl2-2.0-0
apt-get source libsdl2-2.0-0
cd libsdl2*
./configure --prefix=/usr/local --disable-video-x11 --enable-video-kmsdrm
make
sudo make install
Then after doing sudo systemctl stop lightdm, retroarch could still run from the the console, and after editing retroarch.cfg and configuring core_updater_buildbot_url as the instructions say, I was able to download the MAME 2003 Plus core and play Pacman.

This is only for the Pi 4. If you're on a Pi 3B+ or older, you should still be able to use --enable-video-rpi with the legacy driver.

Your mileage may vary but hope this gives you an idea. CRT displays can give trouble with custom resolutions so you may want to ground yourself by testing with standard PC flatpanel too.

Return to “Gaming”