23 December 2018

Using and configuring Joysticks with M.A.M.E./QMC2 - Update December 2018

Update December 2018: First thing to do is to test whether your joystick is fully functional under MacOS. The easiest way to do is to use an online Gamepad Tester like this one:
http://html5gamepad.com/
This gives you a basic understanding of whether your gamepad works in your OS or not. In the case of the PS4 controller, for example, everything shows up under Safari (Google Chrome misses out on the PS Button as B12), which gives you a good first feeling that this joypad should work in MacOS software.

Second, if it works, you have two choices: 

1. Leave it as is: My first joypad, for example was a Logitech F310 Gamepad, a good choice. Switched on the backside to Direct Input, it runs out of the box in QMC2. No drivers under MacOSX required.

Update November 2016: Since the X Input mode emulates XBox controllers, I gave this XBox driver from Github a try - and it works! The immediate advantage is that all things are configurable in the MacOS System Settings, and RetroArch automatically assigns the joypad to XBox configuration, which is nice. Further insights will follow, but that's a good thing. It is fully compatible with MacOS Sierra.




As a second joypad, I went for a PS4 controller, and this thing rocks, both on USB and Bluetooth. No additional drivers required. Build quality is superb, this is a clear recommendation. It is still my favorite joypad for MAME.




Read further for MAME Joystick settings...

MAME in MacOS 14.14 Mojave, Thoughts on Significance of GPU

After the hickups around upgrading iMacs equipped with Fusion Drives have been sorted out, I upgraded to MacOS Mojave. Also for MAME, it was definitely worth it.

For all of you having Fusion Drives plus Bootcamp on your Mac - it is finally safe to upgrade, provided that you first backup your Windows data, delete your Bootcamp partition and do the upgrade to Mojave thereafter: https://support.apple.com/en-us/HT209057 (worked perfectly for me). My Fusion Drive is finally on APFS. Also the installation of Windows 10 via Bootcamp was entirely flawless.

Speaking of Mojave - I really love the new Dark Mode.

 

So what about MAME in Mojave - here I have really good news. From my first benchmark tests, Mojave seems to bring quite consistent performance increases to MAME running BGFX/Metal. This is the command from the Terminal:
./mame64 -window -video bgfx -str 60 -noafs -bgfx_screen_chains crt-geom-deluxe -bgfx_backend metal -noreadconfig -nosleep -nothrottle ROMFILENAME
In both instances the current MAME 0.204, with and without Artwork

Game
High Sierra
Mojave
1942 (Revision B)
743.95% / 761.62%
 771.05%/767.06%  
1943
707.83% / 760.09%.
704.09%/761.15%
3wonders
577.99% / 582.34%  
822.15%/604.72%
elevator
588.24% / 587.99% 
603.27%/604.03%
gyruss
370.31% / 379.10%
545.74%/590.24% 
Inthunt
584.24% / 570.71%  
615.52%/592.22%
mslug
605.41% / 610.59%
610.48%/619.22%
offroadc
149.43% / 167.06%
285.55%/284.72%
rtype
676.01% / 631.30%
696.62%/658.33%

I immediately noted the quite significant performance in Gyruss and Offroad Challenge. Which brought me to a long-standing question:

How important is the GPU of your Mac for MAME performance?

You can read quite frequently that MAME solely depends on a good CPU, whereas GPU performance is irrelevant. I was always sceptical about this statement, simply because I had different experience on Mac minis and Mac Laptops with integrated GPU. After some dedicated testing, this might be the answer:

While MAME standalone relies on the CPU, the GPU (literally) becomes the game changer as soon as you add artwork and/or shaders. My first tests are very preliminary, however give a very clear picture.

Tests on my iMac Late 2013 with NVIDIA Geforce GTX 780M 
(GPU History according to Activity Monitor)
















Tests on my MacBook Pro 13'' Mid 2012 with Intel HD4000 integrated GPU



Tests on a Mac mini (Mid 2011, 2,7 GHz i7, AMD Radeon HD 6630M 256 MB) go in a similar direction (unfortunately the GPU graph of the Activity Monitor does not work):

1942 Revision B
741,07% - without artwork and without shader
412,74% - BGFX/Metal* without dedicated shader
253,51% - BGFX/Metal* with CRT-GEOM Deluxe
64.24% - BGFX/Metal* with HLSL
*OpenGL show very similar results

What I get from this as a preliminary conclusion: Shaders and bezels desperately need GPU power. And arcade games only make fun if you apply shaders and artwork. 

So does it sense to purchase a new Mac mini if you are into enhanced MAME gaming? Probably not, unless you want to invest into an external GPU as well.

I will try to further dig into this very interesting topic, simply because you can read so differently all over the Internet about MAME requirements. 

PS: Sorry for just looking into the GPU History of the Activity Monitor. I tried the very decent XFG App https://gauchosoft.com/Products/XRG/- but this software does not recognise my GPU, so I am stuck with the above graphs for the time being. Should you have alternative suggestions for testing, I would be happy to learn about them.

PPS: Some preliminary tests with iStat (unregistered) confirm these findings. BGFX without shaders leaves GPU usage clearly below 40% on my iMac. BGFX shaders with bezels in fullscreen can drive GPU usage beyond 75% on the same machine. This again gives me an indication about how important GPU performance seems to be for MAME running shaders and artwork. My plans to head for a new Mac mini slowly evaporate ...


01 December 2018

41.000 page views later ... the state of MAME on MacOS

I remember January 2016, when I started this Blog. MAME on MacOS was working, but a somewhat limited venture with scarce information being available on the Internet. I started this blog based on my own trial and error attempts. Since then a lot has changed to the better. 44 posts and 41.000 page views later, it's time to have a look at the current state of MAME on Macs.  

The bright side of things:
The mixed picture:
  • With newer versions of MAME (still have to figure out since when), the CRT-GEOM OpenGL shaders tested here no longer work. So you need to rely on BGFX with similar performance in the CRT-GEOM shader, which is basically no problem.
  • Retroarch/MAME would be great, but only old versions work on Macs. The MAME/current core is outdated. MAME 2010 is decent for old school games, but from time to time buggy in my own testing. I am unsure about the stability of the Metal driver of Retroarch, it seems to crash from time to time. Retroarch/MAME under Ubuntu is a by far more stable experience (though it also has its limitations). I am particularly missing the brilliant Runahead feature in MAME/current cores (for Linux as well). So while I am constantly looking into this, current limitations are too many for a good MAME experience. 
  • What about OpenEmu? While I really appreciate their Mac approach on emulation, it simply comes with too many limitations in MAME - for a reason the MAME emulation is only experimental in OpenEmu. OpenEmu seems to use version 0.169 of MAME, and if I am not mistaken, this is also where Retroarch/MAME currently stands. Despite the higher learning curve, I would prefer Retroarch over OpenEmu.
What is still true for MAME in overall:
  • For best MAME experience, you should not shy away from text editors and config files. You will have a better system if you do your configuration in these files manually. Don't rely on frontends for configuring MAME - but go this way:  https://mameonmacs.blogspot.com/2017/05/mame-0185-from-scratch-via-mewui-update.html
  • Shaders and in-game artwork (bezels and backtrops) make a huge difference. Just have a look at the title picture of this Blog, and you'll understand.
  • Also have a look at the special realistic artwork bezels that I am building up in this repository. I am still blown away by their quality (mainly created by John Merrit and Orionsangel): https://github.com/estefan3112/MAME-Realistic-Bezel-Artwork
Since MAME lives from the community, may I repeat that any feedback form your side is much appreciated! Apologies for missing out on them from time to time, but I surely read them all. 

Setup MAME 0.204 from scratch on Macs (Update December 2018)

Another update on how to configure MAME from scratch via its internal interface MEWUI (default MAME UI since 0.171) and a text editor.  
If you are willing to work with your Terminal and a Text Editor, it is just the best way to set up and maintain MAME, irrespective of which frontend you wanna use later on.
So let's go step by step from scratch. 
MEWUI - click to enlarge
Step 1 - Basic Homework 

Download and install SDL 2 and QMC2 as explained here (only Steps 1 and 2). Download a good text editor - I prefer TextWrangler from the Mac App Store. Change Finder Settings in order to Display Hidden Folders and Files, e.g. with Deeper (you need access to your User Library folder, which is by default a hidden folder). Of course, download MAME from here and unzip it into the place of your choice.

Recommendation: I currently keep my running MAME version in the folder 'mame' and keep only older versions in a version-related directory. This definitely helps you further on to stay consistent and carry on your work.

Step 2 - Create .ini files in Terminal and manually configure ini path

After a lot of testing, my clear recommendation is to create your first .ini files from the Terminal. This should save you from a lot of headache by multiple .ini files that just cause confusion.

  • Start Terminal and cd into your directory of MAME (recommendation: name your main directory mame, if you run different MAME versions, hold your actual version under plain mame)
  • Now in the Terminal and in the right directory, the command ./mame64 -cc generates the three default config files in your mame directory:
mame.ini - your overall configuration file for MAME
plugin.ini - your configuration file for activating and deactivating MAME Plugins
ui.ini - your configuration file for the MEWUI interface
  • By default, mame.ini contains the following multiple ini paths:
inipath  "$HOME/Library/Application Support/mame;$HOME/.mame;.;ini"
In my own experience, this is rather unfortunate, because you may end up with multiple .ini files at multiple places rather easily. Since MAME then considers all these .ini files in a certain row, you may be lost in chaos. Right now, I actually prefer having all .ini files in the MAME directory called ini, thus I reduce this line as follows:
inipath                   ini
This means of course that you have to move the three .ini files created in the first step into the ini subdirectory. As long as you do not forget about the ini directory when moving to a new MAME version, this is probably easiest to handle, and the /Library/Application Support directory stays clean of MAME config files.
 Step 3 - Start MEWUI (the right way)

Open Terminal and switch to your MAME working directory (easiest way: type 'cd' and then drag the mame directory from the Finder into the Terminal -> press Return in the Terminal window)

Warning: starting mame64 with double-click works, but you are not in the MAME working directory, so a lot just does not work -> start via Terminal as explained here. So you must be in the MAME working directory!