MEmu := "RPCS3"
MEmuV := "v0.0.7-9159-cd6b6c8a Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.22"
MDate := "2019-11-23"
MCRC := ""
iCRC := ""
MID := ""
MSystem := ["Sony Playstation 3"]
;----------------------------------------------------------------------------
; Notes:
; [IMPORTANT]
; There are two methods to run games without the use of 7z
;
; METHOD 1: Use Shortcuts
; 1) Create shortcuts of your EBOOT.BIN files, rename them to the title 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.
;
; METHOD 2: Use Text Files
; 1) Place game folders all within the same folder. It is best to not rename these folders. They will have names such as "BLES#####", "BCUS#####", "NPUB#####", etc.
; 2) Create a text file for every game, named as the title of the game. Open the text file and add the name of the game folder on the first line. ("BLES#####", "BCUS#####", "NPUB#####", etc.)
; 3) Place these text files within the folder storing your games. If you wish to have the text files in a separate folder, then you must include the full path in the "textGameFolder" variable found below.
; 4) Add the folder containing your text files as a romPath in RocketLauncher.
; 5) Add the "txt" extension for the RPCS3 emulator within RocketLauncher.
; 6) Generate a new database based on the new rom path.
; 7) 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")
;
;
;
; Known Issues:
; None
;
;
;
; Coming Soon:
; 1) Settings file to customize all additional options.
; 2) Easier search for GameID (TXT = stored in text file | LNK = stored in target | ARCHIVE = root folder of archive)
;----------------------------------------------------------------------------
; Text file method's game folder variables. If left blank, the module will try to load the game from the same folder as your text files.
textGameFolder := ""
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)
; Set variables
originalSevenZRomPath := sevenZRomPath
originalGameName := gameInfo["Name"].Value
gameSevenZEnabled := sevenZEnabled
gameType := ""
gameSerial := ""
originalRomPath := romPath
gameDirectoryJunction := "false"
gamePPU := "false"
gamePPUromPath := romPath . "\cache\" . romName . "_" . A_ComputerName . ".7z"
gamePPUemuPath := emuPath . "\cache"
gameDATA := "false"
gameDATAromPath := romPath . "\data\" . romName . "_data.7z"
gameDATAemuPath := emuPath . "\dev_hdd0\game"
textRomFolder := ""
If (romExtension = ".txt")
{
FileReadLine, textRomFolder, %romPath%\%romName%%romExtension%, 1
If (textGameFolder = "")
{
If (textRomFolder = "")
{
gameSerial := romName
If (Fileexist(romPath . "\" . romName . "\PS3_GAME\USRDIR\EBOOT.BIN"))
{
gameType := "disc"
romPath := romPath . "\" . romName . "\PS3_GAME\USRDIR"
}
Else If (Fileexist(romPath . "\" . romName . "\USRDIR\EBOOT.BIN"))
{
gameType := "game"
romPath := romPath . "\" . romName . "\USRDIR"
}
Else
{
ScriptError("Unable to find EBOOT.BIN within the folder: """ . romPath . "\" . romName . "\""")
}
}
Else
{
gameSerial := textRomFolder
If (Fileexist(romPath . "\" . textRomFolder . "\PS3_GAME\USRDIR\EBOOT.BIN"))
{
gameType := "disc"
romPath := romPath . "\" . textRomFolder . "\PS3_GAME\USRDIR"
}
Else If (Fileexist(romPath . "\" . textRomFolder . "\USRDIR\EBOOT.BIN"))
{
gameType := "game"
romPath := romPath . "\" . textRomFolder . "\USRDIR"
}
Else
{
ScriptError("Unable to find EBOOT.BIN within the folder: """ . romPath . "\" . textRomFolder . "\""")
}
}
}
Else
{
If (textRomFolder = "")
{
gameSerial := romName
If (Fileexist(textGameFolder . "\" . romName . "\PS3_GAME\USRDIR\EBOOT.BIN"))
{
gameType := "disc"
romPath := textGameFolder . "\" . romName . "\PS3_GAME\USRDIR"
}
Else If (Fileexist(textGameFolder . "\" . romName . "\USRDIR\EBOOT.BIN"))
{
gameType := "game"
romPath := textGameFolder . "\" . romName . "\USRDIR"
}
Else
{
ScriptError("Unable to find EBOOT.BIN within the folder: """ . textGameFolder . "\" . romName . "\""")
}
}
Else
{
gameSerial := textRomFolder
If (Fileexist(textGameFolder . "\" . textRomFolder . "\PS3_GAME\USRDIR\EBOOT.BIN"))
{
gameType := "disc"
romPath := textGameFolder . "\" . textRomFolder . "\PS3_GAME\USRDIR"
}
Else If (Fileexist(textGameFolder . "\" . textRomFolder . "\USRDIR\EBOOT.BIN"))
{
gameType := "game"
romPath := textGameFolder . "\" . textRomFolder . "\USRDIR"
}
Else
{
ScriptError("Unable to find EBOOT.BIN within the folder: """ . textGameFolder . "\" . textRomFolder . "\""")
}
}
}
}
Else If (romExtension = ".lnk" && Fileexist(romPath . "\" . romName . romExtension))
{
FileGetShortCut, %romPath%\%romName%%romExtension%, shortcutTarget
StringReplace, romPath, shortcutTarget, \EBOOT.BIN
}
; Find game location
gameFolder := romPath
If (sevenZEnabled = "true" && romExtension != ".lnk" && romExtension != ".txt")
{
gameFolder := sevenZExtractPath . "\" . romName
If (sevenZAttachSystemName = "true")
{
gameFolder := sevenZExtractPath . "\" . systemName . "\" . romName
}
}
Else If (romExtension = ".lnk" || romExtension = ".txt")
{
StringReplace, gameFolder, gameFolder, \USRDIR
StringReplace, gameFolder, gameFolder, \PS3_GAME
}
;MsgBox, gamePPUromPath: %gamePPUromPath%`ngamePPUemuPath: %gamePPUemuPath%`ngameDATAromPath: %gameDATAromPath%`ngameDATAemuPath: %gameDATAemuPath%
; Extract PPU files if they exist
If (gameSevenZEnabled = "true" && Fileexist(gamePPUromPath))
{
gameInfo["Name"].Value := "EXTRACTING COMPILED PPU FILES"
romExPercentage := 0
rootFolder := RLObject.getZipRootFolder(gamePPUromPath)
romExSize := RLObject.getZipExtractedSize(gamePPUromPath)
sevenZRomPath := gamePPUemuPath . "\" . rootFolder
use7zAnimation := "true"
Gosub, UpdateFadeFor7z
RunWait, %ComSpec% /c ""%sevenZPath%" x "%gamePPUromPath%" -aos -o"%gamePPUemuPath%", sevenZPID, Hide
gamePPU := "true"
Gdip_GraphicsClear(Fade_G5)
}
; Extract Game Data files if they exist
If (gameSevenZEnabled = "true" && Fileexist(gameDATAromPath))
{
gameInfo["Name"].Value := "EXTRACTING ADDITIONAL GAME DATA"
romExPercentage := 0
rootFolder := RLObject.getZipRootFolder(gameDATAromPath)
romExSize := RLObject.getZipExtractedSize(gameDATAromPath)
sevenZRomPath := gameDATAemuPath . "\" . rootFolder
use7zAnimation := "true"
Gosub, UpdateFadeFor7z
RunWait, %ComSpec% /c ""%sevenZPath%" x "%gameDATAromPath%" -aos -o"%gameDATAemuPath%", sevenZPID, Hide
gameDATA := "true"
Gdip_GraphicsClear(Fade_G5)
}
If (gamePPU := "true" || gameDATA := "true")
{
romExPercentage := 0
sevenZRomPath := originalSevenZRomPath
gameInfo["Name"].Value := originalGameName
use7zAnimation := "false"
Gosub, UpdateFadeFor7z
}
7z(romPath, romName, romExtension, sevenZExtractPath)
romFolder := romPath
; Find the game location and determine the type of game (disc or hdd)
StringRight, stringTest, romFolder, 6
If (stringTest = "USRDIR")
{
gameType := "game"
StringReplace, romFolder, romFolder, \USRDIR
StringRight, stringTest, romFolder, 8
If (stringTest = "PS3_GAME")
{
gameType := "disc"
StringReplace, romFolder, romFolder, \PS3_GAME
}
If (romExtension = ".lnk" || (romExtension = ".txt" && textRomFolder != ""))
{
If (romExtension != ".txt")
{
StringRight, gameSerial, romFolder, 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
gameDirectoryJunction := "true"
}
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.")
}
;MsgBox, romPath: %romPath%`nromName: %romName%`nromExtension: %romExtension%`ngameType: %gameType%`ngameSerial: %gameSerial%`ngameDirectoryJunction: %gameDirectoryJunction%`ngamePPU: %gamePPU%`ngameDATA: %gameDATA%`nsevenZEnabled: %sevenZEnabled%`ngameSevenZEnabled: %gameSevenZEnabled%
; Run the game
If (gameType = "game")
{
primaryExe.Run(" """ . emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\USRDIR\EBOOT.BIN""")
}
Else 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(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" || romExtension = ".txt")
{
; Find the game serial
If (Fileexist(emuPath . "\games.yml") && (gameSerial = "" || textRomFolder = ""))
{
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
gameDirectoryJunction := "true"
}
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, , 5
If (!ErrorLevel)
{
WinWaitClose, Compiling
}
}
; Waiting for emulator game window
emuGameWindow.Wait()
emuGameWindow.Active()
emuGameWindow.WaitActive()
BezelDraw()
HideAppEnd(hideEmuObj,hideEmu)
FadeInExit()
primaryExe.Process("WaitClose")
; Remove the PPU files if they were extracted or creates PPU compressed file if needed
If (sevenZDelTemp = "true" && gamePPU = "true" && gameSerial != "")
{
IfExist, %gamePPUemuPath%\%gameSerial%
{
FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
}
}
Else If (gameSevenZEnabled = "true" && gameSerial != "")
{
IfExist, %gamePPUemuPath%\%gameSerial%
{
IfNotExist, %gamePPUromPath%
{
FadeInStart()
Gdip_GraphicsClear(Fade_G5)
gameInfo["Name"].Value := "ARCHIVING COMPILED PPU FILES"
romExPercentage := 0
use7zAnimation := "true"
Gosub, UpdateFadeFor7z
RunWait, %ComSpec% /c ""%sevenZPath%" a "%gamePPUromPath%" "%gamePPUemuPath%\%gameSerial%", , Hide
Gdip_GraphicsClear(Fade_G5)
FadeInExit()
}
If (sevenZDelTemp = "true")
{
FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
}
}
Else
{
MostRecentTime := 0
MostRecentFile := ""
MostRecentName := ""
Loop, %gamePPUemuPath%\*, 2
{
If (A_LoopFileTimeCreated > MostRecentTime)
{
MostRecentTime := A_LoopFileTimeCreated
MostRecentFile := A_LoopFileLongPath
MostRecentName := A_LoopFileName
}
}
If (StrLen(MostRecentName) = 9)
{
IfNotExist, %gamePPUromPath%
{
FadeInStart()
Gdip_GraphicsClear(Fade_G5)
gameInfo["Name"].Value := "ARCHIVING COMPILED PPU FILES"
romExPercentage := 0
use7zAnimation := "true"
Gosub, UpdateFadeFor7z
RunWait, %ComSpec% /c ""%sevenZPath%" a "%gamePPUromPath%" "%MostRecentFile%", , Hide
Gdip_GraphicsClear(Fade_G5)
FadeInExit()
}
If (sevenZDelTemp = "true")
{
FileRemoveDir, %MostRecentFile%, 1
}
}
}
}
; Remove the Game Data files if they were extracted or creates Game Data compressed file if needed
If (sevenZDelTemp = "true" && gameDATA = "true" && gameSerial != "" && gameType = "disc" && romExtension != ".lnk")
{
Loop, %gameDATAemuPath%\*, 2
{
IfInString, A_LoopFileName, %gameSerial%
{
FileRemoveDir, %gameDATAemuPath%\%A_LoopFileName%, 1
}
}
}
Else If (gameSevenZEnabled = "true" && gameSerial != "" && gameType = "disc")
{
Loop, %gameDATAemuPath%\*, 2
{
IfInString, A_LoopFileName, %gameSerial%
{
IfNotExist, %gameDATAromPath%
{
FadeInStart()
Gdip_GraphicsClear(Fade_G5)
gameInfo["Name"].Value := "ARCHIVING ADDITIONAL GAME DATA"
romExPercentage := 0
use7zAnimation := "true"
Gosub, UpdateFadeFor7z
RunWait, %ComSpec% /c ""%sevenZPath%" a -mx=0 "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%*", , Hide
Gdip_GraphicsClear(Fade_G5)
FadeInExit()
}
If (sevenZDelTemp = "true")
{
Loop, %gameDATAemuPath%\*, 2
{
IfInString, A_LoopFileName, %gameSerial%
{
FileRemoveDir, %gameDATAemuPath%\%A_LoopFileName%, 1
}
}
}
Break
}
}
MostRecentTime := 0
MostRecentFile := ""
Loop, %gameDATAemuPath%\*, 2
{
If (A_LoopFileTimeCreated > MostRecentTime)
{
MostRecentTime := A_LoopFileTimeCreated
MostRecentFile := A_LoopFileLongPath
}
}
fileOne := MostRecentFile . "\ICON0.PNG"
fileTwo := emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\PS3_GAME\ICON0.PNG"
FileGetSize, dataSizeOne, %fileOne%
FileGetSize, dataSizeTwo, %fileTwo%
FileGetVersion, dataVersionOne, %fileOne%
FileGetVersion, dataVersionTwo, %fileTwo%
If (dataSizeOne = dataSizeTwo && dataVersionOne = dataVersionTwo)
{
IfNotExist, %gameDATAromPath%
{
FadeInStart()
Gdip_GraphicsClear(Fade_G5)
gameInfo["Name"].Value := "ARCHIVING ADDITIONAL GAME DATA"
romExPercentage := 0
use7zAnimation := "true"
Gosub, UpdateFadeFor7z
RunWait, %ComSpec% /c ""%sevenZPath%" a -mx=0 "%gameDATAromPath%" "%MostRecentFile%", , Hide
Gdip_GraphicsClear(Fade_G5)
FadeInExit()
}
If (sevenZDelTemp = "true")
{
FileRemoveDir, %MostRecentFile%, 1
}
}
}
; Remove the directory junction
If (sevenZDelTemp = "true" && gameDirectoryJunction = "true")
{
RunWait, %ComSpec% /c "rmdir "%emuPath%\dev_hdd0\%gameType%\%gameSerial%", , Hide
}
7zCleanUp()
BezelExit()
FadeOutExit()
ExitModule()
CloseProcess:
FadeOutStart()
emuGameWindow.Close()
emuPrimaryWindow.Close()
Process, Close, %executable%
Return
BezelLabel:
disableHideBorder := "true"
disableHideTitleBar := "true"
disableHideToggleMenu := "true"
Return