Rpcs3

slashin8r

Member
RL Member
I'm not sure what is going on with the closing process. It might be hanging on trying to find the game window or is not picking up the correct gameID.

Does this happen for all games you run?
 

oldhag270

Member
RL Member
Just checked it now both games that are located in game and disc within dev_hdd0 all load correctly,but when I hit escape the fade is still running and the emulator gets minimized as well.
 

Yardley

Member
Supporter
RL Member
Ive actually had 7z enabled the whole time. Hasn’t caused any issues. I meant auditing not working in RPCS3 not RL.
 

slashin8r

Member
RL Member
Just checked it now both games that are located in game and disc within dev_hdd0 all load correctly,but when I hit escape the fade is still running and the emulator gets minimized as well.

After hitting escape, if you let the fade screen sit for a few minutes does it give you an error?

Ive actually had 7z enabled the whole time. Hasn’t caused any issues. I meant auditing not working in RPCS3 not RL.

That is good to know. Yeah, RPCS3 will not be able to list archived games.
 

doopsnoop

New member
RL Member
Hello everybody, i'm new on emulation and hyperspin, so sorry if i ask you for things that seems to be easy for you :)
I've setup a system for my bartop and everything is ok except the PS3 emulator in hyperspin and rocketlauncher. The emulator itself is perfectly working and games i've selected and included in my config.
But i don't understand how to integrate it in rocketlauncher and hyperspin. I've undertsand there is so many possible configurations.
Mine works with originals PS3 game folders like "dev_hdd0\game\..." or "dev_hdd0\disc\..." there is no 7z file or something like this.
My problem is i don't understand how ahk modules are working. I can't found an exemple or concrete case i can copy for understanding.
I've made the biggest part of the config i hope but on launching a game on rocketlauncher i've an error
If someone could explain how to configure all this it would be great.

Thanks a lot for your help
 

Yardley

Member
Supporter
RL Member
I'm having the same problem as oldhag270 with the fade screen staying onscreen after quitting the emulator. I have to force quit RL and then manually close RPCS3. Looks like when pressing Esc instead of quitting, RPCS3 comes out of fullscreen and goes to the background. The module from post #262 doesn't have this problem. Here's what I noticed though:

If you start a game for the first time and it takes long to compile, fade works correctly and stays on the screen until the emulator loads. Exit works correctly and the emulator is closed, fade doesn't remain on the screen. If you start the same game a second time, this time it loads faster because the PPU is already compiled but this is when exit doesn't work and the emulator comes out of fullscreen, goes to the background and fade remains on the screen.
 

slashin8r

Member
RL Member
Looks like the only major difference is that I added code to check the target of the sortcut. Not quite sure how this would affect the emulator as it is called before the game is launched and it seems like the module is starting the games no problem.

Anyways, I added more error checking to make sure the shortcut exists before trying to find its target.

Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9142-9a8c59a1 Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.16"
MDate := "2019-11-18"
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 := ""
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"

; 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" && Fileexist(romPath . "\" . romName . romExtension))
{
  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
        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%

; 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, , 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 (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 (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()
  emuPrimaryWindow.Close()
  Process, Close, %executable%
Return

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

I added a message box to get a list of the variables from anyone who is experiencing problems. Please screenshot this message box and post for me to take a look. Thanks.

To remove the message box: Search for "MsgBox" (should be line 139) and either add a semi-colon at the beginning of that line (i.e. ";MsgBox, ...") or delete the line.
 

slashin8r

Member
RL Member
Hello everybody, i'm new on emulation and hyperspin, so sorry if i ask you for things that seems to be easy for you :)
I've setup a system for my bartop and everything is ok except the PS3 emulator in hyperspin and rocketlauncher. The emulator itself is perfectly working and games i've selected and included in my config.
But i don't understand how to integrate it in rocketlauncher and hyperspin. I've undertsand there is so many possible configurations.
Mine works with originals PS3 game folders like "dev_hdd0\game\..." or "dev_hdd0\disc\..." there is no 7z file or something like this.
My problem is i don't understand how ahk modules are working. I can't found an exemple or concrete case i can copy for understanding.
I've made the biggest part of the config i hope but on launching a game on rocketlauncher i've an error
If someone could explain how to configure all this it would be great.

Thanks a lot for your help

Which error are you receiving?

Most of the module code has comments explaining what it is trying to accomplish. Basically any RL module will be utilizing the basic features of RL (Fade, Bezel, 7z, MountCD, etc.) while also loading the game using the emulator through a command-line script. All other code is to make it start up as smoothly as possible for as many people as possible.

You can find this particular module within your RL folder under "Modules\RPCS3\RPCS3.ahk". Copy the most current code, paste it over the code within your current module, and give it a run. There will be a message box in the most current code, please screenshot this and post it in a reply if you are running into other problems. Thanks.
 

Yardley

Member
Supporter
RL Member
Here's a screenshot of the message box. This time I noticed that if fade is off, pressing Esc will close the emulator properly but RL will stay running. If fade is on, pressing Esc takes the emulator out of fullscreen and hides it behind fade (same as before). box.jpg
 

slashin8r

Member
RL Member
Here's a screenshot of the message box. This time I noticed that if fade is off, pressing Esc will close the emulator properly but RL will stay running. If fade is on, pressing Esc takes the emulator out of fullscreen and hides it behind fade (same as before). View attachment 3014

Looks like all the variables are correct. Try using the code below. I added some more message boxes to test and removed the variable list message box. Let me know if you get a message box after pressing Esc. Thanks.

Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9142-9a8c59a1 Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.16"
MDate := "2019-11-18"
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 := ""
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"

; 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" && Fileexist(romPath . "\" . romName . romExtension))
{
  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
        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%

; 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, , 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 (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 (gamePPU = "true")
{
  If (gameSerial != "")
  {
    FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
  }
}
Else If (sevenZEnabled = "true")
{
  IfExist, %gamePPUemuPath%\%gameSerial%
  {
    IfNotExist, %gamePPUromPath%
    {
      If (gameSerial != "")
      {
        MsgBox, Archiving PPU files.
        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%
      {
        MsgBox, Archiving DATA files.
        RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%" -mx=0, , Hide
      }
      FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
    }
    IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
    {
      IfNotExist, %gameDATAromPath%
      {
        MsgBox, Archiving GAMEDATA files.
        RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%GAMEDATA" -mx=0, , Hide
      }
      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
It is getting hung up on the PPU window. When it compiles PPU files, it works as expected, but if it doesn't compile, then it gets stuck without being able to find the game window. Might just need to skip the game window check.... Gonna test it out a bit more.

Edit: Wow, I feel like an idiot. WinWait timeout is in seconds, not milliseconds like every other function uses.... Making the fix and testing, then will post it. Makes sense that waiting 5000 seconds would take some time, haha.

Edit2: Also looks like 7z gets disabled by default if you use the shortcut method. Even when it is enabled in RLUI, when the module runs the 7z function and finds out the rom extension does not match, then it sets it to false. Will create a workaround until I get a settings file up and running.
 
Last edited:

slashin8r

Member
RL Member
Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9142-9a8c59a1 Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.17"
MDate := "2019-11-18"
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" && romExtension != ".lnk")
{
  gameFolder := sevenZExtractPath . "\" . romName
  If (sevenZAttachSystemName = "true")
  {
    gameFolder := sevenZExtractPath . "\" . systemName . "\" . romName
  }
}

; Set variables
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))
{
  RunWait, %ComSpec% /c ""%sevenZPath%" x "%gamePPUromPath%" -aos -o"%gamePPUemuPath%", , Hide
  gamePPU := "true"
}

; Extract Game Data files if they exist
If (gameSevenZEnabled = "true" && Fileexist(gameDATAromPath))
{
  RunWait, %ComSpec% /c ""%sevenZPath%" x "%gameDATAromPath%" -aos -o"%gameDATAemuPath%", , Hide
  gameDATA := "true"
}

7z(romPath, romName, romExtension, sevenZExtractPath)

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

; Find the game location and determine the type of game (disc or hdd)
StringRight, stringTest, gameFolder, 6
If (stringTest = "USRDIR")
{
  gameType := "game"
  StringReplace, gameFolder, gameFolder, \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
        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 (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 (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
      FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
    }
  }
}

; Remove the Game Data files if they were extracted or creates Game Data compressed file if needed
If (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
    }
    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()
  emuPrimaryWindow.Close()
  Process, Close, %executable%
Return

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

I think I got everything working now. Shortcut users can even get the PPU files and extra game data files to automatically archive if they have 7z enabled. Had a problem when using shortcuts where the game could be deleted, but I added more error checking and made it so only disc games will be allowed to archive the extra game data files.
 

slashin8r

Member
RL Member
Sorry, forgot to remove my testing message boxes. Try this code.

Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9142-9a8c59a1 Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.17"
MDate := "2019-11-18"
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" && romExtension != ".lnk")
{
  gameFolder := sevenZExtractPath . "\" . romName
  If (sevenZAttachSystemName = "true")
  {
    gameFolder := sevenZExtractPath . "\" . systemName . "\" . romName
  }
}

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

; Extract PPU files if they exist
If (gameSevenZEnabled = "true" && Fileexist(gamePPUromPath))
{
  RunWait, %ComSpec% /c ""%sevenZPath%" x "%gamePPUromPath%" -aos -o"%gamePPUemuPath%", , Hide
  gamePPU := "true"
}

; Extract Game Data files if they exist
If (gameSevenZEnabled = "true" && Fileexist(gameDATAromPath))
{
  RunWait, %ComSpec% /c ""%sevenZPath%" x "%gameDATAromPath%" -aos -o"%gameDATAemuPath%", , Hide
  gameDATA := "true"
}

7z(romPath, romName, romExtension, sevenZExtractPath)

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

; Find the game location and determine the type of game (disc or hdd)
StringRight, stringTest, gameFolder, 6
If (stringTest = "USRDIR")
{
  gameType := "game"
  StringReplace, gameFolder, gameFolder, \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
        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.")
}

; 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 (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 (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
      FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
    }
  }
}

; Remove the Game Data files if they were extracted or creates Game Data compressed file if needed
If (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
    }
    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()
  emuPrimaryWindow.Close()
  Process, Close, %executable%
Return

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

doopsnoop

New member
RL Member
Which error are you receiving?

Most of the module code has comments explaining what it is trying to accomplish. Basically any RL module will be utilizing the basic features of RL (Fade, Bezel, 7z, MountCD, etc.) while also loading the game using the emulator through a command-line script. All other code is to make it start up as smoothly as possible for as many people as possible.

You can find this particular module within your RL folder under "Modules\RPCS3\RPCS3.ahk". Copy the most current code, paste it over the code within your current module, and give it a run. There will be a message box in the most current code, please screenshot this and post it in a reply if you are running into other problems. Thanks.

Many thanks for this answer, in fact my problem is i just don't know how modules works and how to make it works. I've to admit that i d'ont really understand how hyperspin works. I can applied tutorials with a lot of emulators but, with rpcs3 it sucks...

In fact, i've succed to launch game with pc launcher following a youtube tutorial, everything is ok and all my games launch from hyperspin, but when i hit escape key the rpcs3 just quit the fullscreen and don't quit the application. It's ok for now because i've i keyboard but in the future i'll just have my bartop control panel. I would love to understand how to write a module or just use it. Because as i understand the pc launcher solution is not the best. Maybe you have a link on how to program or make my own module ? or re-use one of yours? or just how to learn hyperspin for the noob like me :hmmmm2:
 

slashin8r

Member
RL Member
Code:
MEmu := "RPCS3"
MEmuV := "v0.0.7-9151-9dab0575 Alpha"
MURL := ["https://rpcs3.net"]
MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
MVersion := "1.0.18"
MDate := "2019-11-18"
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) Progress bars on fade screen for all additional 7z processes.
;----------------------------------------------------------------------------

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
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))
{
  romExSize := RLObject.getZipExtractedSize(gamePPUromPath)
  use7zAnimation := "true"
  Gosub, UpdateFadeFor7z
  RunWait, %ComSpec% /c ""%sevenZPath%" x "%gamePPUromPath%" -aos -o"%gamePPUemuPath%", sevenZPID, Hide
  gamePPU := "true"
}

; Extract Game Data files if they exist
If (gameSevenZEnabled = "true" && Fileexist(gameDATAromPath))
{
  romExSize := RLObject.getZipExtractedSize(gameDATAromPath)
  use7zAnimation := "true"
  Gosub, UpdateFadeFor7z
  RunWait, %ComSpec% /c ""%sevenZPath%" x "%gameDATAromPath%" -aos -o"%gameDATAemuPath%", sevenZPID, Hide
  gameDATA := "true"
}

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

This code seems to be working well. I am unable to get progress bars to move beyond 0% for the PPU and Data files, but it is better than a blank fade screen. Once the actual game starts to extract, the current progress shows as expected. Next I will tackle the custom settings file and then go back to getting progress bars to work.
 

slashin8r

Member
RL Member
Many thanks for this answer, in fact my problem is i just don't know how modules works and how to make it works. I've to admit that i d'ont really understand how hyperspin works. I can applied tutorials with a lot of emulators but, with rpcs3 it sucks...

In fact, i've succed to launch game with pc launcher following a youtube tutorial, everything is ok and all my games launch from hyperspin, but when i hit escape key the rpcs3 just quit the fullscreen and don't quit the application. It's ok for now because i've i keyboard but in the future i'll just have my bartop control panel. I would love to understand how to write a module or just use it. Because as i understand the pc launcher solution is not the best. Maybe you have a link on how to program or make my own module ? or re-use one of yours? or just how to learn hyperspin for the noob like me :hmmmm2:

Since you are able to run them through the emulator itself, I am assuming you will want to use the shortcut method. The module posted above (v1.0.18) should work if you follow the instructions in the "Notes" section of the module.

As for understanding how it all works, I won't be of much help there since I am still learning it all myself. As long as you know how to add a system and emulator to RocketLauncher then you should be good to go.
 
Top