Rpcs3

doopsnoop

New member
RL Member
Sorry for this certainly stupid question but why does the RPCS3 module appears with red claim in rocketlauncher? Msystem header is wrongly defined should use = and not :=...
Do you use a different rocketlaucher version ? Or there is something i don't understand ? If i correct the header value the line color become yellow not green all i can try doesn't work.
 

slashin8r

Member
RL Member
Sorry for this certainly stupid question but why does the RPCS3 module appears with red claim in rocketlauncher? Msystem header is wrongly defined should use = and not :=...
Do you use a different rocketlaucher version ? Or there is something i don't understand ? If i correct the header value the line color become yellow not green all i can try doesn't work.

It is red because it does not match the official version. The official version hasn't been updated in quite some time and I'm not sure if it even works anymore.

The MSystem variable is correct. All modules define these module variables. See the Cemu module for example:

Code:
MEmu := "Cemu"
MEmuV := "v1.7.0"
MURL := ["http://cemu.info/"]
MAuthor := ["djvj"]
MVersion := "1.0.5"
MCRC := "6773400D"
iCRC := "317C6C8"
MID := "635803743205902402"
MSystem := ["Nintendo Wii U"]

It might be complaining about the extra MDate variable I added. If you change it from ":=" to "=" it will cause the module to fail.

Edit: Mine shows yellow and I think it is yellow that actually means it is not official. Red means it has errors.
 
Last edited:

doopsnoop

New member
RL Member
not sure what official version you are talking about ? Rocketlauncher ? error.jpg
When i change value MSystem := ["Sony Playstation 3"] to MSystem = Sony Playstation 3
Even i don't change it the popup windows error is the same when i try to lauch a game through rocketL

If i compare the header working for me with nintendo64 on project64 the header is like this:

MEmu = Mupen64Plus
MEmuV = v2.0
MURL = https://code.google.com/p/mupen64plus/
MAuthor = djvj,ghutch92
MVersion = 2.0.5
MCRC = B3DC20B1
iCRC = 232C6716
MID = 635163407878625424
MSystem = "Nintendo 64"
 
Last edited:

slashin8r

Member
RL Member
not sure what official version you are talking about ? Rocketlauncher ? View attachment 3015
When i change value MSystem := ["Sony Playstation 3"] to MSystem = Sony Playstation 3
Even i don't change it the popup windows error is the same when i try to lauch a game through rocketL

If i compare the header working for me with nintendo64 on project64 the header is like this:

MEmu = Mupen64Plus
MEmuV = v2.0
MURL = https://code.google.com/p/mupen64plus/
MAuthor = djvj,ghutch92
MVersion = 2.0.5
MCRC = B3DC20B1
iCRC = 232C6716
MID = 635163407878625424
MSystem = "Nintendo 64"

Code:
MEmu := "Mupen64Plus"
MEmuV := "v2.0"
MURL := ["https://code.google.com/p/mupen64plus/"]
MAuthor := ["djvj","ghutch92"]
MVersion := "2.0.5"
MCRC := "8112C1DD"
iCRC := "232C6716"
MID := "635163407878625424"
MSystem := ["Nintendo 64"]

Not sure where you are getting your modules or what version of RL you are using...
 

slashin8r

Member
RL Member
RLUI.png
v1.0.1.10

RL.png
v1.2.0.1

You most likely need RocketLauncher updated, not RocketLauncherUI. RL runs all the modules and RLUI just looks pretty.
 

slashin8r

Member
RL Member
You probably just need your AutoHotkey.dll file updated. I have mine attached.
 

Attachments

  • AutoHotkey.zip
    397.3 KB · Views: 20

doopsnoop

New member
RL Member
You are a genious, everything is ok now with rpcs3 ! Not tested with all the other emulators for now but for the ps3 it's just fine. Sorry it was so stupid shame on me.
 

doopsnoop

New member
RL Member
1 week i was on it, 2 minutes to solve it with you !
ok now all the emulators even rpcs3 don't launch games under hyperspin :drool:
certainly a quick fix i'll search
 

doopsnoop

New member
RL Member
Hello, just a word to say that hyperspin and rocketlaucher are now fully working with rpcs3 with your help. All my emulators are just fine now. Next step for me is to setup my joysticks and buttons for the arcade cabinet I try to build. I'll certainly use a lot of time again!
Thanks again slashin8r
 

slashin8r

Member
RL Member
I am currently working on a new update that will hopefully make extra game data obsolete. Some disc games will require you to "install additional game data" on first load. These files already exist within the disc folder and are copied to the game folder, taking up multiple GBs of space per game that requires it, which makes absolutely no sense. Why not use a symlink instead? Well, that is my plan and it worked with 1 game so far. The only problem is, not every game saves these files the same. They all save into the game folder, but some use their gameID as the folder name, others use gameID + "GAMEDATA" and others use a completely different gameID. May take some time to make it universal for all games as well as fully automate it.
 

slashin8r

Member
RL Member
Scrap that idea. Just ran into a game that actually creates a lot of brand new files. Better off archiving what the emulator creates just to be safe. Never know if it will cause a problem hours into a game.

Edit: Also found yet another naming convention for the game data folder: _GDATA_45097583704827

I can find the game data folder by comparing the creation/modification date with the time the module was started. I can also get the name of the folder within archives so I can simplify the way the gameID is found (will do this later since I don't want to break the module.... yet). As long as everyone who stores their games in archives is making sure the base folder inside the archive is named with the gameID then this method will work flawlessly. The archive itself can be named anything, preferably the game's title.
 
Last edited:

slashin8r

Member
RL Member
Progress bars are now working for the PPU and Game Data extraction.

Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9159-cd6b6c8a Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.19"
MDate := "2019-11-21"
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")
; 
; 
; 
; Coming Soon:
; 1) Settings file to customize all additional options.
; 2) Easier search for GameID
;----------------------------------------------------------------------------

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" && romExtension != ".lnk")
{
  gameFolder := sevenZExtractPath . "\" . romName
  If (sevenZAttachSystemName = "true")
  {
    gameFolder := sevenZExtractPath . "\" . systemName . "\" . romName
  }
}

; Set variables
originalSevenZRomPath := sevenZRomPath
originalGameName := gameInfo["Name"].Value
originalUse7zAnimation := use7zAnimation
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"

;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)
}

romExPercentage := 0
sevenZRomPath := originalSevenZRomPath
gameInfo["Name"].Value := originalGameName
use7zAnimation := originalUse7zAnimation
Gosub, UpdateFadeFor7z

7z(romPath, romName, romExtension, sevenZExtractPath)

romFolder := romPath
If (romExtension = ".lnk" && Fileexist(romPath . "\" . romName . romExtension))
{
  FileGetShortCut, %romPath%\%romName%%romExtension%, shortcutTarget
  StringReplace, romFolder, shortcutTarget, \EBOOT.BIN
}

; 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 (sevenZEnabled != "true")
  {
    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 (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
      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")
7zCleanUp()

; Remove the directory junction
If (sevenZDelTemp = "true" && gameDirectoryJunction = "true")
{
  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 (sevenZDelTemp = "true" && gamePPU = "true" && gameSerial != "")
{
  IfExist, %gamePPUemuPath%\%gameSerial%
  {
    FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
  }
}
Else If (gameSevenZEnabled = "true" && gameSerial != "")
{
  IfExist, %gamePPUemuPath%\%gameSerial%
  {
    IfNotExist, %gamePPUromPath%
    {
      RunWait, %ComSpec% /c ""%sevenZPath%" a "%gamePPUromPath%" "%gamePPUemuPath%\%gameSerial%", , Hide
    }
    If (sevenZDelTemp = "true")
    {
      FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 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")
{
  IfExist, %gameDATAemuPath%\%gameSerial%
  {
    FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
  }
  IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
  {
    FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
  }
}
Else If (gameSevenZEnabled = "true" && gameSerial != "" && gameType = "disc")
{
  IfExist, %gameDATAemuPath%\%gameSerial%
  {
    IfNotExist, %gameDATAromPath%
    {
      RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%" -mx=0, , Hide
    }
    If (sevenZDelTemp = "true")
    {
      FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
    }
  }
  IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
  {
    IfNotExist, %gameDATAromPath%
    {
      RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%GAMEDATA" -mx=0, , Hide
    }
    If (sevenZDelTemp = "true")
    {
      FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
    }
  }
}

BezelExit()
FadeOutExit()
ExitModule()

CloseProcess:
  FadeOutStart()
  emuGameWindow.Close()
  emuPrimaryWindow.Close()
  Process, Close, %executable%
Return

BezelLabel:
  disableHideBorder := "true"
  disableHideTitleBar := "true"
  disableHideToggleMenu := "true"
Return
 

slashin8r

Member
RL Member
I have added support for text files as dummy files, similar to how the older modules worked. Follow the instructions found within the module.

Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9159-cd6b6c8a Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.20"
MDate := "2019-11-22"
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")
; 
; 
; 
; Coming Soon:
; 1) Settings file to customize all additional options.
; 2) Easier search for GameID
;----------------------------------------------------------------------------

; 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"

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")
  {
    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")
{
  ; 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
      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")
7zCleanUp()

; Remove the directory junction
If (sevenZDelTemp = "true" && gameDirectoryJunction = "true")
{
  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 (sevenZDelTemp = "true" && gamePPU = "true" && gameSerial != "")
{
  IfExist, %gamePPUemuPath%\%gameSerial%
  {
    FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
  }
}
Else If (gameSevenZEnabled = "true" && gameSerial != "")
{
  IfExist, %gamePPUemuPath%\%gameSerial%
  {
    IfNotExist, %gamePPUromPath%
    {
      RunWait, %ComSpec% /c ""%sevenZPath%" a "%gamePPUromPath%" "%gamePPUemuPath%\%gameSerial%", , Hide
    }
    If (sevenZDelTemp = "true")
    {
      FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 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")
{
  IfExist, %gameDATAemuPath%\%gameSerial%
  {
    FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
  }
  IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
  {
    FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
  }
}
Else If (gameSevenZEnabled = "true" && gameSerial != "" && gameType = "disc")
{
  IfExist, %gameDATAemuPath%\%gameSerial%
  {
    IfNotExist, %gameDATAromPath%
    {
      RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%" -mx=0, , Hide
    }
    If (sevenZDelTemp = "true")
    {
      FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
    }
  }
  IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
  {
    IfNotExist, %gameDATAromPath%
    {
      RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%GAMEDATA" -mx=0, , Hide
    }
    If (sevenZDelTemp = "true")
    {
      FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
    }
  }
}

BezelExit()
FadeOutExit()
ExitModule()

CloseProcess:
  FadeOutStart()
  emuGameWindow.Close()
  emuPrimaryWindow.Close()
  Process, Close, %executable%
Return

BezelLabel:
  disableHideBorder := "true"
  disableHideTitleBar := "true"
  disableHideToggleMenu := "true"
Return

Edit: Updated the code and tested text file method.
 
Last edited:

slashin8r

Member
RL Member
Added compatibility for more game data files, including games that use multiple game data folders. Also added fade screens for archiving the PPU files and game data files. No progress bars for these, but at least it is better than a black screen during this process.

Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9159-cd6b6c8a Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.21"
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"

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")
  {
    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")
{
  ; 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
      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
    }
  }
}

; 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

Edit: Set "textGameFolder" back to blank. Had it set for testing and forgot to reset it.
 
Last edited:

slashin8r

Member
RL Member
Module will now figure out which PPU folder to archive based on creation time and whether or not the name of the folder is 9 digits long. This is only a backup process that is called if the gameSerial is not found or is incorrect. This will simply archive the most recently created folder within the "cache" folder. If it is archiving the wrong folder, you may have to delete and re-compile your PPU files.

Code:
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

Edit: When the text file setup is unable to determine the gameID, it will utilize the games.yml file to try and find it.
 
Last edited:

slashin8r

Member
RL Member
I have setup the RPCS3.ini file to store the module specific settings. I am confident that this module is ready to go and therefore is now version 1.1.0.

I have attached an archive containing all necessary files for the module. Edit the RPCS3.ini file to your liking before running as certain options are not turned off by default (archiving PPU and DATA files).

Updated the notes section. Settings file includes comments for the variables. Overall, everything is solid.
 

Attachments

  • RPCS3 v1.1.0.zip
    19.4 KB · Views: 291
Top