I’ve been a long-time user of Mamewah, but Maximus Arcade’s (MA) interface really is sweet. There is a big difference between a graphics designer and a…well… graphics designer wannabe. The latter is me. Maximus leans towards simplicity while Mamewah leans towards configurability. There are many limitations that MA has at the mo – but did I mention the interface is really sweet. As with Mamewah – it can be controlled by the arcade cabinets control panel (joysticks and buttons) Mamewah updates are few and far between – MA is getting lots.
The IPAC is a great tool to replace keyboard and joystick hacks. For those with terrible soldering skills like mine, the IPAC is a neat and versatile solution. Yes it costs a bit – but you won’t look back. I seem to be singing the praises for Ultimarc all the time – but it is another really well made product
The IPAC
Another option is the KeyWiz from GroovyGear. But I digress. I also use Ultimarc’s Ultrastik 360. With this combination of the IPAC and Ultrastik I have complete programmatic control of all inputs and movements. The Ultrastik is connected via USB as is recognised as a joystick rather than keyboard mappings. The Ultrastik however also provides an Output control mode that can be connected to an IPAC allowing the IPAC to register movements as keys. So games that don’t support joysticks are no problem.
So here is the scenario that can be problematic. MA as a frontend launches a game, say a DOS game or ZX Spectrum game that has unique key requirements (e.g. ‘q’ is up, ‘a’ is down, and ‘o’ and ‘p’ are left and right respectively while ’5′ starts the game). So when MA launches the game you need to tell the IPAC and Ultrastik what mappings to use. This is only possible with a batch file. And when the game is completed to reset the mappings so that MA movements work.
Now lets take an example – you use Spectaculator for the ZX Spectrum – this is a tried and tested solution. You can apply these issues to many other emulators but they are especially relevant in DOS games that are ‘batched’ into MA.
Some issues exist:
- Spectaculator does not have a neat exit (Alt-F, x)
- MA does not run post emulator batch lines if you use its exit hook
- Spectaculator has no key remapping capabilities
- Lots of games mappings are not yet known
EmuZWin is another Spectrum emulator that can use the ‘Esc’ key to exit. With this, reprogramming the IPAC worked fine – the EmuZWin program exits and the batch file runs through its commands to the end, during which the IPAC is reset to base MAME settings and then the screen returns to the MA interface. Post emulator batch lines to reset IPAC ran successfully. the But Spectaculator has better emulation support…so back to Spectaculator…
Using the MA exit hook with the same batch file for Spectaculator as I did for EmuZWin – this does not happen – MA does not run any post emulator batch lines. I tried all permutations that MA provides – and batch file options e.g. using for example:
\>start Spectaculator.exe
instead of:
\>Spectaculator.exe
results in the whole batch script running through past the emulator (the emulator runs, but post-emulator commands are run before the emulator exits). This is bad. Also fiddling with the options to force closing other applications made no difference.
My setup:
- 1xIPAC (and WinIPAC)
- 2xUltrastiks (and UltraMap software)
- AutoHotKey
Enter AutoHotKey … AutoHotKey is a free and powerful utility that enables you to map a key to a set of events, tasks, key presses etc on a PC. It can for example manipulate the state of a window to hide it or make it active. It’s been used with the Johnny5 CP viewer succesfully. To use it, download it, install it and create a small file with an AHK extension in Notepad, that maps a key to a specific function. Initially I told AutoHotKey to map the ‘Numeric Keypad 0′ button to ‘Alt-F, X’ to simulate using the menu in Spectaculator on exit.
Numpad0:: ;when zero on the numeric keypad is pressed…
Send !f{x} ;send an ‘Alt-F’, followed by ‘x’ keypress
sleep 3000 ;take a short breather while Spectaculator exits and the IPAC and Ultrastik are reprogrammed
Send {ESC down} ;press the Escape key
sleep 1500 ; for 1.5 seconds – making sure MA knows its time to resurface
Send {Esc up} ;enough escape
return ;you’re done
This worked, but it looked messy. The menu flashes briefly. So I found an alternative that is neat. AutoHotKey has a close Window command.
Numpad1:: ;when numeric keypad 1 pressed
SetTitleMatchMode 2 ;set the accuracy of the title of the window to easy (otherwise it has to be exact!!)
WinClose Spectaculator ;close Spectaculator – in task bar usually shows as xxxx.tza – Spectaculator
sleep 3000 ; wait for 3 seconds – the batch file is reprogramming the IPAC and Ultrastik to generic settings
Send {ESC down} ; Escape key is pressed for 1.5 seconds
sleep 1500 ; this I have found to be a robut way to get MA to restart
Send {Esc up}
return
So if you write a simple batch file to launch Spectaculator (change the launch in MA configuration to point to the .bat file rather than Spectaculator).
Here is the associated batch file that programs the IPAC and Ultrastik with the correct game using the %1 variable.
The trickery with the batch file is simply to avoid any prompts by the Ultrastik or IPAC when a mapping file is not found.
- Default mapping file for emulator is stored for Ultrastik/IPAC
- Default mapping file for emulator is overridden if a customized game mapping exists (/y parameter overrides any prompts)
- Program Ultrastik and IPAC with the default file
- Run the emulator (until AutoHotKey button pressed whereupon it continues with the script)
- Replace the default mapping file for emulator with the generic mapping file – emulator default is now reset
- Reprogram the IPAC and Ultrastik with Maximus Arcade friendly mappings – MAME keys is good default for IPAC
- Return to MA
The batch file:
rem ————————————-
rem —— 1 IPAC programming ———
rem ————————————-
e:
cd\Emulators\Computers\ZXSpectrum\ipac
copy /y %~n1.ipc default.ipc
e:\frontend\WINIPAC.exe e:\Emulators\Computers\ZXSpectrum\ipac\default.ipc
rem ————————————-
rem —— 2 Ultrastik programming —–
rem ————————————-
cd\emulators\computers\zxspectrum\ultrastik
copy /y %~n1.ugc default.ugc
e:\frontend\ultrastik\ultramap.exe e:\emulators\computers\zxspectrum\ultrastik\default.ugc
rem ————————————-
rem —– 3 Run EmuZWin ————–
rem ————————————-
cd\emulators\computers\zx\gamepack\
E:\Emulators\Computers\ZX\spectaculator.exe %~n1.zip
rem ————————————-
rem —– 4 Reset generic defaults ——
rem ————————————-
cd\Emulators\Computers\ZXSpectrum\ipac\
copy /y generic.ipc default.ipc
cd\emulators\computers\zxspectrum\ultrastik\
copy /y generic.ugc default.ugc
rem ————————————-
rem —– 5 reprogram to defaults ——-
rem ————————————-
e:\frontend\WINIPAC.exe E:\frontend\ipac\default.ipc
cd\frontend\ultrastik\
ultramap.exe default.ugc
Overall – this solutions works really well. It’s reliable and flexible. It still would be better if there were some way of using ‘ini’ mapping files in either IPAC or Spectaculator. Right now the IPAC has a great programming tool in WinIPAC to reprogram itself, but ini files provide so much more control. EmuZWin provides a keyboard mapping option – but its keyboard mapping file, like the IPAC’s is not readible as an ini file. Good news is the Ultrastik’s ugc format is readable in notepad. If you have any similar issues with any frontend – consider using AutoHotKey.
Some things to do:
- Use AutoHotKey to show a picture of the Control Panel keys. AutoHotKey should be able to easily pause the game (Spectaculator uses the Pause key to pause), and then load the graphic. Any keybutton will return the user to the game – a 2 second or so wait and Spectaculator is unpaused. Should be a breeze.
- Should make the AutoHotKey launch and exit from the batch file, so that the specific routine it follows is game or emulator specific. I might want to write an exit routine for ‘Leisure Suit Larry’ for example, I’d have an AHK file for each batch PC game and for each emulator that needs it. Emulators allow for a consistent way to close game inside their window. PC games do not have an emulator container envelope, so would need unique AHK files. Doable methinks.
- Try and hide the Spectaculator launch screen and menu bar that opens up briefly when its started
Update!!!
A post was made in the Maximus forum with a grand little update to this routine. Instead of my file juggling to check for the missing file, there is a simple batch file command – IF EXIST. So much simpler!!! I need to update my batch file with this and will post this as soon as I get a moments peace from work.