02 April 2022

FINALLY: perfect scrolling in MacMAME by configuration!

๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ Time to celebrate. After so many attempts, I finally stumbled across the perfect configuration for flawless scrolling in MacMAME. ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ๐Ÿ‘พ

Update 16 July 2022: It seems to me that with displays higher than 60 Hz, the nothrottle option would not work, as it results in speeds far above 100%. At least that was the result of my testing with a MacBook Pro M1. With such monitors, you would not need this hack anyway as waitvsync alone already provides for perfect results.

Showcase Moon Patrol - watch on your system how it scrolls sideways 

Until now, the usage of waitvsync, which is rather important for avoiding bleeding, caused stuttering in MacOS. As the MAME documentation explains:

On macOS, -waitvsync does not block; instead the most recent completely drawn frame will be displayed at vblank. This means that if an emulated system has a higher framerate than your host display, emulated frames will be dropped periodically resulting in motion judder.

That's why waitvsync is disabled by default. Now, very surprisingly, nothrottle combined with waitvsync comes to the rescue! With this MacMAME emulation is close to perfect for me! No 144 Hz monitor or Adaptive Sync required.

Which means that for perfect scrolling in MacOS, just these two configuration changes in mame.ini are required:

# CORE PERFORMANCE OPTIONS
throttle                  0 (default 1)

# OSD VIDEO OPTIONS
waitvsync              1 (default 0)

The two options depend on each other because waitvsync holds the game exactly in sync with the screen. Without waitvsync enabled, the game runs on max processor speed with -nothrottle.

This solution works for me for both the Metal and the OpenGL backend of the BGFX shader.

This solution comes at a cost, which I am willing to pay:

1. Remove audio crackling per game: You might have to take some additional game-specific attempts to remove audio crackling, as I explained in this blog entry (and I keep the information in this separate post and will continue updating there).

2. Some games run faster: Moon Patrol, for example, runs at 105% with this configuration. That's ok for me, as the scrolling is so much better.

Advanced tip: start the game from the terminal, and you get the exact speed of the game. If you then set the speed of the game to this value, here 1.057, you can even turn throttle off again (if you want to throttle for other reasons).

With this configuration, scrolling in MAME is now smoother than in RetroArch/FinalBurn Neo.  I will continue testing, but so far all works perfectly.

No comments:

Post a Comment

Any comments are welcome!