Jump to content

Adding save / load capabilities to your hyperlaunch script


lmsilva

Recommended Posts

Dear all,

I'm using an older version of Hyperlaunch (the one that works using an hyperlaunch.ahk script, instead of the newer, fancy, module based hyperlaunch :o)) but I couldn't upgrade, so I've been making some changes to it to add save / load support.

Because there might be others interested in this feature, I wanted to post a quick thread to explain how I did it:

- edit your hyperlaunch.ahk script and add add these two variables:

; these key combinations save or load the emulator state in emulators that support it!
saveEmulatorKey = 1 & 3
loadEmulatorKey = 1 & 4

(you can leave them on the top, right after the "exitEmulatorKey" configuration)

- and then extend your emulator launcher config like this:

else if (systemName = "Sega Genesis" && executable = "Fusion.exe")
{
   hideDesktop()
   Hotkey, %exitEmulatorKey%, CloseProcess
[b]    
   Hotkey, %saveEmulatorKey%, SaveEmulator
   Hotkey, %loadEmulatorKey%, LoadEmulator
[/b]    
   Run, %Executable% "%romPath%%romName%%romExtension%" -auto -gen -fullscreen, %EmuPath%, Hide UseErrorLevel
   Process, WaitClose, fusion.exe
}

- finally, add the following two functions at the end of your hyperlaunch.ahk script:

SaveEmulator:
if (systemName = "Sega SG1000" || systemName = "Sega 32X" || systemName = "Sega CD" || systemName = "Sega Game Gear" || systemName = "Sega Genesis" || systemName = "Sega Master System")
{
	Send {F5}
}
else if (systemName = "Super Nintendo Entertainment System")
{
	Send {'}
}
else if (systemName = "Nintendo Entertainment System" || systemName = "Famicom Disk System")
{
	Send {F5}
}
else if (systemName = "Gameboy" || systemName = "Gameboy Color")
{
	Send {F6}
}
else if (systemName = "Gameboy Advance")
{
	Send s
}
else if (systemName = "Nintendo 64")
{
	Send {F5}
}
return

LoadEmulator:
if (systemName = "Sega SG1000" || systemName = "Sega 32X" || systemName = "Sega CD" || systemName = "Sega Game Gear" || systemName = "Sega Genesis" || systemName = "Sega Master System")
{
	Send {F8}
}
else if (systemName = "Super Nintendo Entertainment System")
{
	Send {;}
}
else if (systemName = "Nintendo Entertainment System" || systemName = "Famicom Disk System")
{
	Send {F7}
}
else if (systemName = "Gameboy" || systemName = "Gameboy Color")
{
	Send {F5}
}
else if (systemName = "Gameboy Advance")
{
	Send l
}
else if (systemName = "Nintendo 64")
{
	Send {F7}
}
return

For the most part, this is what you need to do :)

I then also went to my MAME specific emulators and changed their load / save shortcuts to match the same keys I've defined in hyperlaunch, so MAME is basically taking care of the save and load by itself (not through hyperlaunch).

Anyway, hope this can be of use to someone! :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...