Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9142-9a8c59a1 Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.15"
MDate := "2019-11-16"
MCRC := ""
iCRC := ""
MID := ""
MSystem := ["Sony Playstation 3"]
;----------------------------------------------------------------------------
; Notes:
; [IMPORTANT]
; To run games without the use of 7z
;
; 1) Create shortcuts of your EBOOT.BIN files, rename them to the name of the game, and place them all within the same folder then add that folder as a romPath in RocketLauncher.
; 2) Add the "lnk" (LNK) extension for the RPCS3 emulator within RocketLauncher.
; 3) Generate a new database based on the new rom path.
; 4) Audit all games for the system and enjoy.
; [IMPORTANT]
;
;
;
; To save additional space, this module now automatically compresses each game's PPU folder and Game Data folder (if exists) as long as 7z is enabled.
; PPU file saved in: %romPath%\cache\%romName%_%A_ComputerName%.7z
; Game Data file saved in: %romPath%\data\%romName%_data.7z
;
; Example:
; Rom File = "D:\PS3\PS3 Test Game.rar"
; A_ComputerName = "PC001"
;
; PPU File = "D:\PS3\cache\PS3 Test Game_PC001.7z")
; Game Data File = "D:\PS3\data\PS3 Test Game_data.7z")
;----------------------------------------------------------------------------
StartModule()
BezelGUI()
FadeInStart()
primaryExe := new Emulator(emuPath . "\" . executable)
primaryWindowClassName := "Qt5QWindowIcon"
emuPrimaryWindow := new Window(new WindowTitle(,primaryWindowClassName, executable))
emuGameWindow := new Window(new WindowTitle("FPS"))
; Finding emulator config file
Rpcs3config := new File(emuPath . "\config.yml")
Rpcs3config.CheckFile("Could not find RPCS3 config.yml! Run your emulator, go to Settings and save them.")
; Finding emulator games file
Rpcs3games := new File(emuPath . "\games.yml")
Rpcs3games.CheckFile("Could not find RPCS3 games.yml! Update this file with your list of game serials and game installation directories.")
BezelStart()
hideEmuObj := Object(emuPrimaryWindow,1)
HideAppStart(hideEmuObj,hideEmu)
; Find game location
gameFolder := romPath
If (sevenZEnabled = "true")
{
gameFolder := sevenZExtractPath . "\" . romName
If (sevenZAttachSystemName = "true")
{
gameFolder := sevenZExtractPath . "\" . systemName . "\" . romName
}
}
; Set variables
gameType := ""
gameSerial := ""
gamePPU := "false"
originalRomPath := romPath
gamePPUromPath := romPath . "\cache\" . romName . "_" . A_ComputerName . ".7z"
gamePPUemuPath := emuPath . "\cache"
gameDATA := "false"
gameDATAromPath := romPath . "\data\" . romName . "_data.7z"
gameDATAemuPath := emuPath . "\dev_hdd0\game"
; Extract PPU files if they exist
If (sevenZEnabled = "true" && Fileexist(gamePPUromPath))
{
RunWait, %ComSpec% /c ""%sevenZPath%" x "%gamePPUromPath%" -aos -o"%gamePPUemuPath%", , Hide
gamePPU := "true"
}
; Extract Game Data files if they exist
If (sevenZEnabled = "true" && Fileexist(gameDATAromPath))
{
RunWait, %ComSpec% /c ""%sevenZPath%" x "%gameDATAromPath%" -aos -o"%gameDATAemuPath%", , Hide
gameDATA := "true"
}
7z(romPath, romName, romExtension, sevenZExtractPath)
If (romExtension = ".lnk")
{
FileGetShortCut, %romPath%\%romName%%romExtension%, shortcutTarget
StringReplace, romPath, shortcutTarget, \EBOOT.BIN
}
; Find the game location and determine the type of game (disc or hdd)
StringRight, stringTest, romPath, 6
If (stringTest = "USRDIR")
{
gameType := "game"
StringReplace, gameFolder, romPath, \USRDIR
StringRight, stringTest, gameFolder, 8
If (stringTest = "PS3_GAME")
{
gameType := "disc"
StringReplace, gameFolder, gameFolder, \PS3_GAME
}
If (sevenZEnabled != "true")
{
StringRight, gameSerial, gameFolder, 9
; Create the directory junction
If (!Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial))
{
If (gameSerial != "" && gameType != "")
{
RunWait, %ComSpec% /c "mklink /J "%emuPath%\dev_hdd0\%gameType%\%gameSerial%" "%gameFolder%", , Hide
}
Else
{
ScriptError("Game serial not found. If this is your first time loading this game, please check that its game serial and path were added to the games.yml file and try running again.")
}
}
}
}
Else If (sevenZEnabled = "true" && (romPath = originalRomPath || romPath = ""))
{
ScriptError("Rom was not found in the USRDIR directory. Please make sure ""bin"" is an RPCS3 extension and also verify the folder structure of your rom.")
}
; Run the game
If (Fileexist(romPath . "\EBOOT.BIN"))
{
primaryExe.Run(" """ . romPath . "\EBOOT.BIN""")
}
Else If (Fileexist(romPath . "\" . romName . ".BIN"))
{
primaryExe.Run(" """ . romPath . "\" . romName . ".BIN""")
}
Else If (Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\PS3_GAME\USRDIR\EBOOT.BIN"))
{
primaryExe.Run(" """ . emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\PS3_GAME\USRDIR\EBOOT.BIN""")
}
Else If (Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\USRDIR\EBOOT.BIN"))
{
primaryExe.Run(" """ . emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\USRDIR\EBOOT.BIN""")
}
Else If (Fileexist(romPath . "\" . romName . romExtension))
{
primaryExe.Run(" """ . romPath . "\" . romName . romExtension . """")
}
Else
{
ScriptError("Unable to find EBOOT.BIN file. Please make sure ""bin"" (and ""lnk"" [LNK] if you are loading from shortcuts) is an RPCS3 extension and also verify the folder structure of your rom.")
}
; Waiting for main emulator window
emuPrimaryWindow.Wait()
emuPrimaryWindow.Active()
emuPrimaryWindow.WaitActive()
If (sevenZEnabled = "true")
{
; Find the game serial
If (Fileexist(emuPath . "\games.yml") && gameSerial = "")
{
Loop, read, %emuPath%\games.yml
{
StringReplace, gameLine, A_LoopReadLine, /, \, All
IfInString, gameLine, %gameFolder%
{
StringLeft, gameSerial, gameLine, 9
break
}
}
}
; Create the directory junction
If (!Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial))
{
If (gameSerial != "" && gameType != "")
{
RunWait, %ComSpec% /c "mklink /J "%emuPath%\dev_hdd0\%gameType%\%gameSerial%" "%gameFolder%", , Hide
}
Else
{
ScriptError("Game serial not found in your RPCS3 games.yml file. If this is your first time loading this game, please check that its game serial and path were added to the games.yml file and try running again.")
}
}
}
; Waiting 5 seconds to see if compiling window appears
If (gameSerial != "" && gamePPU != "true")
{
WinWait, Compiling, , 5000
If (!ErrorLevel)
{
WinWaitClose, Compiling
}
}
; Waiting for emulator game window
emuGameWindow.Wait()
emuGameWindow.Active()
emuGameWindow.WaitActive()
BezelDraw()
HideAppEnd(hideEmuObj,hideEmu)
FadeInExit()
primaryExe.Process("WaitClose")
7zCleanUp()
; Remove the directory junction
If (Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial) && gameSerial != "" && gameType != "")
{
RunWait, %ComSpec% /c "rmdir "%emuPath%\dev_hdd0\%gameType%\%gameSerial%", , Hide
}
; Remove the PPU files if they were extracted or creates PPU compressed file if needed
If (gamePPU = "true")
{
If (gameSerial != "")
{
FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
}
}
Else If (sevenZEnabled = "true")
{
IfExist, %gamePPUemuPath%\%gameSerial%
{
IfNotExist, %gamePPUromPath%
{
If (gameSerial != "")
{
RunWait, %ComSpec% /c ""%sevenZPath%" a "%gamePPUromPath%" "%gamePPUemuPath%\%gameSerial%", , Hide
FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
}
}
}
}
; Remove the Game Data files if they were extracted or creates Game Data compressed file if needed
If (gameDATA = "true")
{
If (gameSerial != "")
{
IfExist, %gameDATAemuPath%\%gameSerial%
{
FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
}
IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
{
FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
}
}
}
Else If (sevenZEnabled = "true")
{
If (gameSerial != "")
{
IfExist, %gameDATAemuPath%\%gameSerial%
{
IfNotExist, %gameDATAromPath%
{
RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%" -mx=0, , Hide
}
FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
}
IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
{
IfNotExist, %gameDATAromPath%
{
RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%GAMEDATA" -mx=0, , Hide
}
FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
}
}
}
BezelExit()
FadeOutExit()
ExitModule()
CloseProcess:
FadeOutStart()
emuGameWindow.Close()
Process, Close, %executable%
Return
BezelLabel:
disableHideBorder := "true"
disableHideTitleBar := "true"
disableHideToggleMenu := "true"
return