Module Winkawaks.ahk
Publié : 08 mai 2013 - 08:54
Bonjour,
J'ai pu installer un module Winkawaks.ahk qui permet le lancement des roms NeoGeo , CSP1, CSP2 sous hyperspin.
Par contre il y a quelques défauts qui sont censés être géré par le module qui ne se font pas.
;----------------------------------------------------------------------------
; SNK Neo Geo, CPS1, CPS2
; WinKawaks v1.62
; by djvj
; 1.3
;
; Notes:
; If you want to use fading, turn off hide_desktop in your Hyperspin\Settings\Settings.ini
; Set your roms dir in the emu by going to File-Configure paths. If all your roms are in one dir, you only need to set one of them. If they are in seperate dirs, makes sure they are all defined here.
; All your roms should be zipped. Bios zips should be placed in the same dir as the games they are for. (ex. neogeo.zip should be with the neogeo roms)
; Load a game and set your controls at Game-Redefine keys-Player1 and 2. Then click Game-save key settings as default. Now they will be mapped for every game.
; Set your Region to USA by going to Game-NeoGeo settings-USA. If you don't want to use coins, select Game-NeoGeo settings-Console
; Set Sound-Sound frequency-44 KHz (or 48 KHz)
; The larger games take a long time to load, be patient.
;----------------------------------------------------------------------------
Fullscreen = true
Freeplay = 0 ; 0=off, 1=on
Country = 1 ; 0 = Japan, 1 = USA, 2 = Europe
Hardware = 1 ; 0 = Console, 1 = Arcade
Hotkeys = 1 ; Set to 0 to disable menu shortcuts (handy for Hotrod players)
;----------------------------------------------------------------------------
wkINI := CheckFile(emuPath . "WinKawaks.ini")
GUI_ID := FadeInStart()
; Now let's update all our keys if they differ in the ini
iniLookup =
( ltrim c
NeoGeo, NeoGeoFreeplay, %Freeplay%
NeoGeo, NeoGeoCountry, %Country%
NeoGeo, NeoGeoSystem, %Hardware%
Misc, EnableHotKeys, %Hotkeys%
)
Loop, Parse, iniLookup, `n
{
StringSplit, split, A_LoopField, `,, %A_Space%%A_Tab%
IniRead, tempVar, %wkINI%, %split1%, %split2%
If ( tempVar != split3 )
IniWrite, % split3, %wkINI%, %split1%, %split2%
}
Fullscreen := (If Fullscreen = "true" ? ("-fullscreen") : (""))
7z1 := 7z(romPath, romName, romExtension, 7zExtractDir)
; This allows us to send variables, that when empty, are not sent to the Run command
RunEmu(executable, romName, Fullscreen, emuPath)
WinWait, Kawaks
WinWaitActive, Kawaks
Loop { ; looping until WinKawaks is done loading game
Sleep, 200
WinGetTitle, winTitle, Kawaks 1.62 ahk_class Afx:400000:0 ; excluding the title of the GUI window so we can read the title of the game window instead
StringSplit, T, winTitle, %A_Space%
If ( T4 != "Initializing" T4 != "Lost" T4 != "" ) {
Sleep, 500 ; need a bit longer so we don't see the winkawaks window
Break
}
}
; Sometimes the border and titlebar appear and flash rapidly, this gets rid of them
If Fullscreen {
WinSet, Style, -0xC00000, Kawaks 1.62 ahk_class Afx:400000:0 ; Removes the TitleBar
WinSet, Style, -0x40000, Kawaks 1.62 ahk_class Afx:400000:0 ; Removes the border of the game window
}
GUI_ID2 := FadeInExit()
Process, WaitClose, %executable%
7z2 := 7zCleanUp()
GUI_ID4 := FadeOutExit()
WinActivate, Hyperspin
ExitApp
RunEmu(exe,rom,param1=0,relativepath=0, option=0) {
Run, %exe% %rom% %param1%, %relativepath%, %option%
}
ProcessExist(PidOrName) {
Process, Exist, %PidOrName%
return ErrorLevel
}
CloseProcess:
GUI_ID3 := FadeOutStart()
Send, {ENTER} ; pause emu
Sleep, 1000 ; increase this if winkawaks is not closing and only going into windowed mode
WinClose, Kawaks 1.62 ahk_class Afx:400000:0
Sleep, 500
#If ProcessExist(executable)
Process, Close, %executable% ; sometimes the process doesn't close when using the GUI, this makes sure it closes (eeprom still saves with previous line)
Return
Maintenant j'ai 3 problèmes qui ne sont pas gérés :
- need a bit longer so we don't see the winkawaks window
- Sometimes the border and titlebar appear and flash rapidly, this gets rid of them
-sometimes the process doesn't close when using the GUI, this makes sure it closes (eeprom still saves with previous line
J'ai beau augmenter le temps après "sleep" pour corriger le problème 1 et 3 ca ne change rien. Faut il compiler ? ou juste éditer et sauvegarder le .ahk ?
Est ce que Kawaks 1.62 à une importance dans le script car je ne connais pas la version de mon WinKawaks.
Donc si quelqu un peut me confirmer comment modifier un .ahk ? ( éditer et sauvegarder suffit ? ) et s'il y a des variables précises à vérifier comme Kawaks 1.62 ? Car j ai une barre windows qui clignote lors de l emulation, je vois winkawaks se lancer au démarrage de la rom, et quand je quitte le processus Hyperlaunch.exe reste et donc impossible de lancer une autre rom.
J'ai pu installer un module Winkawaks.ahk qui permet le lancement des roms NeoGeo , CSP1, CSP2 sous hyperspin.
Par contre il y a quelques défauts qui sont censés être géré par le module qui ne se font pas.
;----------------------------------------------------------------------------
; SNK Neo Geo, CPS1, CPS2
; WinKawaks v1.62
; by djvj
; 1.3
;
; Notes:
; If you want to use fading, turn off hide_desktop in your Hyperspin\Settings\Settings.ini
; Set your roms dir in the emu by going to File-Configure paths. If all your roms are in one dir, you only need to set one of them. If they are in seperate dirs, makes sure they are all defined here.
; All your roms should be zipped. Bios zips should be placed in the same dir as the games they are for. (ex. neogeo.zip should be with the neogeo roms)
; Load a game and set your controls at Game-Redefine keys-Player1 and 2. Then click Game-save key settings as default. Now they will be mapped for every game.
; Set your Region to USA by going to Game-NeoGeo settings-USA. If you don't want to use coins, select Game-NeoGeo settings-Console
; Set Sound-Sound frequency-44 KHz (or 48 KHz)
; The larger games take a long time to load, be patient.
;----------------------------------------------------------------------------
Fullscreen = true
Freeplay = 0 ; 0=off, 1=on
Country = 1 ; 0 = Japan, 1 = USA, 2 = Europe
Hardware = 1 ; 0 = Console, 1 = Arcade
Hotkeys = 1 ; Set to 0 to disable menu shortcuts (handy for Hotrod players)
;----------------------------------------------------------------------------
wkINI := CheckFile(emuPath . "WinKawaks.ini")
GUI_ID := FadeInStart()
; Now let's update all our keys if they differ in the ini
iniLookup =
( ltrim c
NeoGeo, NeoGeoFreeplay, %Freeplay%
NeoGeo, NeoGeoCountry, %Country%
NeoGeo, NeoGeoSystem, %Hardware%
Misc, EnableHotKeys, %Hotkeys%
)
Loop, Parse, iniLookup, `n
{
StringSplit, split, A_LoopField, `,, %A_Space%%A_Tab%
IniRead, tempVar, %wkINI%, %split1%, %split2%
If ( tempVar != split3 )
IniWrite, % split3, %wkINI%, %split1%, %split2%
}
Fullscreen := (If Fullscreen = "true" ? ("-fullscreen") : (""))
7z1 := 7z(romPath, romName, romExtension, 7zExtractDir)
; This allows us to send variables, that when empty, are not sent to the Run command
RunEmu(executable, romName, Fullscreen, emuPath)
WinWait, Kawaks
WinWaitActive, Kawaks
Loop { ; looping until WinKawaks is done loading game
Sleep, 200
WinGetTitle, winTitle, Kawaks 1.62 ahk_class Afx:400000:0 ; excluding the title of the GUI window so we can read the title of the game window instead
StringSplit, T, winTitle, %A_Space%
If ( T4 != "Initializing" T4 != "Lost" T4 != "" ) {
Sleep, 500 ; need a bit longer so we don't see the winkawaks window
Break
}
}
; Sometimes the border and titlebar appear and flash rapidly, this gets rid of them
If Fullscreen {
WinSet, Style, -0xC00000, Kawaks 1.62 ahk_class Afx:400000:0 ; Removes the TitleBar
WinSet, Style, -0x40000, Kawaks 1.62 ahk_class Afx:400000:0 ; Removes the border of the game window
}
GUI_ID2 := FadeInExit()
Process, WaitClose, %executable%
7z2 := 7zCleanUp()
GUI_ID4 := FadeOutExit()
WinActivate, Hyperspin
ExitApp
RunEmu(exe,rom,param1=0,relativepath=0, option=0) {
Run, %exe% %rom% %param1%, %relativepath%, %option%
}
ProcessExist(PidOrName) {
Process, Exist, %PidOrName%
return ErrorLevel
}
CloseProcess:
GUI_ID3 := FadeOutStart()
Send, {ENTER} ; pause emu
Sleep, 1000 ; increase this if winkawaks is not closing and only going into windowed mode
WinClose, Kawaks 1.62 ahk_class Afx:400000:0
Sleep, 500
#If ProcessExist(executable)
Process, Close, %executable% ; sometimes the process doesn't close when using the GUI, this makes sure it closes (eeprom still saves with previous line)
Return
Maintenant j'ai 3 problèmes qui ne sont pas gérés :
- need a bit longer so we don't see the winkawaks window
- Sometimes the border and titlebar appear and flash rapidly, this gets rid of them
-sometimes the process doesn't close when using the GUI, this makes sure it closes (eeprom still saves with previous line
J'ai beau augmenter le temps après "sleep" pour corriger le problème 1 et 3 ca ne change rien. Faut il compiler ? ou juste éditer et sauvegarder le .ahk ?
Est ce que Kawaks 1.62 à une importance dans le script car je ne connais pas la version de mon WinKawaks.
Donc si quelqu un peut me confirmer comment modifier un .ahk ? ( éditer et sauvegarder suffit ? ) et s'il y a des variables précises à vérifier comme Kawaks 1.62 ? Car j ai une barre windows qui clignote lors de l emulation, je vois winkawaks se lancer au démarrage de la rom, et quand je quitte le processus Hyperlaunch.exe reste et donc impossible de lancer une autre rom.