Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Simple UltraMap script for HyperLaunch  (Read 2600 times)

0 Members and 1 Guest are viewing this topic.

byancey

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 35
  • Last login:October 07, 2023, 03:11:17 pm
  • I want to build my own arcade controls!
Simple UltraMap script for HyperLaunch
« on: December 31, 2014, 08:30:52 pm »
I spent quite a bit of time trying to figure out the best way to load rom-specific UltraStick game configuration files from with HyperSpin/Hyperlaunch.  I realize that LEDBlinky can handle this for you, but given that I have no LEDs, it seemed like overkill just to load config files...especially considering the license fee.  It's probably worth the cash if you actually need to drive LEDs...but a bit steep just to load a config file for you.  I also looked into HyperMap, but ran into some issues with the way it renames HyperLaunch and loads HyperMap in it's place.

In the end, I decided to simply update the HyperLaunch AutoHotkey scripts that are intended for user customizations, and this ended up being more straight forward than I had imagined.  Thought I'd share the results.

The solution involves adding a new function to "HyperSpin\HyperLaunch\Lib\User Functions.ahk" and then calling that function from within the existing StartGlobalUserFeatures and StopGlobalUserFeatures.   Here's are the updates to the code I made:

Code: [Select]
StartGlobalUserFeatures(){
    Log("StartGlobalUserFeatures - Starting")

   ; ADD THE LINES BETWEEN THESE COMMENTS
    Global romName
    LoadUltraStickConfig(romName)
   ; ADD THE LINES BETWEEN THESE COMMENTS
   
    Log("StartGlobalUserFeatures - Ending")
}

; Use this function to define any code you may need to stop or clean up in every module on exit
StopGlobalUserFeatures(){
    Log("StopGlobalUserFeatures - Starting")

   ; ADD THE LINES BETWEEN THESE COMMENTS
    LoadUltraStickConfig("frontend")
   ; ADD THE LINES BETWEEN THESE COMMENTS

    Log("StopGlobalUserFeatures - Ending")
}

; ADD THIS FUNCTION.  UPDATE UltraMap variable to point to the location where you've installed UltraMap.
LoadUltraStickConfig(romName){
    Global emupath

    ; Absolute path to UltraMap executable
    UltraMap = C:\HyperSpin\Utilities\UltraMap\UltraMap.exe

    ; Define ini file location based on emu path
    filename = %emupath%\UltraStick\game_map.ini
    ; Read game config from ini file based on rom name
    IniRead, ugc, %filename%, games, %romName%, analog
    ; Call UltraMap to load the config
    Run, %UltraMap% %emupath%\UltraStick\%ugc%.ugc
}

The LoadUltraStickConfig function looks for an ini file located in an UltraStick folder in your emulator path (In my case this was "Hyperspin/Emulators/Mame/v0.154/UltraStick", but you should adjust this to whatever you've told HyperLaunch your emulator path is).  This ini file is nothing more than the map between the ROM names, and a set of UltraMap game configuration files (which, in turn, specify the maps to load).  The set of ultramap game configuration files (ugc files) are located in the same directory as the game_map.ini file.

I've attached a zip file attachment to this post which includes the contents of my UltraStick directory for MAME.  Simply place the contents of the zip file in an UltraStick folder where your emulator is located and you should be good to go.  There's a pretty good set of roms already listed in my game_map.ini, but update as needed.  Should be obvious how to do this by looking at the file.

I haven't tried this with any other emulators, but in theory, just drop an UltraStick directory containing the game_map.ini and all of the referenced ugc files, and it should work.

Of the various options out there, this approach ended up being the most straight forward for my needs.  Hopefully someone else will find this information useful.

Thanks!
« Last Edit: December 31, 2014, 08:41:12 pm by byancey »