27 January 2017

Attract Mode for OSX MAME - Setup Part 2

After successful completion of Part 1, there are many further opportunitites to tweak Attract Mode for MAME for your own needs. Here is a collection of useful hints for further fine tuning of the Attract Mode setup:
  • Configure the Attract Mode Intro Video
  • Configure history.dat to display within Attract Mode
  • Assign game-specific configurations for Attract Mode only
  • Other Emulators (WIP)
  • Including RetroArch Cores (WIP - huge!)
Here are the details:


1. Configure Intro Video: The OSX package of Attract Mode does not contain the intro video, and the Configuration does not provide for the full path settings. Follow these easy steps: Download the attract mode intro video from their website. Within the .attract folder, move it to the intro subfolder. In the Configuration, the full path must be set (which is missing at least in the OSX version). This is: $HOME/.attract/intro/intro.mp4 Do not care about the different video formats and leave it easy.

2. Configure history.dat (assuming that history.dat runs already in your current MAME setup): First the history.dat plugin must be enabled under Configure/Plugins, exit Attract Mode and open attract.cfg in the .attract folder in your favorite text editor. Srcoll down to the plugin History.dat section. Change the parameter for dat_path to the actual path of your history.dat file in your MAME configuration (as always: open a Terminal window and drag your history.dat file into it -> you get the full path). In these settings you must once trigger "Generate Index", which goes sufficiently fast. From now on, you can activate the game's history with keystroke H, and you can scroll up and down with your joypad - very nice.

Asteroids history in Attract Mode - click to enlarge
You may also assign a joypad button for toggling the history.dat display, but this can only be done manually in attract.cfg: Open it again in your text editor and look for the History.dat settings. Change param button from H to Joy0 Buttonxx (whereas xx is the key number -> which you should find out first via the Attract Mode Controls Menu on an empty entry (means: go for an empty entry and add an input, press the joypad button and you know what to insert).



My History Plugin section in attract.cfg:

plugin History.dat
enabled              yes
param                button H
param                dat_path $HOME/Games/mame/history.dat
param                generate_index 
param                index_clones No
param                rows 30
   

3. Assign specific configurations to one game: Here Attract Mode really shines for MAME! Although it's again text editor time, the results are very convincing so far.

Example - Metal Slug 1-3 crash without warning when Cheats are enabled. As shown in my example in Part 1, I have Cheats enabled by default, thus these three games need specific configurations to run with Cheats disabled. This is what to do:
  • Be sure to have a Hotkey enabled for Edit Game, as shown in Part 1 - in my case keystroke E
  • Head for Metal Slug 1 and press E, browse down to Custom Arguments - now include the entire modified arguments, in my case the default arguments without Cheat enabled:[romfilename] -video bgfx -bgfx_backend opengl -bgfx_screen_chains hlsl -plugin hiscore -resolution 3000x1600 -artwork_crop
  • That's it, from now on, Metal Slug 1 starts with these custom arguments and no longer crashes!
  • The even nicer part: After setting them up for the first time, these specific configuration files are very easily editable and portable under [$HOME]/.attract/romlists/mame/mslug.cfg - so from now on, you can easily edit the game also from your Finder in your text editor. You can of course also copy/paste the running config to another rom where you need the same configuration by just renaming the rom file name, e.g. mslug2.cfg. That really rocks.
4. Configuration of other Emulators: This can be tricky under MacOS because all Applications in the MacOS Application directory are actually folders -> you must open xxxxx.app with Right Click/Show Package Contents and identify the actual executable of the emulator package. Otherwise Attract Mode would not work. An example for a Quake MacOS application to follow here.

5. Running Retroarch Cores within Attract Mode: With the command line parameters of RetroArch explained here, you can launch any Libretro Core from within Attract Mode. For emulators other than MAME, the combination of Attract Mode and RetroArch is nearly unbeatable: Libretro cores within RetroArch are bleeding edge and e.g. Mednafen is much easier to handle than directly from the command line. Means: You configure your core from within RetroArch and run it then from Attract Mode as follows (example: Stella for the Atari 2600, stella.cfg, as located in .attract/emulators - you can also create this file from scratch here, and it will appear in Attract Mode, you only have to create a romset and configure the Display, and you are set):

# Generated by Attract-Mode v2.2.0-3
#
executable        
/Applications/RetroArch.app/Contents/MacOS/RetroArch
args         
-L /Applications/RetroArch.app/Contents/Resources/cores/stella_libretro.dylib "[romfilename]"
rompath              
/PATH TO YOUR ROMS/atari2600/
romext                  
.A26
artwork flyer           /PATH TO YOUR ROMS/atari2600/boxart
artwork marquee         /PATH TO YOUR ROMS/atari2600/marquee
artwork snap            /PATH TO YOUR ROMS/atari2600/snap
artwork wheel           /PATH TO YOUR ROMS/atari2600/wheel

Brief explanation:

  • The executable string must direct Attract Mode to the binary of the RetroArch.app folder.
  • The args string contains the Retroarch Cord under -L
  • The rompath string is self-explanatory (remember: open a Terminal window and drag the roms directory into it -> you have a pasteable rompath!)

Current limitation of RetroArch on Macs: For launching a game from the command line, RetroArch must start in Fullscreen Mode. Without Fullcreen Mode, the game only launches in the background. This sounds like a bug, not a feature.

2 comments:

  1. Thoroughly enjoy your tutorials and posts. Keep it coming!

    ReplyDelete

Any comments are welcome!