Code : Tout sélectionner
;----------------------------------------------------------------------------
; Sony Playstation 2
; PCSX2 v1.0.0.r5350
; by djvj
; 1.61
;
; Notes:
; Grab the Settings.ini located in my user dir @ /Upload Here/djvj/Sony Playstation 2/ and place it in the folder with this module
; If you want to customize settings per game, create a new section in the Settings.ini with the game's name
; All the module and basic emulator settings can be found in the Settings section in the Settings.ini
; If you use Daemon Tools, make sure you have a SCSI virtual drive setup. Not a DT one.
; Tested DT support with the cdvdGigaherz CDVD plugin. Make sure you set it to use your SCSI drive letter.
; On first run of pcsx2, make sure to select CDVD-Plugin, otherwise you will get some errors on load
; Additional help on setting up the Settings.ini can be found in the comments at the top of that file
;----------------------------------------------------------------------------
settingsFile := CheckFile(A_Scriptdir . "\Settings\Settings.ini")
GUI_ID := FadeInStart()
IniRead, UseDT, %settingsFile%, Settings, UseDT
IniRead, UseSCSI, %settingsFile%, Settings, UseSCSI
IniRead, Fullscreen, %settingsFile%, Settings, Fullscreen, %A_Space%
IniRead, noGUI, %settingsFile%, Settings, noGUI, %A_Space%
IniRead, fullboot, %settingsFile%, Settings, fullboot, %A_Space%
IniRead, nohacks, %settingsFile%, %romName%, nohacks, %A_Space%
IniRead, gamefixes, %settingsFile%, %romName%, gamefixes, %A_Space%
IniRead, cfg, %settingsFile%, %romName%, cfg, %A_Space%
IniRead, cfgpath, %settingsFile%, %romName%, cfgpath, %A_Space%
IniRead, gs, %settingsFile%, %romName%, gs, %A_Space%
IniRead, pad, %settingsFile%, %romName%, pad, %A_Space%
IniRead, spu2, %settingsFile%, %romName%, spu2, %A_Space%
IniRead, cdvd, %settingsFile%, %romName%, cdvd, %A_Space%
IniRead, usb, %settingsFile%, %romName%, usb, %A_Space%
IniRead, fw, %settingsFile%, %romName%, fw, %A_Space%
IniRead, dev9, %settingsFile%, %romName%, dev9, %A_Space%
Fullscreen := (If Fullscreen = "true" ? ("--fullscreen") : (""))
UseSCSI := (If UseSCSI = "true" ? ("scsi`, ") : ("dt`, "))
noGUI := (If noGUI = "true" ? ("--nogui") : (""))
fullboot := (fullboot ? ("--fullboot") : (""))
nohacks := (nohacks ? ("--nohacks") : (""))
gamefixes := (gamefixes ? ("--gamefixes=" . gamefixes) : (""))
cfg := (cfg ? ("--cfg=""" . cfg . """") : (""))
cfgpath := (cfgpath ? ("--cfgpath=""" . cfgpath . """") : (""))
gs := (gs ? ("--gs=""" . gs . """") : (""))
pad := (pad ? ("--pad=""" . pad . """") : (""))
spu2 := (spu2 ? ("--spu2=""" . spu2 . """") : (""))
cdvd := (cdvd ? ("--cdvd=""" . cdvd . """") : (""))
usb := (usb ? ("--usb=""" . usb . """") : (""))
fw := (fw ? ("--fw=""" . fw . """") : (""))
dev9 := (dev9 ? ("--dev9=""" . dev9 . """") : (""))
7z1 := 7z(romPath, romName, romExtension, 7zExtractDir)
; Mount the CD using DaemonTools
RunEmu(executable, """" . romPath . romName . romExtension . """", noGUI, Fullscreen, fullboot, nohacks, gamefixes, cfg, cfgpath, gs, pad, spu2, cdvd, usb, fw, dev9, emuPath, "UseErrorLevel") ;, "Min")
If(ErrorLevel != 0){
MsgBox, 48, Exe Error, Error launching emulator`, closing script., 5
ExitApp
}
WinWait, ahk_class wxWindowClassNR,, PCSX2
WinWaitActive, ahk_class wxWindowClassNR,, PCSX2
Loop { ; looping until pcsx2 is done loading game
; tooltip, loop %A_Index%,0,0
Sleep, 200
WinGetTitle, winTitle, ahk_class wxWindowClassNR,, PCSX2 ; excluding the title of the GUI window so we can read the title of the game window instead
StringSplit, winTextSplit, winTitle, |, %A_Space%
If ( winTextSplit10 != "" ) ; 10th position in the array is empty until game actually starts
break
}
GUI_ID2 := FadeInExit()
Process, WaitClose, %executable%
; Unmount the CD from DaemonTools
If ( UseDT = "true" )
RunWait, %daemonToolsPath% -unmount %UseSCSI%0
7z2 := 7zCleanUp()
GUI_ID4 := FadeOutExit()
WinActivate, Hyperspin
ExitApp
RunEmu(exe,rom,param1=0,param2=0,param3=0,param4=0,param5=0,param6=0,param7=0,param8=0,param9=0,param10=0,param11=0,param12=0,param13=0,param14=0,relativepath=0, option=0) {
; MsgBox, exe=%exe%`nnoGUI=%param1%`nFullscreen=%param2%`nfullboot=%param3%`nnohacks=%param4%`ngamefixes=%param5%`ncfg=%param6%`ncfgpath=%param7%`ngs=%param8%`npad=%param9%`nspu2=%param10%`ncdvd=%param11%`nusb=%param12%`nfw=%param13%`ndev9=%param14%`nrom=%rom%`nrelativepath=%relativepath%
Run, %exe% %param1% %param2% %param3% %param4% %param5% %param6% %param7% %param8% %param9% %param10% %param11% %param12% %param13% %param14% %rom%, %relativepath%, %option%
}
CloseProcess:
GUI_ID3 := FadeOutStart()
WinClose, PCSX2 ahk_class wxWindowClassNR ; sending command to the GUI window to properly close the entire emu
Return/code]