Code:
StartGlobalUserFeatures(){
Log("StartGlobalUserFeatures - Starting")
Global systemName, romName
ProgramUltraStik360(systemName, romName)
if (systemName="Sega Naomi" romName="confmiss")
Run("DemulShooter.bat", "D:\Arcade\Demul\Demul 7a 221215\")
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")
ProgramUltraStik360("FrontEnd","Rom")
Log("StopGlobalUserFeatures - Ending")
}
; Use this function to define any code you want to run before Pause starts
StartPauseUserFeatures(){
Log("StartPauseUserFeatures - Starting")
ProgramUltraStik360("Pause","Rom")
Log("StartPauseUserFeatures - Ending")
}
; Use this function to define any code you may need to stop or clean up after Pause ends
StopPauseUserFeatures(){
Log("StopPauseUserFeatures - Starting")
Global systemName, romName
ProgramUltraStik360(systemName, romName)
Log("StopPauseUserFeatures - Ending")
}
ProgramUltraStik360(systemName, romName)
{
;SplitPath, A_LineFile, , iniPath ;should work, but doesn't!
iniPath :=A_ScriptDir . "\lib"
iniFile=%iniPath%\UltraStik 360 Programmer.ini
IfNotExist, %iniFile%
Log("UltraStik 360 Programmer ini file not found: " . iniFile . ". Please put the ""UltraStik 360 Programmer.ini"" file in the ""Rocket Launcher\lib"" folder.")
IniRead, UltraMapExe, %iniFile%, Settings, UltraMapExe, C:\Users\MCP\Desktop\Program Files\UltraMap\UltraMap.exe
IfNotExist, %UltraMapExe%
{
Log("UltraMap Script could not find Ultramap.exe not found: " . UltraMapExe . ". Please check path in the ini file. Exiting UltraMap Script.")
Return
}
SplitPath, UltraMapExe, , ugcPath
IniRead, ugcGlobalDefault, %iniFile%, Settings, ugcGlobalDefault
If (ugcGlobalDefault="ERROR")
{
ugcGlobalDefault=8-way
logText:=logText . "ugcGlobalDefault not found in ini file. Using 8-way as Global Default. "
}
IniRead, IsPerRom, %iniFile%, PerRomSystems, %systemName%
If (%IsPerRom%)
{
IniRead, ugc, %iniFile%, Roms, %romName%
If (ugc="ERROR")
{
IniRead, ugc, %iniFile%, Systems, %systemName%
If (ugc="ERROR")
{
ugc:= ugcGlobalDefault
logText:=logText . " System is " systemName . ", a system that uses a UGC file per rom. Rom is " . romName . ". No rom nor system UGC found in the ini file, using global default: " . ugc
}
Else
logText:=logText . " System is " systemName . ", a system that uses a UGC file per rom. Rom is " . romName . ". Rom UGC not found in the ini file, using system default: " . ugc
}
Else
logText:=logText . " System is " systemName . ", a system that uses a UGC file per rom. Rom is " . romName . ". Rom UGC found in the ini file: " . ugc
}
Else
{
IniRead, ugc, %iniFile%, Systems, %systemName%
If (ugc="ERROR")
{
ugc:= ugcGlobalDefault
logText:=logText . " System is " systemName . ", a system that uses the same UGC file for all roms. System UGC not found in ini file, using global default: " . ugc
}
Else
logText:=logText . " System is " systemName . ", a system that uses the same UGC file for all roms. System UGC found in ini file: " . ugc
}
IfNotExist, %ugcPath%\%ugc%.ugc
{
Log("UltraStik 360 Programmer- UGC file not found: " . ugcPath . "\" . ugc . ".ugc. Exiting UltraMap Script. " . logText)
Return
}
Run, %UltraMapExe% %ugcPath%\%ugc%.ugc /logerrors %ugcPath%\UltraMapLog.log
Log("UltraStik 360 Programmer loaded """ . ugc . ".ugc"". " . logText)
}