Jump to content

WinKawaks and Hyperspin Exiting Problem


turnip2

Recommended Posts

Posted

The attached .ahk script works fine for all common emulators except WinKawaks in that when you press 'Esc' it confirms the action before either exiting or returning to the game...

Except this Kawak has stupid settings like you have to pause before quitting, even Alt+F4!!??

Any suggestions to crash the whole FE back to desktop w/o Ctrl+Alt+Deleting it? Or can someone configure the script so it works please?

/**Modified by Travis Stickel May 20101

/** 
* HyperLaunch Unofficial
*
*  
*/


#SingleInstance force      ;Prevent multiple instances
#WinActivateForce
SetTitleMatchMode 2
RText =                       ;necessary declare

;------------------------------------------------------------------------------;
;                                 MAIN SETTINGS                                ;
;------------------------------------------------------------------------------;

;[uNIVERSAL HOTKEYS]            ;SEPERATE MULTIPLE KEYS WITH &(ampersand) up to 2 keys.
exitScriptKey   = q & s         ;Secret hotkey(s) to exit script if needed
                               ;Not to be confused with exit emulator keys


exitEmulatorKey = Esc           ;This key/key combo will close any emulators
                               ;that do not have normal closing methods.

saving =  true             ;Turn the saving option on/off (true/{blank})

toggleCursorKey = t             ;hotkey(s) to show or hide cursor if needed
                               ;when hideCursor below is true

;[MOUSE CURSOR]
hideCursor      =          ;Automatically hide cursor during script
                               ;WARNING: Make sure ALL your emu's are running fine
                               ;          before setting this to true as a precaution.*

;[WINDOWS]

hideTaskbar     =          ;Hide the windows taskbar when running emu's.
                               ;WARNING: Make sure ALL your emu's are running fine
                               ;         before setting this to true as a precaution.*



/*
   *:If for some weird reason the script hangs follow these steps to get back to normal.
     1. If an emulator hangs up or cant load your game then first try to exit the emu
        by pressing your Emulator exit hotkey above.
     2. If your emu exited but your mouse cursor is gone use your cursor toggle hotkey.   
     3. Next try to exit the script by pressing your Exit Script Hotkey above. This 
        will also bring back your cursor and taskbar is they are set to true.
*/







;*******************************************************************************
;*                  EDIT BELOW THIS POINT AT YOUR OWN RISK                     *
;*******************************************************************************   

;------------------------------------------------------------------------------;
;                       GET PARAMATERS AND SET HOTKEYS                         ;
;------------------------------------------------------------------------------;

;CHECKING FOR 2 PARAMS, IF NOT THEN EXIT
if 0 < 2
{
   MsgBox Usage: HyperLaunch.ahk/exe "System Name" "Rom Name"
   ExitApp
}

systemName = %1%
romName = %2%



if (hideCursor = "true")
{
 Hotkey, %toggleCursorKey%, ToggleCursor
 SystemCursor("Off")
}

WinClose, cmd.exe
;------------------------------------------------------------------------------;
;                              GET AND CHECK PATHS                             ;
;------------------------------------------------------------------------------;
GoSub, CheckINI
IniRead, iniEmuPath, %A_ScriptDir%\Settings\%systemName%.ini, exe info, path
emuPath := GetFullName(iniEmuPath)
IniRead, iniRomPath, %A_ScriptDir%\Settings\%systemName%.ini, exe info, rompath
romPath := GetFullName(iniRomPath)
IniRead, executable, %A_ScriptDir%\Settings\%systemName%.ini, exe info, exe
IniRead, romExtensions, %A_ScriptDir%\Settings\%systemName%.ini, exe info, romextension

romExtension =
GoSub, CheckPaths

;------------------------------------------------------------------------------;
;                                  RUN SYSTEM                                  ;
;------------------------------------------------------------------------------;


;***********************************ADD-ONS*********************************
Loop, Addons\*.*,2
  {
     addonpath = %A_LoopFileFullPath%
     Loop, %addonpath%\*.exe
        {
           RunWait, %A_LoopFileName% "%romname%" %emupath% "%executable%", %A_LoopFileDir% ;passing parameters too

        }
  }

;************OTHER*****************
hideDesktop()
if saving
{

Process, Close, Hypersplash.exe
GuiControl,Text,RText, Do you want to load the previously saved state? Quitkey for no, Enter or single Joykey for yes.

Sleep 600
  loop
  {
     if getkeystate("Enter")
     {
        loadstate = true
        break
     }
     if getkeystate("joy1") 
     {
        if not getkeystate("joy2")
        {
             if not getkeystate("joy3") 
                 if not getkeystate("joy4")
                 {
                    loadstate = true
                    break
                 }
        }
     }

     if getkeystate("2joy1") 
     {
        if not getkeystate("2joy2")
        {
             if not getkeystate("2joy3") 
                 if not getkeystate("2joy4")
                 {
                    loadstate = true   
                    break
                 }
        }
     }

     if getkeystate("3joy1") 
     {
        if not getkeystate("3joy2")
        {
             if not getkeystate("3joy3") 
                 if not getkeystate("3joy4")
                 {
                    loadstate = true
                    break
                 }
        }
     }

     if getkeystate("4joy1") 
     {
        if not getkeystate("4joy2")
        {
             if not getkeystate("4joy3") 
                 if not getkeystate("4joy4")
                 {
                    loadstate = true
                    break
                 }
        }
     }      
     if getkeystate(exitemulatorkey)
     {
        break
     }
     if getkeystate("joy4")
     { 
        if getkeystate("joy3") 
        {
           if getkeystate("joy2") 
           {
              if getkeystate("joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("2joy4")
     { 
        if getkeystate("2joy3") 
        {
           if getkeystate("2joy2") 
           {
              if getkeystate("2joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("3joy4")
     { 
        if getkeystate("3joy3") 
        {
           if getkeystate("3joy2") 
           {
              if getkeystate("3joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("4joy4")
     { 
        if getkeystate("4joy3") 
        {
           if getkeystate("4joy2") 
           {
              if getkeystate("4joy1")
              {         
                 break
              }
           }
        }
     }
  }
if loadstate
{
  if executable = jnes.exe
        sendkeys = {f7}
  if executable = epsxe.exe
        sendkeys = {f3}
  if executable = fusion.exe
        sendkeys = {f8}
  if executable = mame32p.exe
        sendkeys = {f7}
  if executable = project64.exe
        sendkeys = {f7}
  if executable = snes9x.exe
        sendkeys = {f1}
  if executable = visualboyadvance.exe
        sendkeys = {f1}
  if executable = yabause.exe
        sendkeys = {f1}
}

}
Hotkey, %exitEmulatorKey%, CloseProcess, Off
hotkey, joy4, CloseProcess, Off
hotkey, 2joy4, CloseProcess, Off
hotkey, 3joy4, CloseProcess, Off
hotkey, 4joy4, CloseProcess, Off
gosub hotkeys
;***********************************SEGA MODEL 2*********************************

if (systemName = "Sega Model 2")
{
   if(executable = "emulator_multicpu.exe" || executable = "emulator.exe" )
   {   
     Run, %executable% %romName%, %emuPath%, Hide UseErrorLevel
     DetectHiddenWindows, on
     WinWait, Model 2
     WinShow   
   }
}

;***************************************************************
;Older Atomiswave
;Older Sega Naomi
;Required - Settings.ini: http://www.hyperspin-fe.com/forum/sh...5&postcount=54

else if (executable = "awdemul.exe")
{
Blockinput on
SetDefaultMouseSpeed, 0
MouseGetPos X, Y 
MouseMove %A_ScreenWidth%,-%A_ScreenHeight% 
Gui +AlwaysOnTop -Caption +ToolWindow 
Gui, color, 0
Gui Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, HSHIDE 
IniRead, num_down, %emupath%settings.ini, %RomName%, Down_Count, 0
IniRead, system, %emupath%settings.ini, %RomName%, System, Atomiswave
Run, "%emupath%%executable%", Hide UseErrorLevel
winactivate %executable%
sleep, 1000 ; wait a moment for emulator to load
send, {AltDown}{AltUP}
send, {down}
sleep, 500
if (system = "Atomiswave") 
{
send, {Down}
send, {Down}
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy 
SetDefaultMouseSpeed, 2
Blockinput off
}
Else if (system = "Naomi") 
{
send, {Down}
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy 
SetDefaultMouseSpeed, 2
Blockinput off
}
}


;***************************************************************
;Sega Naomi Demul 0.5.5
;Atomiswave
;Required - Settings.ini: http://www.hyperspin-fe.com/forum/sh...5&postcount=54

else if (executable = "demul.exe")
{

Blockinput on
SetDefaultMouseSpeed, 0
MouseGetPos X, Y 
MouseMove %A_ScreenWidth%,-%A_ScreenHeight% 
Gui +AlwaysOnTop -Caption +ToolWindow 
Gui, color, 0
Gui Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, HSHIDE 
IniRead, num_down, %emupath%settings.ini, %RomName%, Down_Count, 0
IniRead, system, %emupath%settings.ini, %RomName%, System, Atomiswave
Run, "%emupath%%executable%", Hide UseErrorLevel
winactivate %executable%
sleep, 1000 ; wait a moment for emulator to load
send, {AltDown}{AltUP}
send, {down}
sleep, 500
if (system = "Atomiswave") 
{
send, {Down}
send, {Down}
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy 
SetDefaultMouseSpeed, 2
Blockinput off
}
if (system = "Atomiswave Load Decrypted") 
{
send, {Down}
send, {Down}
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy 
Blockinput off
}
Else if (system = "Naomi") 
{
send, {Down}
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy 
SetDefaultMouseSpeed, 2
Blockinput off
}
Else if (system = "Naomi Load Decrypted") 
{
send, {Down}
send, {ENTER}
send, {Tab}
send, {Tab}
send, {Tab}
send, {ENTER}
send, {shiftdown}{Tab}{Shiftup}
send, {shiftdown}{Tab}{Shiftup}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy 
SetDefaultMouseSpeed, 2
Blockinput off
}
Else if (system = "Hikaru") 
{
send, {Down}
send, {Down}
send, {Down}
send, {ENTER}
send, {Tab}
send, {Tab}
send, {Tab}
send, {ENTER}
send, {shiftdown}{Tab}{Shiftup}
send, {shiftdown}{Tab}{Shiftup}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy
SetDefaultMouseSpeed, 2
Blockinput off
}
Else if (system = "Hikaru Load Decrypted") 
{
send, {Down}
send, {Down}
send, {Down}
send, {ENTER}
send, {Tab}
send, {Tab}
send, {Tab}
send, {ENTER}
send, {shiftdown}{Tab}{Shiftup}
send, {shiftdown}{Tab}{Shiftup}
send, {DOWN %num_down%} ; send down keystroke to select rom
send, {ENTER}
sleep, 10000 ; sleep for 10 seconds before pressing f8 key
send, {F8} ; Go full Screen
sleep, 1000
Gui Destroy
SetDefaultMouseSpeed, 2
Blockinput off
}
}

;**************************************************************
;ScummVM

;Required - ScummVMLauncher.exe: http://www.hyperspin-fe.com/forum/sh...1&postcount=31

else if (executable = "ScummVMLauncher.exe")
{
Gui +AlwaysOnTop -Caption +ToolWindow 
Gui, color, 0
Gui Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, HSHIDE
Run, %emupath%%executable%
Runwait, %rompath%%romname%%romextension%
sleep, 2000
Gui Destroy 
}

;*************************************WinKawaks**********************
;Required - Settings.ini: http://www.hyperspin-fe.com/forum/sh...21&postcount=4 
else if (executable = "Winkawaks.exe")
{
Blockinput on
SetDefaultMouseSpeed, 0
MouseGetPos X, Y 
MouseMove %A_ScreenWidth%,-%A_ScreenHeight% 
Gui +AlwaysOnTop -Caption +ToolWindow 
Gui, color, 0
Gui Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, HSHIDE 
IniRead, num_down, %emupath%settings.ini, %RomName%, Down_Count, 0
IniRead, system, %emupath%settings.ini, %RomName%, System, kawaks
Run, "%emupath%%executable%", Hide UseErrorLevel
winactivate %executable%
sleep, 1000 ; wait a moment for emulator to load
send, {AltDown}{AltUP}
send, {down}
sleep, 500
if (system = "kawaks") 
{
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
;send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 1000 ; sleep for 1 seconds before pressing alt-enter key
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen
sleep, 2500 ; sleep 2.5 seconds before blackscreen disappears
Gui Destroy ; kill the blackscreen
SetDefaultMouseSpeed, 2
Blockinput off
}
if (system = "CPS-1") 
{
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
;send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 1000 ; sleep for 1 seconds before pressing alt-enter key
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen
sleep, 2500 ; sleep 2.5 seconds before blackscreen disappears
Gui Destroy ; kill the blackscreen
SetDefaultMouseSpeed, 2
Blockinput off
}
if (system = "CPS-2") 
{
send, {ENTER}
send, {DOWN %num_down%} ; send down keystroke to select rom
;send, {ALTDOWN}{ENTER}{ALTUP}
send, {ENTER}
sleep, 1000 ; sleep for 1 seconds before pressing alt-enter key
send, {ALTDOWN}{ENTER}{ALTUP} ; Go full Screen
sleep, 2500 ; sleep 2.5 seconds before blackscreen disappears
Gui Destroy ; kill the blackscreen
SetDefaultMouseSpeed, 2
Blockinput off
}
}

;********************************************************************
;SEGA Naomi - Makaron

else if (executable = "naomi.exe")
{
IniRead, Xram, %emupath%settings.ini, %RomName%, Xram, 2PH
IniRead, Region, %emupath%settings.ini, %RomName%, Region, 0
If (Xram = "1PH")
{
filecopy, %emupath%1PH_xram.bin, %emupath%xram.bin, 1
IniWrite, %Region%, %emupath%NAOMI.ini, Settings, Region
}
Else if(Xram = "1PV")
{
filecopy, %emupath%1PV_xram.bin, %emupath%xram.bin, 1
IniWrite, %Region%, %emupath%NAOMI.ini, Settings, Region
}
Else if(Xram = "2PV")
{
filecopy, %emupath%2PV_xram.bin, %emupath%xram.bin, 1
IniWrite, %Region%, %emupath%NAOMI.ini, Settings, Region
}
Else
{
filecopy, %emupath%2PH_xram.bin, %emupath%xram.bin, 1
IniWrite, %Region%, %emupath%NAOMI.ini, Settings, Region
}
Run, "%emupath%%executable%" "%romPath%%romName%%romExtension%", %emuPath%, Hide UseErrorLevel
}

;******************************************************
;Touhou

else if (executable = "touhou.exe") ;just make a dummy file with this name
{
   Run, %emupath%%executable%
   Process, Close, %executable%
   Runwait, %rompath%%romname%%romextension%
}



;********************************************************************
;PC Engine
;Turbo Duo

else if (executable = "pce.exe")
{
RunWait, %DAEMONTOOLS% -mount 0`,"%romPath%%romName%%romExtension%"
RunWait,%emuPath%%executable% syscard3.pce ,UseErrorLevel
Run, %DAEMONTOOLS% -unmount 0,UseErrorLevel
}

;******************************************************************
;AAE
else if (executable = "aae.exe")
{
Run, %executable% "%romName%", %emuPath%, Hide UseErrorLevel
}
;********************************************
;N64

else if (executable = "mupen64.exe")
{
   Run, %Executable% -f -nogui -g "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel
}

;*****************************************************************
;Jukebox systems

else if (executable = "Silverjuke.exe")
{
Hotkey, %exitEmulatorKey%, CloseJuke
Run, %emuPath%%executable% --kiosk, Hide UseErrorLevel
}

else if (executable = "SKJukebox.exe")
{
Run, %emuPath%%executable%, Hide UseErrorLevel
}

;********************************************************************
;MSX2
else if (executable = "blueMSX.exe")
{
Run, %Executable% "%romPath%%romName%%romExtension%" -auto -fullscreen, %EmuPath%, Hide UseErrorLevel
}

;*****************************************************************  
;NEC PC-98

else if (executable = "anex86.exe")
{
Run, "%EmuPath%%Executable%",,Hide UseErrorLevel
sleep,100
SendInput, {tab 11}
sleep,100
clipboard=
clipboard=%romPath%%romName%%romExtension%
ClipWait
Sleep,100
Send,^v
Sleep,100
send, {tab 8}
send, {enter}
}

;********************************************************************
;SAM COUPE

else if (executable = "SimCoupe.exe")
{
Run, %executable% -disk"%romName%", %emuPath%, Hide UseErrorLevel
}

;*********************************************************************
;Commodore Amiga 
else if (executable = "winuaeloader.exe")
{
Run, %Executable% -mode whdload -game"%romPath%%romName%%romExtension%" , %EmuPath%, Hide UseErrorLevel
}

;*******************************************************************
;Commodore CD32
else if (executable = "winuae.exe")
{
RunWait, %DAEMONTOOLS% -mount 0`,"%romPath%%romName%%romExtension%"
cd32params = -f "C:\HyperSpin\Emulators\Commodore CD32\Configurations\cd32.uae" -s use_gui=no -s gfx_fullscreen_amiga=true
RunWait,%emuPath%%executable% %cd32params% ,UseErrorLevel
Run, %DAEMONTOOLS% -unmount 0,UseErrorLevel
}

;************************************************************ 
;Fujitsu FM

else if (executable = "Unz.exe")
{
RunWait, %DAEMONTOOLS%-mount0`,"%romPath%%romName%%romExtension%"
RunWait,%emuPath%%executable% -fs,UseErrorLevel
Run, %DAEMONTOOLS% -unmount 0,UseErrorLevel
}

;*********************************************************************
;PC Engine FX

else if (executable = "pcfx.exe")
{
RunWait, %DAEMONTOOLS% -mount 0`,"%romPath%%romName%%romExtension%"
Run,%emuPath%%executable% -cd,UseErrorLevel
}

;***************************************************************
;Sony Playstation 2

else if (executable = "pcsx2.exe")
{
Run, %Executable% "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel
sleep, 1000
send, {alt down}{enter}{alt up}
}

;*********************************************************************
;SEGA SATURN

else if (executable = "SSF.exe")
{
RunWait, %DAEMONTOOLS% -mount 0`,"%romPath%%romName%%romExtension%"
Run, %executable% , %emuPath%, UseErrorLevel
}

;**********************************************************************
;Nintendo Gamecube
;NINTENDO WII

else if (executable = "Dolphin.exe")
{
Run, %executable% -e "%romPath%%romName%%romExtension%", %emuPath%, UseErrorLevel
}

;*********************************************************************
;Wonderswan
;Wonderswan Color

else if (executable = "Oswan.exe")
{
Run, "%EmuPath%%Executable%" -fs "%romPath%%romName%%romExtension%", Hide UseErrorLevel
}

;********************************************************************
;Nintendo DS

else if (executable = "NO$GBA_u2.exe")
{
Run, %Executable% "%romPath%%romName%%romExtension%" -auto -sms -fullscreen, %EmuPath%, Hide UseErrorLevel

}

;**********************************************************************
;ATARI ST

else if (executable = "Steem.exe")
{
Run, "C:\HyperSpin\Emulators\Atari ST\strun.bat"
Run, %Executable% "%romPath%%romName%%romExtension%"FULLSCREEN NONOTIFYINIT, %EmuPath%, Hide UseErrorLevel
}

;*********************************************************************
;ATARI Jaguar - Project Tempest Emulator

else if (executable = "PT.exe")
{
Run, "%EmuPath%%Executable%",,Hide UseErrorLevel
DetectHiddenWindows, on
WinShow, Project Tempest
WinWait, Project Tempest
WinWaitActive, Project Tempest
SendInput, {ALTDOWN}f{ALTUP}{ENTER}
IfWinNotActive, Open ROM File, Common Places Host W
WinActivate, Open ROM File, Common Places Host W
WinWaitActive, Open ROM File, Common Places Host W
clipboard=
clipboard=%romPath%%romName%%romExtension%
ClipWait
Sleep,100
Send,^v
Sleep,100
send, {ENTER}
WinWait, Project Tempest
IfWinNotActive, Project Tempest, , WinActivate, Project Tempest,
WinWaitActive, Project Tempest,
}

;********************************************************************
;Colecovision

else if (systemName = "Colecovision" && (executable = "messpp.exe" || executable = "mess.exe"))
{
Run, %executable% coleco -cart "%romPath%%romName%%romExtension%" -skip_gameinfo -nowindow -nonewui, %emuPath%, Hide UseErrorLevel
}

;****************************************************************
;FUTURE PINBALL

else if (executable = "Future Pinball.exe")
{
   Run, %executable% /open "%romPath%%romName%%romExtension%" /play /exit, %emuPath%, UseErrorLevel

}

;*****************************************************************
;PC Games

else if (executable = "PCLauncher.exe" ) ;just make a dummy file with this name
{
   Run, %rompath%%romname%%romextension%
} 

;*****************************************************************
;SEGA DREAMCAST

else if (executable = "nullDC.exe")
{
   Run, %Executable% -config nulldc:Emulator.AutoStart=1 -config ImageReader:DefaultImage="%romPath%%romName%%romExtension%" -config ImageReader:loadDefaultImage=1 -config drkpvr:Fullscreen.Enabled=1, %EmuPath%, Hide UseErrorLevel    
}


;***************************************************************
;Sony Playstation

else if (executable = "epsxe.exe")
{
   Run, %Executable%  -nogui -loadbin "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel
}

;*****************************************************************
;DOS GAMES (& applications)

else if (executable = "dosbox.exe")
{	
   Loop, %rompath%%romname%%romextension% 
      dosboxexe = %A_LoopFileShortPath%    
   stringleft, driveletter, rompath, 1
   Run, %executable% -c "mount %driveletter% %driveletter%:\" -c "%dosboxexe%" , %emuPath%, Hide UseErrorLevel
}

;********************************************************************
;SEGA SATURN

else if (executable = "yabause.exe")
{
   Run, %Executable% -f -i "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel


}

;*******************************************************************
;ATARI 5200

else if (systemName = "Atari 5200" && (executable = "messpp.exe"|| executable = "mess.exe"))

{	
   Run, %executable% a5200 -cart "%romPath%%romName%%romExtension%" -skip_gameinfo -nowindow -nonewui, %emuPath%, Hide UseErrorLevel
}

;*******************************************************************
;DAPHNE

else if (executable = "daphne.exe")
{
   daphneParams = vldp -fullscreen -x 640 -y 480 -nohwaccel -framefile
   frameFilePath = %romPath%%romName%%romExtension%
   Run, %executable% %romName% %daphneParams% %frameFilePath%, %emuPath%, UseErrorLevel  
}


;******************************************************************
;Panasonic 3DO - freedo version 2
;http://www.hyperspin-fe.com/forum/showthread.php?p=71530

else if (executable = "FreeDO2.exe")
{
SetWorkingDir, %emuPath%
Hotkey, %exitEmulatorKey%, CloseProcess
Gui +AlwaysOnTop -Caption +ToolWindow 
Gui, color, 0
Gui Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, 
FileDelete, %emupath%config.xml
FileCopy, %emupath%restore.xml, %emupath%config.xml
Run, "%EmuPath%%Executable%", Hide UseErrorLevel
sleep, 500  
WinWait, FreeDO v.2.1 Alpha ~ FPS 60`, INTFPS 60, 
IfWinNotActive, FreeDO v.2.1 Alpha ~ FPS 60`, INTFPS 60, , WinActivate, FreeDO v.2.1 Alpha ~ FPS 60`, INTFPS 60, 
WinWaitActive, FreeDO v.2.1 Alpha ~ FPS 60`, INTFPS 60, 
Send, {ALTDOWN}{ALTUP}{up}{ENTER} ;{ENTER}
WinWait, Open, 
IfWinNotActive, Open, , WinActivate, Open, 
WinWaitActive, Open, 
sleep, 500
clipboard=
clipboard=%romPath%%romName%%romExtension%
ClipWait
Sleep,100
Send,^v
Sleep,100
send, {ENTER}
Sleep, 100
send, {F11}
sleep,500
send, {F9}
sleep, 2000
Gui Destroy 
Process, WaitClose, %executable%
WinActivate, HyperSpin
}

;******************************************************************
;Panasonic 3DO - freedo version 1

else if (executable = "FreeDO.exe")
{
   Run, "%EmuPath%%Executable%",,Hide UseErrorLevel
   DetectHiddenWindows, on
   WinShow, FreeDO
   WinWait, FreeDO
   ControlSend, , {F4}, FreeDO 
   WinWaitActive, FreeDO
   SendInput, {ALTDOWN}f{ALTUP}{ENTER}
   IfWinNotActive, Open, Common Places Host W
   WinActivate, Open, Common Places Host W
   WinWaitActive, Open, Common Places Host W
   clipboard=
   clipboard=%romPath%%romName%%romExtension%
   ClipWait
   Sleep,100
   Send,^v
   Sleep,100
   send, {ENTER}
   WinWait, FreeDO
   IfWinNotActive, FreeDO, , WinActivate, FreeDO,
   WinWaitActive, FreeDO,
   SendInput, {ALTDOWN}c{ALTUP}{ENTER}{ENTER}
}

;*************************************************************
;SEGA Master System
;Sega Genesis
;Sega Game Gear
;Sega CD
;Sega 32X

else if (executable = "Fusion.exe")
{
if systemname = "Sega Master System"
	{
	Fparams = -sms
	}
if systemName = "Sega 32X" 
	{
	Fparams = -32X
	}
if systemName = "Sega CD"
	{
	Fparams = -scd
	}
if systemName = "Sega Game Gear" 
	{
	Fparams = -sms
	}
if systemName = "Sega Genesis"  
	{
	Fparams = -gen
	}
   Run, %Executable% "%romPath%%romName%%romExtension%" -auto "%Fparams%" -fullscreen, %EmuPath%, Hide UseErrorLevel
}
;********************************************************************
;CPS3 CAPCOM PLAY SYSTEM 3

else if(executable = "emulator.exe" )
{
Run, %executable% %romName%, %emuPath%, Hide UseErrorLevel
DetectHiddenWindows, on
WinWait, Capcom Play System 3 Emulator
WinShow
}


;***************************************************************
;Sony Playstation
;enhanced for multiple discs by travis stickel - firefoxian
;just put all roms with the same extension in one folder
;the first rom should just have the title
;the rest should be the title then " CD2", " CD3", ETC.
;like Lunar.bin, Lunar CD2.bin, Lunar CD3.bin and so on.
;then you have the hotkeys 1 - 5 to switch back an forth when the game requests!

else if (executable = "psxfin.exe")
{
   Run, %Executable% -f "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel
   Hotkey, 1, Disc1
   Hotkey, 2, Disc2
   Hotkey, 3, Disc3
   Hotkey, 4, Disc4
   Hotkey, 5, Disc5
   Process, WaitClose, %executable%

Disc1:
   disc = 
   gosub, ChangePsxDisc
   Return

Disc2:
   disc := " CD2"
   gosub, ChangePsxDisc
   Return

Disc3:
   disc := " CD3"
   gosub, ChangePsxDisc
   Return

Disc4:
   disc := " CD4"
   gosub, ChangePsxDisc
   Return

Disc5:
   disc := " CD5"
   gosub, ChangePsxDisc
   Return

ChangePsxDisc:
IfExist, %romPath%%romName%\%RomName%%disc%%extensiononly%
   {
       Process, Exist, %Executable%
       SendInput, {ALTDOWN}{ENTER}{ALTUP}
       WinWaitActive, ahk_pid %Errorlevel%
       Send, !f{ENTER}
       clipboard=%romPath%%romName%\%RomName%%disc%%extensiononly%
  Clipwait
       Sleep,3000
       Send,^v
       Sleep,100
       Send, {ENTER}
       WinWaitActive, ahk_pid %Errorlevel%
       SendInput, {ALTDOWN}{ENTER}{ALTUP}
   }
Return
}
;********************************************
;Super Nintendo Entertainment System

else if (executable = "zsnesw.exe")
{
   SetKeyDelay, 250
   Run, %Executable% "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel
}
;******************************************************************
;TurboGrafx 16 (PC-FX, PC Engine FX )
;Gameboy (Color)
;GameBoy Advance
;SuperGrafx
;Neo Geo Pocket (Color)
;WonderSwan (Color)
;NES 
;Atari Lynx

else if (executable = "mednafen.exe")
{
   Run, "%EmuPath%%Executable%" "%romPath%%romName%%romExtension%" -fs 1,, UseErrorLevel
}

;********************************************************************
;Zinc

else if (executable = "zinc.exe")
{
   Run, %Executable% %romName%, %EmuPath%, Hide UseErrorLevel
}
;********************FAILSAFE************************
;LIST OF EMULATORS THAT WORK WITH THIS SCRIPT:
;NEORAINE32.EXE - NEO GEO CD, HANDY - ATARI LYNX, BGB - GAMEBOY, GAMBETTE_QT.EXE - GAME BOY, FCEUX - NES, NESTERJ - NES, ROCKNES - NES, VIRTUANES - NES, MEKAW - MULTIPLE SEGA SYSTEMS, VBSMS+ - MULTIPLE SEGA SYSTEMS, BSNES - SNES, SNES9K (2 VERSIONS)- SNES, SNEESW - SNES, NOSTALGIA - INTELLIVISION, OOTAKE - TURBOGRAFX 16, BLISS - INTELLIVISION, STELLA - ATARI 2600, MAME - ARCADE, MAMEUI32 & MAMEUI64 - ARCADE, JNES - NES, SNES9X - SNES, VISUALBOYADVANCE - GAMEBOY & ADVANCE, NEOPOP - NEO GEO POCKET COLOR, PROJECT64 - N64, FREEDOWRAPPER - 3DO

else if (0=0)
{


   Run, %Executable% "%romPath%%romName%%romExtension%", %EmuPath%, Hide UseErrorLevel

;fix for programs that dont use actual full screen mode
  if (executable = "visualboyadvance.exe")
     {
        Sleep 2000
        Process, Exist, %Executable%
        WinSet, AlwaysOnTop, On, ahk_pid %Errorlevel%
        WinSet, Top,, ahk_pid %Errorlevel%
        WinActivate, ahk_pid %Errorlevel%
     }
}

else
{

   MsgBox,48,Error,%systemName% is an invalid System Name or %executable% isnt supported yet - possible complete failure,6
}

sleep 2000

Process, Close, Hypersplash.exe
send %sendkeys%
Process, WaitClose, %Executable%

;------------------------------------------------------------------------------;
;                                KILL COMMANDS                                 ;
;------------------------------------------------------------------------------;
;************PROBABLY DO NOT NEED TO EDIT THIS AREA*************

/*
Most emu's can be closed with CloseProcess when using a 2 key combo, if not set a custom
close.
*/
HotKeys:
Hotkey, %exitEmulatorKey%, Toggle
hotkey, joy4, Toggle
hotkey, 2joy4, Toggle
hotkey, 3joy4, Toggle
hotkey, 4joy4, Toggle
return

CloseProcess:
DetectHiddenWindows, on
gosub hotkeys ;off
;checks if player trying to quit using controller buttons 1-4
  loop
  {
     if getkeystate(exitemulatorkey) 
        break 
     sleep 100
     if getkeystate("joy4")
     { 
        if getkeystate("joy3") 
        {
           if getkeystate("joy2") 
           {
              if getkeystate("joy1")
              {         
                 sleep 500 ;wait to see if still pressing keys
                 if getkeystate("joy4")
                 { 
                    if getkeystate("joy3") 
                    {
                       if getkeystate("joy2") 
                       {
                          if getkeystate("joy1")
                          {         
                             break
                          }
                       }
                    }
                 }
              }
           }
        }
     }

     if getkeystate("2joy4")
     { 
        if getkeystate("2joy3") 
        {
           if getkeystate("2joy2") 
           {
              if getkeystate("2joy1")
              {         
                 sleep 500
                 if getkeystate("2joy4")
                 { 
                    if getkeystate("2joy3") 
                    {
                       if getkeystate("2joy2") 
                       {
                          if getkeystate("2joy1")
                          {         
                             break
                          }
                       }
                    }
                 }
              }
           }
        }
     }

     if getkeystate("3joy4")
     { 
        if getkeystate("3joy3") 
        {
           if getkeystate("3joy2") 
           {
              if getkeystate("3joy1")
              {         
                 sleep 500
                 if getkeystate("3joy4")
                 { 
                    if getkeystate("3joy3") 
                    {
                       if getkeystate("3joy2") 
                       {
                          if getkeystate("3joy1")
                          {         
                             break
                          }
                       }
                    }
                 }
              }
           }
        }
     }

     if getkeystate("4joy4")
     { 
        if getkeystate("4joy3") 
        {
           if getkeystate("4joy2") 
           {
              if getkeystate("4joy1")
              {         
                 sleep 500
                 if getkeystate("4joy4")
                 { 
                    if getkeystate("4joy3") 
                    {
                       if getkeystate("4joy2") 
                       {
                          if getkeystate("4joy1")
                          {         
                             break
                          }
                       }
                    }
                 }
              }
           }
        }
     }
     gosub hotkeys ;on
     return
  }
;see if player really wants to quit
  send {altdown}{enter}{altup}
  if executable = "freedo.exe"
     send {f4}
  GuiControl,Text,RText, Do you really want to quit? Quitkey for yes, Enter or single Joykey for no.
  WinShow, BlackScreen
  WinActivate, BlackScreen
  ;Winminimize, %executable%
  sleep 600
  loop
  {
     if getkeystate("Enter")
     {
        continueplay = true
        break
     }
     if getkeystate("joy1") 
     {
        if not getkeystate("joy2")
        {
             if not getkeystate("joy3") 
                 if not getkeystate("joy4")
                 {
                    continueplay = true
                    break
                 }
        }
     }

     if getkeystate("2joy1") 
     {
        if not getkeystate("2joy2")
        {
             if not getkeystate("2joy3") 
                 if not getkeystate("2joy4")
                 {
                    continueplay = true
                    break
                 }
        }
     }

     if getkeystate("3joy1") 
     {
        if not getkeystate("3joy2")
        {
             if not getkeystate("3joy3") 
                 if not getkeystate("3joy4")
                 {
                    continueplay = true
                    break
                 }
        }
     }

     if getkeystate("4joy1") 
     {
        if not getkeystate("4joy2")
        {
             if not getkeystate("4joy3") 
                 if not getkeystate("4joy4")
                 {
                    continueplay = true
                    break
                 }
        }
     }

     if getkeystate(exitemulatorkey)
        break
     if getkeystate("joy4")
     { 
        if getkeystate("joy3") 
        {
           if getkeystate("joy2") 
           {
              if getkeystate("joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("2joy4")
     { 
        if getkeystate("2joy3") 
        {
           if getkeystate("2joy2") 
           {
              if getkeystate("2joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("3joy4")
     { 
        if getkeystate("3joy3") 
        {
           if getkeystate("3joy2") 
           {
              if getkeystate("3joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("4joy4")
     { 
        if getkeystate("4joy3") 
        {
           if getkeystate("4joy2") 
           {
              if getkeystate("4joy1")
              {         
                 break
              }
           }
        }
     }
  }
  if ContinuePlay
  {
           Process, exist, %executable%
           ;Winmaximize, ahk_pid %errorlevel%
           Winactivate, ahk_pid %errorlevel%
           Sleep 250
           send {altdown}{enter}{altup}
           if executable = "freedo.exe"
              send {f4}
           ContinuePlay = 
           gosub hotkeys
           return
  }


;ask if you want to save state
if saving
{

  GuiControl,Text,RText, Do you want to save state? Quitkey for no, Enter or single Joykey for yes.
  Sleep 600
  loop
  {
     if getkeystate("Enter")
     {
        savestate = true
        break
     }
     if getkeystate("joy1") 
     {
        if not getkeystate("joy2")
        {
             if not getkeystate("joy3") 
                 if not getkeystate("joy4")
                 {
                    savestate = true
                    break
                 }
        }
     }

     if getkeystate("2joy1") 
     {
        if not getkeystate("2joy2")
        {
             if not getkeystate("2joy3") 
                 if not getkeystate("2joy4")
                 {
                    savestate = true   
                    break
                 }
        }
     }

     if getkeystate("3joy1") 
     {
        if not getkeystate("3joy2")
        {
             if not getkeystate("3joy3") 
                 if not getkeystate("3joy4")
                 {
                    savestate = true
                    break
                 }
        }
     }

     if getkeystate("4joy1") 
     {
        if not getkeystate("4joy2")
        {
             if not getkeystate("4joy3") 
                 if not getkeystate("4joy4")
                 {
                    savestate = true
                    break
                 }
        }
     }      
     if getkeystate(exitemulatorkey)
     {
        break
     }
     if getkeystate("joy4")
     { 
        if getkeystate("joy3") 
        {
           if getkeystate("joy2") 
           {
              if getkeystate("joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("2joy4")
     { 
        if getkeystate("2joy3") 
        {
           if getkeystate("2joy2") 
           {
              if getkeystate("2joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("3joy4")
     { 
        if getkeystate("3joy3") 
        {
           if getkeystate("3joy2") 
           {
              if getkeystate("3joy1")
              {         
                 break
              }
           }
        }
     }

     if getkeystate("4joy4")
     { 
        if getkeystate("4joy3") 
        {
           if getkeystate("4joy2") 
           {
              if getkeystate("4joy1")
              {         
                 break
              }
           }
        }
     }
  }

if savestate
{
  Process, exist, %executable%
  WinActivate, ahk_pid %errorlevel%
  Winwaitactive, ahk_pid %errorlevel%
  if executable = jnes.exe
     send {f5}
  if executable = epsxe.exe
     send {f1}
  if executable = fusion.exe
     send {f5}
  if executable = mame32p.exe
     send {shiftdown}{f7}{shiftup}
  if executable = project64.exe
     send {f5}
  if executable = snes9x.exe
     send {shiftdown}{f1}{shiftup}
  if executable = visualboyadvance.exe
     send {shiftdown}{f1}{shiftdown}
  if executable = yabause.exe
     send {shiftdown}{f1}{shiftdown}
  sleep 400
}

}



;go ahead and kill program/emulator
ifexist, hypersplash.exe 
  Run, Hypersplash.exe
WinShow, BlackScreen
Process, Exist, %Executable%
WinHide, ahk_pid %Errorlevel%
Winclose, ahk_pid %Errorlevel%
WinActivate, BlackScreen
Sleep 1000
;for emus that won't close normally
ControlSend, , {Esc}, ahk_pid %Errorlevel%
Process, Exist, %Executable%
WinKill, ahk_pid %Errorlevel%

Sleep 3000
Process, WaitClose, %Executable%
Loop, Addons\*.*,2 ;close running addons
  {
     addonpath = %A_LoopFileFullPath%
     Loop, %addonpath%\*.exe
        {
              Process, Exist, %A_LoopFileName% 
              Winclose, ahk_pid %Errorlevel%
        }
  }

ExitScript:
Process, Exist, Hyperspin.exe
WinShow, ahk_pid %Errorlevel%
Process, Close, Hypersplash.exe
Process, Exist, Hyperspin.exe
WinActivate, ahk_pid %Errorlevel%
WinWaitActive, ahk_pid %Errorlevel%
SystemCursor("On")
ExitApp

OnExit, ExitScript
return







;------------------------------------------------------------------------------;
;                                 REST OF SCRIPT                               ;
;------------------------------------------------------------------------------;
;************PROBABLY DO NOT NEED TO EDIT THIS AREA*************



SystemCursor(OnOff=1)   ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
{
   static AndMask, XorMask, $, h_cursor
       ,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
       , b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13   ; blank cursors
       , h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13   ; handles of default cursors
   if (OnOff = "Init" or OnOff = "I" or $ = "")       ; init when requested or at first call
   {
       $ = h                                          ; active default cursors
       VarSetCapacity( h_cursor,4444, 1 )
       VarSetCapacity( AndMask, 32*4, 0xFF )
       VarSetCapacity( XorMask, 32*4, 0 )
       system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650
       StringSplit c, system_cursors, `,
       Loop %c0%
       {
           h_cursor   := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
           h%A_Index% := DllCall( "CopyImage",  "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
           b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
               , "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
       }
   }
   if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
       $ = b  ; use blank cursors
   else
       $ = h  ; use the saved cursors

   Loop %c0%
   {
       h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
       DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
   }
}
ToggleCursor:
 SystemCursor("Toggle")
return

IniRead(Filename, Section, Key, Default = "") { 
  FileRead, text, *t %Filename% 
  text = `n%text%`n 
  StringTrimLeft, text, text, InStr(text, "`n[" . Section . "]`n") 
  Loop, 8 { 
     sp := sp . " " 
     StringReplace, text, text, %Key%%sp%=, %Key%= 
     If ErrorLevel 
        Break 
  } 
  start := InStr(text, "`n" . Key . "=") 
  If !start 
     Return, Default 
  start += StrLen(Key) + 2 
  StringMid, Value, text, start, InStr(text, "`n", false, start) - start 
  Return, Value 
}

;Get Full Path from Relative Path
GetFullName( fn ) {
  static buf, i
  if !i
     i := VarSetCapacity(buf, 512)
  DllCall("GetFullPathNameA", "str", fn, "uint", 512, "str", buf, "str*", 0)
  return buf
}

;CREATE BLACK BACKGROUND w/please wait
hideDesktop(){
   Gui, Destroy
   WinHide ahk_class Shell_TrayWnd
   guiheight:=A_ScreenHeight/9*4
   Gui, +toolwindow -Caption
   Gui, Color, black
   Gui, Font, S40 CWhite, Verdana
   Gui, Add, Text, vRText Wrap y%guiheight% W%A_ScreenWidth% H%A_ScreenHeight%  Center,  
   Ifnotexist, hypersplash.exe
   {
      Gui, +AlwaysOnTop
      GuiControl,Text,RText, Please Wait    
   }Else{
      Run, Hypersplash.exe
   }
   Gui, Show, Maximize, BlackScreen

   Process, Exist, Hyperspin.exe
   Winhide, ahk_pid %Errorlevel%
   WinActivate BlackScreen
   Sleep 2000
}

CheckINI:
 IfNotExist, %A_ScriptDir%\HyperSpin.exe
 {
   MsgBox,48,Error, Must be in same directory as HyperSpin.exe,6
   Goto ExitScript 
 }
 IfNotExist, %A_ScriptDir%\Settings\%systemName%.ini
 {
   MsgBox,48,Error,Cannot Find %A_ScriptDir%\Settings\%systemName%.ini,6
   Goto ExitScript 
 }
return

CheckPaths:
 romFound = 
 StringRight, emuPathBackSlash, EmuPath, 1
 StringRight, romPathBackSlash, RomPath, 1

 If (emuPathBackSlash != "\" || romPathBackSlash != "\")
 {
   MsgBox,48,Error, Make sure your paths contains a backslash on the end ,6
   Goto ExitScript
 }
 If (executable = "") 
 {
   MsgBox,48,Error, Missing executable in %systemName%.ini ,6
   Goto ExitScript  
 }
 If (romPath = "") 
 {
   MsgBox,48,Error, Missing rom path in %systemName%.ini ,6
   Goto ExitScript  
 }
 If (emuPath = "") 
 {
   MsgBox,48,Error, Missing emulator path in %systemName%.ini ,6
   Goto ExitScript  
 }
 IfNotExist, %EmuPath%%Executable%
 {
   MsgBox,48,Error,Cannot Find %EmuPath%%Executable%,6
   Goto ExitScript 
 }
 if(systemName != "zinc")  
 { 
   If (romExtensions = "") 
     {
       MsgBox,48,Error, Missing rom extension in %systemName%.ini ,6
       Goto ExitScript  
     }
   Loop, parse, romExtensions, `,
   { 
     inputVar = %A_LoopField%
     StringLeft, charToCheck, inputVar, 1
     If(charToCheck = ".")
     {
       MsgBox,48,Error, Make sure your rom extensions do not contain a ".",6
       Goto ExitScript
     }
     IfExist %RomPath%%RomName%.%A_LoopField%
     { 
       romExtension = .%A_LoopField%
       romFound = true
       break
     }else{
        IfExist %RomPath%%RomName%\%RomName%.%A_LoopField%
        { 
          romExtension = \%RomName%.%A_LoopField%
          romFound = true
          break
        }else{

     romFound = false
       }
  romFound = false
     }
   }
 }
 if (romFound = "false")
 {
   if(systemName != "daphne"){
     MsgBox,48,Error,Cannot find Rom - %RomPath%%RomName% with any provided extension,6
     Goto ExitScript
   }else{
     MsgBox,48,Error,Cannot find Daphne framefile - %RomPath%%RomName% with any provided extension,6
     Goto ExitScript
   }
 }
return
--------------------------------------------------------------------------------

Posted

That script for winkawaks only works with winkawaks v1.6 and neogeo roms unless you modify the settings to load CPS-1 and CPS-2 roms (which is a big chore, lots of roms to add)

I always had clean shutdown with that script and this newer one

(for all winkawaks versions and all roms)

here:

http://www.hyperspin-fe.com/forum/showpost.php?p=53049&postcount=60

maybe it will shutdown better for you.

Settings.ini no longer required.

Posted

okay looking good thanks but it crashes by 'kawaks has stopped responding' when i exit with the 'esc' key and the loading screen and HS crash too obviously....

How do I stop this?

Also how do I remap the Esc key to say Alt+F4? Is it simply that in the code?

Posted

ill explain better- when i press the universal esc key to exit, it loads the loading screen and freezees as the kawaks is still running in the background just paused..

Posted

now...

;*************************************Winkawaks**************************************

else if (systemName = "Neo Geo" && executable = "winkawaks.exe")

{

Hotkey, %exitEmulatorKey%, CloseProcess

Runwait, "%EmuPath%%executable%" %romName% -fullscreen, Hide UseErrorLevel

}

it escapes back to the loading screen shows both do youo want to exit/ save screens but i have to alt+f4 the loading screen to get back to HS else winkawaks wont shut down???

Posted

I dont know about the "do youo want to exit/ save screens " I think that is specific to firefoxians Hyperlaunch.

Im away from my test setup (so I cant test this yet)

You may have to play with "return" (either remove it completly or place above the orange bracket "}")

cant remember gettin too old

;*************************************Winkawaks*** ***********************************
else if (systemName = "Neo Geo" && executable = "winkawaks.exe")
{
Hotkey, %exitEmulatorKey%, CloseProcess
Runwait, "%EmuPath%%executable%" %romName% -fullscreen, Hide UseErrorLevel
[color=black]Process, waitclose, %executable%[/color]
[color=darkorange]GetKeyState, State, %exitEmulatorKey% , P[/color]
[color=darkorange]if State = D[/color]
[color=darkorange]{[/color]
[color=darkorange]send, {laltdown}f{laltup} [/color][color=black];this pauses winkawaks[/color]
[color=black][color=#ff8c00][color=black];[/color]send, {enter} [/color];this also pauses winkawaks (your choice)[/color]
[color=#ff8c00]send, {lalt}{F4} [/color][color=black];this exits winkawaks (only after pause)[/color]
[color=#ff8c00]}[/color]
[color=darkorange]return[/color]
WinActivate, HyperSpin ;remove if needed
}

Posted

all looks good thanks! but when i exit winkawaks still crashes or appears to as the windows warning box comes up- this ruins the "arcade" effect! is there any way to stop it? a different version maybe? again thanks for your help

Posted

I tested the Official HyperLaunch script and the winkawaks script from here:

http://www.hyperspin-fe.com/forum/showpost.php?p=53049&postcount=60

and havent been able to recreate the crash or error with winkawaks versions 1.60 or 1.61

I have not tested the script on post #6 or winkawaks version 1.62

later today maybe or after cal extreme.

Just a shot in the dark for ideas.

-make sure everthing is setup in winkawaks prior to running in hyperspin

-play with the display settings in winkawaks

crashes or appears to as the windows warning box comes up

is the following the crash or error\warning message?

do youo want to exit/ save screens

If so,

-test either script with the Official Hyperlaunch that comes with HyperSpin.

Posted

GREAT WORK!

I've just resorted to the default script and have added the loading back in and the exiting script as above. All is fine now thank you.

btw there is no 'return'

  • 1 month later...
Posted

Sorry i set up Meka for colecovision, it works great when i run it from HS but i see than the action buttoms have some delay..so i cant really play coz i try to jump and it jumps 1sec later... what could it be??? i run meka outside HS and the action buttoms works fine

  • 3 years later...
Posted

WinKawaks simply cannot be closed from fullscreen mode, it crashes every time you bring it out. So I'm going to have to change the module to prevent true fullscreen mode from being enabled and use a fake fullscreen mode, I can do that tonight. Or you can turn on bezel support and this will run the emu in windowed mode. Keep in mind also, if you use Esc as your exit key, this will cause winkawaks to exit fullscreen and crash too. Esc will get picked up by the emu before ahk handles it. Nothing I can do there except you can change your exit key to something else.

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."

RocketLauncher's Official Home

If you appreciate my work:
donate_button.png

My Apps:
Window Logger
Idle Volume Adjuster
ExplorerRestorer
Rom Folder Cleaner
Module Updater
My Guides:
How To Mod Guncons with Aimtrak

  • 10 months later...
Posted
WinKawaks simply cannot be closed from fullscreen mode, it crashes every time you bring it out. So I'm going to have to change the module to prevent true fullscreen mode from being enabled and use a fake fullscreen mode, I can do that tonight. Or you can turn on bezel support and this will run the emu in windowed mode. Keep in mind also, if you use Esc as your exit key, this will cause winkawaks to exit fullscreen and crash too. Esc will get picked up by the emu before ahk handles it. Nothing I can do there except you can change your exit key to something else.

im having this same issue.... what is the fix?

do i just need to change the exit key in winkawaks from 'esc' to like 'q' or space bar? what else would need to be edited?

Posted
im having this same issue.... what is the fix?

do i just need to change the exit key in winkawaks from 'esc' to like 'q' or space bar? what else would need to be edited?

was able to correct my problem bu going back to the prior version (1.62)

thanks to CG for the help with this!

  • 1 year later...

Archived

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

×
×
  • Create New...