16 July 2022

MAME on Apple M1 - as good as expected!

Update 3 December 2022: moving to Ventura was smoothless - see this short post.

Update 16 July 2022: I did some prelimimary MAME testing on a 14“ MacBookPro M1Pro (it’s not mine). While this is no in-depth review, there are some insights from a MAME gamer‘s perspective I would like to share with you.
  • SUPERB The Liquid Retina XDR-display with 3024x1964 is a real highlight. Above all the ProMotion refresh rate of 120 Hz provides you with butter-smooth scrolling out of the box. Just activate waitvsync on top, and you get perfect scrolling. But don’t use nothrottle as your games would run double speed.
  • GOOD: This laptop produces surprisingly good sound quality. Retrogames sound very nice!
  • GOOD: It did not produce any heat during my testing, and no fan noise. Always such a good thing compared to most Windows and MacIntel laptops.
  • BAD: In some games, e.g. 1942, the display notch is quite a nuisance (see photo below). But it’s not terribly bad, if it makes you crazy, use a bezel and shrink your screen, or just turn to window mode.
  • SURPRISE: Initial benchmarks (as I used to do them) provide for worse results than on my Mac mini M1, even on the same external display. The M1 Pro should provide better results, so something is wrong. In practice, this is totally irrelevant, as the games run just nicely so far.
Conclusion: Of course this machine is too much for Retrogaming, but if you happen to own such machine, it provides an impeccable MAME gaming experience, with this display being the highlight. Would I need a Mac laptop, I would always opt for a ProMotion display.

In many games, you will have to adjust the screen below the Display Notch.



Original post: I finally decided to move to a Mac mini M1 - and MAME just shines on it. No war stories here, but just the benchmarks!


R0ni compiles M1 MAME, so get it here: https://sdlmame.lngn.net/ or on Github: https://github.com/mac-a-r0ni/mame 

This table shows you a performance comparison between:
- Mac mini M1 (native)
- Mac mini M1 (Rosetta2): no real need for this, but just to demonstrate Rosetta2 performance 
- Mac mini Intel (latest version)
- iMac (late 2013): best results under Mojave (Catalina became slower, and no Big Sur here)

./mame -video bgfx -str 60 -noafs -bgfx_screen_chains crt-geom -bgfx_backend opengl -noreadconfig -nosleep -nothrottle -lowlatency



Briefly explained: I run a 60s performance test with BGFX/CRT-GEOM shaders and Artwork enabled. With throttling disabled, the games runs at the highest possible speed. As of version 0.229, the binaries are no longer called mame64, but just mame (about time :-).


I have been testing these 9 games throughout all versions, so they are kind of reliable for me. It is all old school stuff, only offroadc is 3D.

So obviously, M1 MAME rocks seriously - some notes:
1. It is a 16 GB model, and it is probably not advisable to head for the 8 GB model, since this is also used for the GFX chip.
2. The metal backend of BGFX is currently not performing well at all, you need to switch manually to OpenGL. This applies to the Intel version as well.
3. It is impressive how well Rosetta2 performs here, but there is really no need to use it.
4. Finally, this M1 Mini managed to overtake my old iMac (Late 2013, MAME 228) or be on par of it. Some results, such as elevator or gyruss, are highly impressive. 
5. And just look at how poor the Intel Mac mini performs - as explained, it is all about the shaders that need a decent GFX chip - which the Intel Mac mini does not have.

Compatibility with other MAME-related software:
- SDL: the latest version just works (Intel binary)
- Attract Mode: just works in Rosetta2, no problems experienced so far
- Negatron: unfortunately, neither the bundled nor the standalone version works for me by now
- Homebrew: Some installation hickups, but now just works. It is so nice to have all these ARM compiles via Homebrew available after quite short time.
- OpenEmu: current version 2.3.3 from January 2021 is Intel only, however runs way better with Rosetta2 than on the last Intel mini; Mame 0.227 inside; did not do much testing so far, but all shaders seem to work as well on full speed; thus also good, even in Rosetta 2.
- RetroArch: right now only version 1.9.0 for Intel Mac is out, but it also runs MAME surprisingly well; as with OpenEmu, I need to look into here further, and an M1 version, as announced by the RetroArch team, could become a bigger thing.

And finally, here are some war stories:
- Noise and heat: Compared to the Intel mini, a complete game changer. You simply do not hear anything from the fan inside this M1 mini. When compiling MAME, the Intel mini fan gets really loud, while the M1 mini stays silent as in idle. Also the M1 mini is dead cold in normal usage, while during MAME compilation, it gets slightly warm. It is hard to tell how big the difference to the Intel mini is here.
- Compilation times: No objective numbers here, but rest assured that MAME compiles way faster than on my Mac mini.
- Some crashes with external storage attached: While the system is rock stable as expected from any Mac, I do experience quite frequent crashes right now if I connect my Intel mini in Target Disc Mode via USB (kind of "purple screen of death"). As I know, there is nothing to worry for me right now.

All in all, I cannot ask for more. If you wanna know anything else, please leave me a comment.

Fun Update 1 March 2021:

How these numbers fare against a rather serious Windows Gaming PC (ASUS ROG STRIX Z490-E with i7-10700K, GeForce RTX 2070 Super 8 GB GFX and 32 GB RAM, Windows 10 latest version)

mame -video bgfx -str 60 -noafs -bgfx_screen_chains crt-geom -bgfx_backend opengl -noreadconfig -nosleep -nothrottle -lowlatency

mame -video bgfx -str 60 -noafs -bgfx_screen_chains crt-geom -bgfx_backend vulkan -noreadconfig -nosleep -nothrottle -lowlatency




Of course, I gained no real insights from this test because you should not buy such a PC just for MAME gaming in the first place. But it is interesting to see how well OpenGL fares in BGFX on Windows10 PCs as well. I even did not include d3d11 and d3d12, as they performed far worse than these two chains. With the Vulkan shader, this gaming pc is more or less on par with the Mac mini - in old school gaming at otherwise identical settings and artwork.

But to give this Windows system full credit: The major difference is actually Geforce Sync in connection with an ASUS Gaming Monitor. This sync is basically the best sync you can get for MAME, no specific options in mame.ini required. But I will further dig into this evergreen topic on the MacOS side of things.

5 comments:

  1. Dear Sir

    thx a lot for this explanation. I don't know if you can help me but I encountered some problems. I have a mac Mini 8b M1:

    - Launching with ./mame gives me an error

    "Fatal error: BGFX: Unable to load required shaders. Please check and reinstall the bgfx folder

    zsh: segmentation fault /Users/myusername/Desktop/mame0230-arm64/mame

    Is this fixable?

    - launching with your command seems to word but games run way to fast and I get kicked out after some seconds when i press the On player button

    - I was unable to connect a USB joystick

    I would really appreciate if you could give ma advice

    greetings



    ReplyDelete
  2. Hi, and sorry for the late reply. The error that you encounter typically occurs if you have not changed to the directory of the mame executable via cd /.../..../mame/ first. So be sure that you run the command from inside this directory, and then it should work. Cheers!

    ReplyDelete
  3. I don't know what it is (maybe using of SDL 2 is broken?), but the rendering with this precompiled M1 version looks absolutely awful on my MBA 13 with retina display. In the MAME UI the fonts are not sharp but kind of distorted. When starting a MIPS IREX emulation I can not even read the fonts when IREX finally is booted up and uses a higher resolution. Also applying any shader in mame.ini seems to have no effect to any game. Only the option bgfx_screen_chains is kind of working for applying a crt mask look. But even with other chains like hq2x that should smooth the screen it works not completely and bgfx_screen_chains=hq2x make the screen of a game absolutely distorted.

    When I run the same Mame version within Parallels using a Windows 11 for ARM everything in Mame looks nice and sharp as it should be (the Mame UI and also MIPS IREX emulation screen). Only big downside to using this Windows 11 way is the big lost of performance because of too many emulation layers involved (Parallels device emulation, Windows ARM emulation of Intel x86 and Mame emulation of the game or Irix machine).

    ReplyDelete
  4. The distortion on MacOS is only there if some textures needed to be down scaled (like in the UI or the mentioned IRIX screen that is downscaled). But if you only play low res mame games that are drawn 1:1 or even upscaled all is sharp and usable. It is like it was just forgotten to implement mipmapping for downscaling textures when using SDL on Macos (or maybe this code is just broken by accident), but it seems to be done and working fine in the windows implementation.

    ReplyDelete

Any comments are welcome!