29 December 2016

MAME 0.181 and 6100 Views in one year :-)

2016 ends with MAME 0.181, which according to its whatsnew.txt contains a row of nice updates. On the Macintosh side, all remains the same: no Metal plugin and the same issues in BGFX as described in detail before. More to come here.

This year ends with 6100 views, for which I am grateful, considering the rather narrow content published here. The interest in this Blog is quite as expected:
One thing: Please feel free to write any comments you may have, they are more than welcome. 

More to post here.

19 December 2016

BootCamp for Mac Retrogaming - Is it Worth The Hassle?

This post will be about running BootCamp for Retrogaming. As regards MAME, I am interested in a direct comparison between MAME running on macOS Sierra and Windows. 
Eventually the question is whether it's worth the hassle with BootCamp, or whether you can easily stick with your Mac system.



Bottom Line: MAME on Windows is by far faster than on Macs. However, with some tweaking, you get similar results on Macs, but Windows remains the performance king. Probably it makes more sense to tweak your Mac settings, e.g. faster shaders, than installing BootCamp and keeping a Windows system up-to-date all the time.

Here are the details:

30 November 2016

MAME 0.180 is my first MacOS Sierra Compile

Both MAME and QMC2 compiled flawlessly. Another huge ChangeLog in this version.

  • Unfortunately the Metal backend is still broken, so I can stay only with OpenGL. This does not make me very optimistic about the future of Metal as far as MAME is concerned.
  • Otherwise everything works as it should be. Also QMC2 is another rock solid release.

Let's see further what's inside of this for me...

14 November 2016

Off Topic: Preparing Retropie from a Mac (with November 2017 update)

This is not much Mac-related, but I am currently spending all of my 'computer time' with preparing two Raspberry Pi 3Bs with Retropie as Christmas presents. I will collect my insights, and again like it was for MAME, my conclusion is that Macs and Raspberry Pis/Retropie are a good combination.


It is mostly a MAME 2003 romset. But Final Burn Alpha (then with different ROMs) seems to be a very good choice in case of performance problems on the Pi.

After having gone through some learning curve, I cannot give enough kudos to the Retropie project! What an impressive achievement - including some really good online documentation that is up to speed with the development. One thing is clear: You can hardly beat this system in the living room when it comes to a smooth retrogaming experience.

I will summarize my recommendations in the following:

09 October 2016

MAME 0.178 - Not Much To Report

I have played around with MAME 0.178 for some time, and there is not much I can report for this release:
  • The METAL shader of BGFX still seems to be broken on my machine under El Capitan. I am wondering whether anybody at the MAME team is aware of this fact.
  • BGFX still runs much faster if you deactivate Artwork (-nobezel option on the command line) - I am still wondering whether this means that these games also perform so much worse when you throttle them to real time. Or it just doesn't matter - I never reached a value below 100% when activating bezels.
  • In my performance testing, I experience significant performance losses in this release of some 20% with some of my games I use for testing (including R-Type, 1942, Gyruss - but notably not Elevator Action).
  • New working games are shown here: https://www.youtube.com/watch?v=QHWFphs99Mc

17 September 2016

Performance Tests BGFX vs. GLSL (Update September 2016)

Standardized performance testing from the command line explained (so you keep your MAME configuration fully intact - again many thanks for Headrush69 for this insight):

Open Terminal and change into your MAME directory, then execute (example for BGFX/CRT-GEOM-DELUXE testing):
./mame64 -video bgfx -str 60 -noafs -bgfx_screen_chains crt-geom-deluxe -bgfx_backend opengl -artcrop -noreadconfig -nosleep -nothrottle rtype

What this example does: It launches R-Type for 60 seconds with the BGFX/CRT-GEOM-DELUXE shader and the OpenGL backend on full speed. Other configuration options of mame.ini left out. After exiting MAME, the Terminal window provides you with the performance result:
Average speed: 634.69% (60 seconds)

If you want to test the GLSL shaders that you have installed manually, be sure that you provide the full path. Example with bezels disabled:
./mame64 -video opengl -nofilter -gl_glsl -glsl_shader_mame0 /Users/xxxxxxxxxxxx/Documents/mame/CRT-GEOM-DELUXE/CRT-geom-halation -str 60 -noafs -artcrop -noreadconfig -nosleep -nothrottle -nobezel elevator

Conclusions from my performance tests: 
  • CRT-GEOM rules both in OpenGL/GLSL and BGFX performance-wise - but take the new OpenGL/GLSL-Halation shaders (discussed here), since they perform much better! You can use Glow both in OpenGL and BGFX without risking a performance hit. 
  • If your machine can handle BGFX, the main advantages are that (i) you can fine-tune with sliders in the game and immediately see the result and (ii) you can even switch shaders in the game in real-time, which is extremely cool. Details are here.
  • The BGFX/HLSL shaders crawl on weaker machines, while the BGFX/CRT-GEOM shader performs decently on weaker machines as well (in my case it works very well on a MacBook Pro 13'' Mid 2012, whereas HLSL crawls with 40%)
  • As for BGFX, I would really like to see a slimmed down version of the default MAME HLSL shader that does not take away that much performance.
  • GLSL in MAME 0.163 vs 0.177: Elevator Action: 730% vs 840%, Gyruss 287.15% vs 429.85% -> very nice performance increases also under OpenGL! (However it seems that the 0.178 release predominantly looses these gains again) 
Here are some details

10 September 2016

Getting a Video Retro Effect on LCD - BGFX, GLSL or Artwork Effect (Update September 2016)

Consider tweaking your screen output as soon as possible 

Since MAME focuses on exact emulation, the unmodified output is unsuitable for flatscreens. This means that the tube screen feeling must be emulated on top.

Raw MAME Output without tweaking:
Let's face it: This is ugly.





















Understand the meaning of these Buzz Words:
  • Shader: program parts in MAME that can be activated for tweaking the Raw MAME output
  • Backends: sub-sections of a shader that chosen once a shader is activated 
  • OpenGL Shader - GLSL: for a long time the most important shader for Mac systems, still the performance king, but not part of the standard package
  • BGFX Shader: the new kid on the block, designed for cross-platform experience, official part of MAME
  • HLSL Shader: the shader in the Windows environment - don't mix this up with HLSL Backends within GLSL or BGFX - which apparently try to emulate the HLSL Shader in Mac systems
Recommendations summarized:
  • MAME STANDARD: bilinear filtering - just comes out of the box and gets rid of the worst pixel effects
  • ALTERNATIVE 1: If your machine is powerful enough, go for BGFX with the CRT-GEOM Deluxe Backend (new instructions below)
  • ALTERNATIVE 2: If this does not work out, go for GLSL with the CRT-GEOM Deluxe Backend instead (new instructions below)
  • ALTERNATIVE 3: If this does not work out, just add an Artwork Effect or - better - head for a new Mac
Here are the details for all three options - complete re-write in September 2016.

08 September 2016

Off Topic: Finished Walter Isaacson's Book on Steve Jobs (Finally)

Yesterday night, after several retries, I was finally able to finish this impressive book on Steve Jobs:
https://en.wikipedia.org/wiki/Steve_Jobs_(book)
How does this relate to that Blog?

04 September 2016

MAME 0.177 - First Impressions

This became my first build from source because the official build was done in MacOSX 10.11. As described in today's update to this post, the build compiled smoothly. So here are my first impressions.

(A) BGFX Metal backend seems broken. I hope that this is not due to my own compile. When trying to launch a game from the command line, the Terminal application returns the following error:
/Library/Caches/com.apple.xbs/Sources/Metal/Metal-56.6.1/Framework/MTLRenderPipeline.mm:1006: failed assertion `Blending is enabled for render target 0; however, the pixelformat MTLPixelFormatInvalid for this render target is not blendable.'

Abort trap: 6
Doesn't seem to be a problem of my own build. OpenGL backend works without problems.

(B) Performance: Headrush69 (who posts a lot of good comments here) provided me with the perfect performance testing tool from the Terminal (from inside of the MAME directory), because you do not need to change anything in your settings for doing these tests. Many thanks Headrush69 for this! And here are some first performance results:

Compiling QMC2 and MAME under Mac OS El Capitan/Sierra (Update 02/2017)

Compiling an own QMC2 MacOSX build has been a longstanding target of mine: From time to time, official MacOS binaries have been missing or delayed. In particular installing QT in its legacy version 4.8.7 proved difficult. Homebrew changed this and now the QMC2 compiling process works very well.

Since MAME 0.177 I have also been compiling my own builds under El Captain and later on MacOS Sierra, and it just works.

Compiling QMC2 - the details

(A) The starting point is the QMC2 Wiki - which in the meantime is no longer outdated:

(B) For El Capitan and MacOS Sierra, QT 4.8.7 needs to be installed via Homebrew (as now documented under (A):

Step 1 - go to http://brew.sh

Step 2 - open your Terminal and install Homebrew by copy pasting the entire Terminal command from the window:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step 3 - run the following commands from the Terminal:
brew install qt4
brew linkapps qt (links the qt4 commands to the Applications folder -> that has been a recommendation which I am no longer sure about, but it should be no issue to manually remove the symlinks later on)

Voila, I have a running QT 4.8.7 environment under El Capitan/Sierra :-).

(C) As soon as you have the proper QT environment in place, compiling of QMC2 as explained under (A) worked like a breeze - in short:
Switch to the tmp directory of your MacOSX system via Terminal, then download the source code of QT2 (tmp directory assures that these files are deleted):
svn co https://svn.code.sf.net/p/qmc2/code/trunk qmc2
Then switch into the qmc2 directory:
cd qmc2
Then make the executables (in my example with an alternative image set, otherwise just make):
make IMGSET=crazy
Then install, and make sure that an existing qmc2 directory in the Applications folder is renamed before executing this command:
make install
Means: Without 'sudo make' you cannot overwrite an existing qmc2 directory in Applications - rename it  to e.g 'qmc2.old' beforehand just in case.

But why compiling QMC2 in the first place? First of all, sometimes you have to wait for the Mac binaries for quite some time, and for some versions, they just don't appear online. Secondly, I like building QMC2 with customized icons and without the additional plugins. And finally, compiling from the svn repository is fun :-).

The result is a fairly nice black-themed QMC2, which I quite like. 
Screenshot with Black Theme, Click to enlarge
Compiling MAME - the (not so many) details:

Compiling MAME ever since El Captain is just as easy as it can get. Following the official instructions produces me builds that just work. This also means that these rather complicated build instructions are outdated.

It is just as easy as that:
  • Have XCode and SDL2 installed
  • Download and extract the MAME source code
  • Open Terminal and move to the MAME source code folder
  • make -j5 (if you have a quadcore machine) - drink coffee or tea during the build time
Only the cleanup seems a bit messy to me. Due to the lack of a 'make install' procedure, you must get rid of the source code chunks in your build manually.

Since MAME 0.177 until the current version all builds run without problems.

MAME in Homebrew: This is a very nice initiative. Here you also get all the dependencies installed automagically, and the MAME executable is in $PATH. My only major concern here is that these binaries are some four months behind the latest release, currently 0.179. So if you are not doing your own ROM sets, you can easily run into incompatible games. This is why I would not recommend this route right now (it would be interesting to understand why these builds are way behind).

27 July 2016

MAME 0.176 is out - and BGFX/CRT-GEOM shaders are in!

MAME 0.176 seems to be another great release when it comes to shaders. In the BGFX section the CRT-GEOM and the CRT-GEOM Deluxe shader (for Glow) made it into the default distribution, which really rocks.  Also some BGFX bug fixing. 

First performance tests with CRT-GEOM Deluxe are very promising - I see significant performance increases on my machine (performance numbers in brackets are from these tests here) with old games. Interestingly newer games seem to loose performance, but still perform in a very healthy area:

1942 (Revision B)
BGFX/Metal-CRT-GEOM-Glow, Window - 650,30% (vs 212,08%)

Defender (Red Label)
BGFX/Metal-CRT-GEOM-Deluxe, Window - 501,07% (vs 742,88%)

Elevator Action
BGFX/Metal-CRT-GEOM-Glow, Window - 449,59% (vs 200,70%)

Gyruss
BGFX/Metal-CRT-GEOM-Glow, Window - 336,37% (vs 191,21%)

Out Run (sitdown/upright, Rev A)
BGFX/Metal-CRT-GEOM-Glow, Window - 398,24% (vs 627,28%)

R-Type (World)
BGFX/Metal-CRT-GEOM-Glow, Window - 472,44% (vs 633,44%)

Configuration: MAME 0.176, QMC2 0.66, Throttle Off, run 60 seconds, for details, please see this post.
In the BGFX section of QMC2, you can now directly insert crt-geom deluxe for the chain, and you are ready to go.
I applied changes to the .json file as described here for GLSL in the same way. More details will follow.

Conclusion: BGFX in MAME gets better and better, and it also seems that the shader is gaining performance. So for everybody that had performance problems before, MAME 0.176 is definitely worth another try.

11 June 2016

GLSL Revisited: newer CRT-geom Shader

I finally found a version of the CRT-Geom Shader that incorporates the Bloom Effect, you can download the 2015 version here: https://sites.google.com/site/o0kinghanco0o/crt-geom-alternative-downloads

File: CGWG-CRT-geom-halation-20151123.zip

25 May 2016

BGFX Shaders - Finally Working :-) :-) :-)

Since MAME 0.172, the BGFX shaders are the new kids on the block, and they are very promising. In particular, they are cross-platform, so they produce identical results under Windows, Linux and Mac. Today I finally found out how I get them working.

In this later post, I show you how to tweak BGFX so that your individual settings are there every time.

And in this new post, you find instructions on how to tweak BGFX in mame.ini - which is actually the preferred choice (you stay independent of frontend - and even platforms).

10 May 2016

Starting With MESS in QMC2

Since the merger of MESS into MAME with 0.162, you reach both systems out of QMC2. But using MESS requires further knowledge, which honestly speaking is very hard to retrieve. In this post I start to write down my knowledge I collected through a tedious trial-and-error phase. I am by far not at the end of my journey, so expect further updates here from time to time.

But what is it about MESS anyway?
Even more than with MAME, the systems that are emulated in MESS are fascinating just to look at. For example, if it comes to my very first home video system, the (in)famous Philips G7000, it is thrilling to look into this time - much more than actually playing these games. In fact, I only played G7000 because Arcades were not affordable for intense playing and my parents were not willing to buy me a cool Atari 2600 system ;-).
Munchkin - just like on my G7000 at home (click to enlarge)

Take Munchkin: It's fairly hard to play and medium nice, but there are no lives, so if you die the game is over. Compared to other consoles, this really sucked. Nice to see it again on screen after so many years, but certainly no candidate for extensive playing (which is true for nearly every G7000 game).

Setting up MESS within QMC2
- Hash Path: The MAME working directory contains a directory called hash - this is the home for the software lists that you load from out of QMC2. It turned out beneficial for me to specify the hash path within QMC2, so that these software lists load correctly. This can be done at the first start of QMC2 - last option HASH path, or later on in QMC2: Tools/Options/Emulator/Search Paths/Hash Path
- Software list ROMs: In QMC2, the only feasible way for me seems to place the folder containing the software list ROMs in the ROM folder next to the zip file. So if in the case of Philips G7000, the machine ROM odyssey2.zip is in the same folder like the directory odyssey2, which then contains the game ROMs. 

If everything is fine, QMC2 loads the MESS Software List correctly and you can start games from here:

Software List for Odyssey2/G7000 (click to enlarge)
Finding the ScrollLock Button on your Mac Keyboard
The Philips G7000 emulation is one of the trickier emulations - for some reason you must hit the ScrollLock Button in order to get into the MESS GUI and then, for example, exit the emulation. Without ScrollLock, you just can't get out of the emulation easily. This particularly messy if you are in fullscreen mode. So remember from now on: FN+Backspace is ScrollLock

Vital MESS Configuration Tipps (continuous list)
- I recommend that you check out these configuration tipps machine by machine. This means that you configure these settings in the machine-specific configuration of QMC2. This is where QMC2 really shines.
- Window Mode: in particular for new machines to explore; Configuration/Video/Window - Enabled
- Disable Autosave: Save states tend to drive these machines crazy, so disable them; Configuration/State playback/Autosave off















16 April 2016

Waitvsync and Audio Issues Resolved (Xevious and others)

Update April 2022: After finding a perfect configuration for flawless scrolling in MAME (see separate post), I update this waitvsync entry.

In the default configuration of MAME, the scrolling of some vertical shooters, such as the famous Xevious, tend to stutter or bleed. Lines to not scroll down smoothly from time to time. Here waitvsync helps a lot - especially if combined with -nothrottle, as explained in the other post.

23 January 2016

Basic Setup of MAME and QMC2 (Update September 2016)

Installing MAME

Go to my Introduction for download links of MAME for MacOSX.

Installing means extracting the zip File. Consider installing MAME in your User directory, but not the Applications directory. This allows easier updating and keeping separate versions of MAME next to each other.

Installing MAME Data

In its working directory, MAME by default provides for a predefined path structure for these data:



If you move some of these data to another place, there can be consequences. I experienced this with the BGFX configuration because I am having artwork at a different place (see separate post). So in general, it is probably the best thing to keep everything at that place. So when moving to a new version of MAME, be sure that you move these data as well.


Apart from these data, there are of course a lot of further MAME data, which you either place into the MAME working directory or to a different folder. Some of these folders have to be configured during first start of QMC2 (see below).

Installing QMC2

Go to my Introduction for download links of QMC2 for MacOSX and SDL2. QMC2 installs via a package. You may need to temporarily turn off the Mac Gate Keeper. SDL2 must be installed first.

If you want to compile QMC2 from source, look into this post.

During your first run of QMC2, you must link the frontend to the MAME executable, its directory and further specific directories of MAME Data. At a later stage, this can be found here: Tools/Options/Emulator/Global Configuration/Search Paths 


- directory of ROM files, the games
- HASH directory of MESS (see my MESS post)
- directory for Samples, sound effects for some games
- directory for Artworks, in-game graphics (see title screenshot)








The four paths mentioned are probably the most important ones for the basic setup, with them MAME should be workable. If MAME now does not work something is wrong with the executable, the ROM files or these paths.

The Business Case for QMC2

Although I did quite some experimenting with the built-in UI of MAME, which is actually nice (see this post), I returned to QMC2 again. It seems to me that QMC2 keeps your data in order when switching MAME versions. So I recommend that you take the extra mile and look into QMC2 as your graphical frontend.

First Basic Setup of MAME/QMC2 (Alphabetic Order)

Artwork: For activating the artwork as shown in the title, you need to consider the following:
Have MAME In Game Artwork available, e.g. by downloading from http://mrdo.mameworld.info/mame_artwork.php 
The MAME artpath in the Search paths as shown above, must point to the directory containing M.A.M.E. Artwork. WARNING: If your artpath is outside of the MAME working directory, be sure that all the artwork contained in the default MAME artpath is also copied to the other directory. Otherwise you run into deep troubles with BGFX, for example (as explained here).
Configure Crop vs No Crop: Although the artwork bezels are beautiful, I still prefer the actual game to be full screen. So I set crop to yes in the QMC2 setup: Tools/Options/Emulator/Artwork/Artwork crop -> Yes 
Change Crop vs No Crop in MAME live: in M.A.M.E. press Tab and to to Video Options, there choose between Full and Cropped, as shown below (freehand photos)
Full Size Artwork makes game screen much smaller
Cropped Artwork just fills the black space of the monitor, which I prefer


Autosave: When supported, autosaving freezes the machine at exit and resumes the machine when going in again. This is very handful because you skip the sometimes long boot times of the machines. However, now that MAME provides for a highscore plugin (see below), you no longer need Autosave as a workaround for missing highscores.
Enable Autosave in QMC2: Tools/Options/Emulator/Global Configuration/State playback/autosave on (1)
Change Autosave Directory in QMC2: Tools/Options/Emulator/Global Configuration/Output directories/state_directory
Migrating States? States are saved in the Sta directory of the M.A.M.E. working directory. If you move these directories to the working directory of your new M.A.M.E. binary, states sometimes continue to work. In case of MAME 172, however, it seems that none of the old states work (error: invalid state header), so again a new start with highscores.

Cheats: I hardly use cheats, but sometimes they are just helpful or I am just curious about existing cheats. There are two settings to configure in QMC2
Enable Cheats: Tools/Options/Emulator/Global Configuration/Miscellaneous/Cheats On (1)
Cheat Directory: Tools/Options/Emulator/Global Configuration/Search paths/cheatpath
Place the Cheats.7z file into that directory, and from now on, when pressing Tab in a game, you have the Cheat options available.
Note: Some NeoGeo ganes, such as Metal Slug 1 and 2, crash without warning when Cheats are enabled. Be sure to individually disable Cheats for such games. (Update October 2017: The crashes do no longer occur, at least since MAME 0.191, so it is safe to turn on cheats in both games)
Highscore: Starting with MAME 0.170, saving highscores via a LUA plugin became a serious contender. Now as I write this update as of MAME 0.177, the highscore plugin becomes quite stable and configurable in QMC2 as follows:

Options/Emulator/Miscellaneous/plugins - enabled
Options/Emulator/Miscellaneous/plugin - hiscore  
With these two options enabled, you should find your highscores in the hi directory of MAME recorded. The solution looks highly promising, until now all games recorded highscores properly. And these highscores also seem to be portable to future versions of MAME - so be sure to port the hi directory to a new MAME Version.

Windowed Mode: Especially during configuration, I prefer the Windowed Mode over Fullscreen, it just gives you another chance to exit the game if something goes wrong.
In QMC2: Tools/Options/Emulator/Global Configuration/Video/Window - Enabled
Fixed Resolution for Artwork: If you use in-game Artwork, you need to define a fixed window size, otherwise you would see no Artwork at startup of the game. Since I have only one monitor, I define resolution for all screens, and after some trials, 3000x1600 provides a nice result in my iMac - it's all about your screen resolution, so you must try out by yourself on other screens.
For some reason, this setting gives me even more background artwork than in Fullscreen:

More artwork in the window than in fullscreen (click to enlarge)











22 January 2016

Welcome, Mac Retrogamers!



MAME gives you the perfect retrogaming experience - also on your Mac 

Last update: 5 February 2021 (originally from January 2016)

Mac-specific documentation for MAME is (still) scarce. I tried to close this gap a bit by explaining my setup and other approaches/ideas in this blog. Although I have written this documentation for Macs, most of this documentation will help for other platforms as well.

As of February 2021, this blog has seen more than 82.000 visits since January 2016, certainly more than I ever expected. This keeps me updating the blog - and where it makes sense, I update the blog entries frequently in order to keep the blog a bit more consistent.

So in 2021, MAME on Macs is great and stable - both on Catalina and Big Sur.

Homebrew MAME? It is an interesting concept, however I do not really see the benefits from having these folders hidden in /usr/local. I am testing it from time to time.

My current setup
  • Hardware: iMac 27 (Late 2013), 3.5 GHz i7 with 32 GB RAM, 3 TB Fusion Drive and Nvidia TTX 780M 4 GB; MacBook Pro 13'' (early 2013) as a fallback station for enhanced testing
  • Software: MacOS Catalina 10.15, SDL 2.0.14
  • MAME: 0.228 (R0ni binary from here: http://sdlmame.lngn.net)
  • Frontend: Attract Mode 2.6.0 or the MAME internal UI or the great Negatron Frontend 
I also do some MAME on an Intel Mac mini 2018, but it performs poorly. Still everything runs nicely in MacOS Big Sur. Still waiting a bit to do the switch to Silicon ;-).

Basic homework prior to setting up MAME as a beginner
  1. Download SDL MAME for Machttp://sdlmame.lngn.net/
  2. Download and install SDL Runtime Libraryhttp://www.libsdl.org/download-2.0.php and put it into /Library/Frameworks
  3. Download a frontend, if needed, e.g. Attract Mode (http://attractmode.org) or  QMC2 Frontend for Machttp://qmc2.batcom-it.net/ or also Negatron 
  4. Have some ROMs - please do not ask me where to find them, unfortunately, the legal situation is blurry (to say the least), which is a shame. With many arcade machines dying over time time, Arcade manufacturers should love to see that there is a scene that preserves this work in the emulated sphere. Let's hope that emulation gets more acknowledgement from manufacturers and other rightholders for these incredible efforts.
  5. You might want to look for the following MAME Extras, which can be displayed in the relevant QMC2 tabs (Screenshots, Titles, Cabinet photos, Marquee photos, PCB Board photos (very very nerdy :-)
  6. If you do not shy away from text editors (you shoudln't), I clearly recommend Attract Mode - see my recent post as frontend. If you are willing to spend some time, it's simply the best experience you can get right now.
Comments are very welcome

I am writing this documentation from a non-coder perspective. If I should be on a wrong path in any case, please be so kind and post a note here.