Skip to content
987123879113 edited this page May 4, 2024 · 19 revisions

Unofficial Bemani-focused fork of MAME. This is not meant to replace official MAME for general use. It includes a bunch of hacks to make playing Bemani games more comfortable, and/or implements new or experimental changes before I submit them to the official MAME repository. I do not guarantee compatibility with non-Bemani games or hardware.

Download

The builds provided here are meant to be extracted on top of a normal MAME installation. Download and install the latest version of MAME from https://mamedev.org/ and then extract the contents of the below build over top of the normal MAME installation.

Windows: https://nightly.link/987123879113/mame/workflows/ci-windows/bemani?status=completed
Linux: https://nightly.link/987123879113/mame/workflows/ci-linux/bemani?status=completed
MacOS: https://nightly.link/987123879113/mame/workflows/ci-macos/bemani?status=completed

Cheats

Various cheats I've made for MAME can be found in my mame_cheats repository. Download the XML files, drop them into the cheat folder for your MAME installation, and enable cheats in the mame.ini (or run with -cheat) to make the cheats work. When cheats are enabled you can toggle on/off the cheats using the Cheats menu when you press tab. The cheats allow for things such as unlocking all songs, autoplay, or enabling debug menus depending on the game.

System 573 audio offset

The System 573 digital I/O emulation has been completely rewritten and should be roughly sample accurate with real hardware now. Any audio offset issues will be because of your computer setup (see WASAPI setup below for Windows) or other issues that aren't related to the digital I/O board itself, or maybe just personal preference/not being used to Sys573 DDR timings.

If you still wish to use an audio offset to play DDR in MAME, use the ksys573_da_offset plugin to achieve the same audio offset functionality as the old Bemani fork. Drop it into the plugins folder and modify settings.json to your liking. Read the comments to figure out how to use the settings file. To enable the plugin, you must enable plugins in mame.ini and also plugin.ini, or run MAME with -plugins ksys573_da_offset. You should see a Plugin Options menu in the tab menu, and in that menu you should see a submenu named "System 573 Digital Audio Offset" which will show you the current configured offset when you open it. If you do not see any of that then you don't have the plugin enabled. See also: https://docs.mamedev.org/plugins/index.html

Dance Dance Revolution and beatmania IIDX I/O replacement hook via bemanitools

You can replace the I/O for System 573 Dance Dance Revolution and Twinkle beatmania IIDX games using bemanitools-mame-plugins. This requires additional setup via bemanitools so read the README carefully. This allows for better I/O for game controllers as well as using real IIDX arcade hardware (I/O + ticker + lights) or real DDR arcade hardware.

Audio latency

You will run into audio latency if you do not configure your MAME setup properly. The recommended setup is to use PortAudio with WASAPI (or whatever the lowest latency API is for your operating system).

To see what PortAudio APIs and devices are available for your machine, launch MAME with the following command: mame -w -sound portaudio -verbose. You will see a bunch of messages in the console like such:

Attempting load of mame.ini
...
PortAudio: API MME has 20 devices
PortAudio: MME: " - Input"
PortAudio: MME: "Microphone (3- USB Camera-B4.09"
PortAudio: MME: "Line (AVerMedia Live Gamer HD 2"
PortAudio: MME: "Digital Audio Interface (AVerMe"
PortAudio: MME: "Headset Microphone (Razer Krake"
...
PortAudio: MME: " - Output"
PortAudio: MME: "Headset Earphone (Razer Kraken "
PortAudio: MME: "Digital Audio (S/PDIF) (High De"
PortAudio: MME: "NX-EDG27 (NVIDIA High Definitio"
...
PortAudio: API Windows DirectSound has 20 devices
PortAudio: Windows DirectSound: "Primary Sound Capture Driver"
PortAudio: Windows DirectSound: "Headset Microphone (Razer Kraken 7.1 V2)"
PortAudio: Windows DirectSound: "Primary Sound Driver" (default)
PortAudio: Windows DirectSound: "Headset Earphone (Razer Kraken 7.1 V2)"
PortAudio: Windows DirectSound: "Digital Audio (S/PDIF) (High Definition Audio Device)"
PortAudio: Windows DirectSound: "NX-EDG27 (NVIDIA High Definition Audio)"
...
PortAudio: API Windows WASAPI has 18 devices
PortAudio: Windows WASAPI: "Headset Earphone (Razer Kraken 7.1 V2)"
PortAudio: Windows WASAPI: "Digital Audio (S/PDIF) (High Definition Audio Device)"
PortAudio: Windows WASAPI: "NX-EDG27 (NVIDIA High Definition Audio)"
PortAudio: Windows WASAPI: "Headset Microphone (Razer Kraken 7.1 V2)"
...
PortAudio: API Windows WDM-KS has 22 devices
PortAudio: Windows WDM-KS: "Output (NVIDIA High Definition Audio)"
PortAudio: Windows WDM-KS: "SPDIF Out (HD Audio SPDIF out)"
PortAudio: Windows WDM-KS: "Headset Microphone (Razer Kraken 7.1 V2)"
PortAudio: Windows WDM-KS: "Headset Earphone (Razer Kraken 7.1 V2)"
PortAudio: Windows WDM-KS: "Microphone (VDVAD Wave)"
PortAudio: Windows WDM-KS: "Speakers (VDVAD Wave)"
...
PortAudio: Sample rate is 48000 Hz, device output latency is 218.67 ms
PortAudio: Allowed additional buffering latency is 18.00 ms/864 frames

Here, the valid pa_device options are listed in quotation marks ("Output (NVIDIA High Definition Audio)", "SPDIF Out (HD Audio SPDIF out)", "Headset Microphone (Razer Kraken 7.1 V2)", etc).

The valid pa_api options are listed after "PortAudio:" ("MME", "Windows WDM-KS", "Windows DirectSound", "Windows WASAPI").

Not all devices will allow WASAPI so you must choose a valid pa_device and pa_api combination for your setup.

Once you've decided on a combination, you can specify the API and device like such: mame -w ddrextrm -sound portaudio -pa_api "Windows WASAPI" -pa_device "NX-EDG27 (NVIDIA High Definition Audio)".

You can additionally configure the pa_latency setting.

See the official MAME documentation for detailed explanations of pa_device, pa_api, and pa_latency.

You can also save the settings to your mame.ini so you do not need to specify the sound, pa_device, pa_api, and pa_latency on the command line like such:

#
# OSD SOUND OPTIONS
#
sound                     portaudio
audio_latency             0

#
# PORTAUDIO OPTIONS
#
pa_api                    "Windows WASAPI"
pa_device                 default
pa_latency                0.003334