Thread: Rpcs3

Page 16 of 17 FirstFirst ... 611121314151617 LastLast
Results 301 to 320 of 334
  1. Collapse Details
    Re: Rpcs3 
    Junior Member
    MainSecondary
    Join Date
    Nov 2019
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site
    Quote Originally Posted by slashin8r View Post
    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
     

  2. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    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.
     

  3. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    Quote Originally Posted by doopsnoop View Post
    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
    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.
     

  4. Collapse Details
    Re: Rpcs3 
    Junior Member
    MainSecondary
    Join Date
    Nov 2019
    Posts
    8
    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.
     

  5. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    Quote Originally Posted by doopsnoop View Post
    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 by slashin8r ; 11-18-2019 at 06:30 PM.
     

  6. Collapse Details
    Re: Rpcs3 
    Junior Member
    MainSecondary
    Join Date
    Nov 2019
    Posts
    8
    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 by doopsnoop ; 11-18-2019 at 06:36 PM.
     

  7. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    Quote Originally Posted by doopsnoop View Post
    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"
    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...
     

  8. Collapse Details
    Re: Rpcs3 
    Junior Member
    MainSecondary
    Join Date
    Nov 2019
    Posts
    8
    Damned my RL version is 1.0.0.9
    RL.jpg
     

  9. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    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.
     

  10. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    You probably just need your AutoHotkey.dll file updated. I have mine attached.
    Attached Files Attached Files
     

  11. Collapse Details
    Re: Rpcs3 
    Junior Member
    MainSecondary
    Join Date
    Nov 2019
    Posts
    8
    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.
     

  12. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    Quote Originally Posted by doopsnoop View Post
    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.
    No problem. Was an easy fix once we figured out where the difference was.
     

  13. Collapse Details
    Re: Rpcs3 
    Junior Member
    MainSecondary
    Join Date
    Nov 2019
    Posts
    8
    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
    certainly a quick fix i'll search
     

  14. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    Quote Originally Posted by doopsnoop View Post
    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
    certainly a quick fix i'll search
    I don't personally use HyperSpin (currently using LaunchBox), but a quick search found this:
    http://www.rlauncher.com/wiki/index.php?title=HyperSpin
     

  15. Collapse Details
    Re: Rpcs3 
    Senior Member

    MainSecondary
    Join Date
    Jan 2015
    Posts
    158
    Last module from post #302 works great! Thank you!
     

  16. Collapse Details
    Re: Rpcs3 
    Junior Member
    MainSecondary
    Join Date
    Nov 2019
    Posts
    8
    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
     

  17. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    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.
     

  18. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    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 by slashin8r ; 11-21-2019 at 05:30 AM.
     

  19. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    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
     

  20. Collapse Details
    Re: Rpcs3 
    Member
    MainSecondary
    Join Date
    Jul 2016
    Posts
    80
    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 by slashin8r ; 11-23-2019 at 03:26 AM.
     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •