Advertisement
omegaprimal1

Untitled

Jun 13th, 2021
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.31 KB | None | 0 0
  1. MEmu := "RPCS3"
  2. MEmuV := "v0.0.7-9151-9dab0575 Alpha"
  3. MURL := ["https://rpcs3.net"]
  4. MAuthor := ["slashin8r", "wallmachine", "jviegas", "brolly", "aurel102001"]
  5. MVersion := "1.0.18"
  6. MDate := "2019-11-18"
  7. MCRC := ""
  8. iCRC := ""
  9. MID := ""
  10. MSystem := ["Sony Playstation 3"]
  11. ;----------------------------------------------------------------------------
  12. ; Notes:
  13. ; [IMPORTANT]
  14. ; To run games without the use of 7z
  15. ;
  16. ; 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.
  17. ; 2) Add the "lnk" (LNK) extension for the RPCS3 emulator within RocketLauncher.
  18. ; 3) Generate a new database based on the new rom path.
  19. ; 4) Audit all games for the system and enjoy.
  20. ; [IMPORTANT]
  21. ;
  22. ;
  23. ;
  24. ; 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.
  25. ; PPU file saved in: %romPath%\cache\%romName%_%A_ComputerName%.7z
  26. ; Game Data file saved in: %romPath%\data\%romName%_data.7z
  27. ;
  28. ; Example:
  29. ; Rom File = "D:\PS3\PS3 Test Game.rar"
  30. ; A_ComputerName = "PC001"
  31. ;
  32. ; PPU File = "D:\PS3\cache\PS3 Test Game_PC001.7z")
  33. ; Game Data File = "D:\PS3\data\PS3 Test Game_data.7z")
  34. ;
  35. ;
  36. ;
  37. ; Coming Soon:
  38. ; 1) Settings file to customize all additional options.
  39. ; 2) Progress bars on fade screen for all additional 7z processes.
  40. ;----------------------------------------------------------------------------
  41.  
  42. StartModule()
  43. BezelGUI()
  44. FadeInStart()
  45.  
  46. primaryExe := new Emulator(emuPath . "\" . executable)
  47. primaryWindowClassName := "Qt5QWindowIcon"
  48. emuPrimaryWindow := new Window(new WindowTitle(,primaryWindowClassName, executable))
  49. emuGameWindow := new Window(new WindowTitle("FPS"))
  50.  
  51. ; Finding emulator config file
  52. Rpcs3config := new File(emuPath . "\config.yml")
  53. Rpcs3config.CheckFile("Could not find RPCS3 config.yml! Run your emulator, go to Settings and save them.")
  54.  
  55. ; Finding emulator games file
  56. Rpcs3games := new File(emuPath . "\games.yml")
  57. Rpcs3games.CheckFile("Could not find RPCS3 games.yml! Update this file with your list of game serials and game installation directories.")
  58.  
  59. BezelStart()
  60.  
  61. hideEmuObj := Object(emuPrimaryWindow,1)
  62. HideAppStart(hideEmuObj,hideEmu)
  63.  
  64. ; Find game location
  65. gameFolder := romPath
  66. If (sevenZEnabled = "true" && romExtension != ".lnk")
  67. {
  68. gameFolder := sevenZExtractPath . "\" . romName
  69. If (sevenZAttachSystemName = "true")
  70. {
  71. gameFolder := sevenZExtractPath . "\" . systemName . "\" . romName
  72. }
  73. }
  74.  
  75. ; Set variables
  76. gameSevenZEnabled := sevenZEnabled
  77. gameType := ""
  78. gameSerial := ""
  79. originalRomPath := romPath
  80. gameDirectoryJunction := "false"
  81. gamePPU := "false"
  82. gamePPUromPath := romPath . "\cache\" . romName . "_" . A_ComputerName . ".7z"
  83. gamePPUemuPath := emuPath . "\cache"
  84. gameDATA := "false"
  85. gameDATAromPath := romPath . "\data\" . romName . "_data.7z"
  86. gameDATAemuPath := emuPath . "\dev_hdd0\game"
  87.  
  88. ;MsgBox, gamePPUromPath: %gamePPUromPath%`ngamePPUemuPath: %gamePPUemuPath%`ngameDATAromPath: %gameDATAromPath%`ngameDATAemuPath: %gameDATAemuPath%
  89.  
  90. ; Extract PPU files if they exist
  91. If (gameSevenZEnabled = "true" && Fileexist(gamePPUromPath))
  92. {
  93. romExSize := RLObject.getZipExtractedSize(gamePPUromPath)
  94. use7zAnimation := "true"
  95. Gosub, UpdateFadeFor7z
  96. RunWait, %ComSpec% /c ""%sevenZPath%" x "%gamePPUromPath%" -aos -o"%gamePPUemuPath%", sevenZPID, Hide
  97. gamePPU := "true"
  98. }
  99.  
  100. ; Extract Game Data files if they exist
  101. If (gameSevenZEnabled = "true" && Fileexist(gameDATAromPath))
  102. {
  103. romExSize := RLObject.getZipExtractedSize(gameDATAromPath)
  104. use7zAnimation := "true"
  105. Gosub, UpdateFadeFor7z
  106. RunWait, %ComSpec% /c ""%sevenZPath%" x "%gameDATAromPath%" -aos -o"%gameDATAemuPath%", sevenZPID, Hide
  107. gameDATA := "true"
  108. }
  109.  
  110. 7z(romPath, romName, romExtension, sevenZExtractPath)
  111.  
  112. romFolder := romPath
  113. If (romExtension = ".lnk" && Fileexist(romPath . "\" . romName . romExtension))
  114. {
  115. FileGetShortCut, %romPath%\%romName%%romExtension%, shortcutTarget
  116. StringReplace, romFolder, shortcutTarget, \EBOOT.BIN
  117. }
  118.  
  119. ; Find the game location and determine the type of game (disc or hdd)
  120. StringRight, stringTest, romFolder, 6
  121. If (stringTest = "USRDIR")
  122. {
  123. gameType := "game"
  124. StringReplace, romFolder, romFolder, \USRDIR
  125. StringRight, stringTest, romFolder, 8
  126. If (stringTest = "PS3_GAME")
  127. {
  128. gameType := "disc"
  129. StringReplace, romFolder, romFolder, \PS3_GAME
  130. }
  131. If (sevenZEnabled != "true")
  132. {
  133. StringRight, gameSerial, romFolder, 9
  134.  
  135. ; Create the directory junction
  136. If (!Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial))
  137. {
  138. If (gameSerial != "" && gameType != "")
  139. {
  140. RunWait, %ComSpec% /c "mklink /J "%emuPath%\dev_hdd0\%gameType%\%gameSerial%" "%gameFolder%", , Hide
  141. gameDirectoryJunction := "true"
  142. }
  143. Else
  144. {
  145. 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.")
  146. }
  147. }
  148. }
  149. }
  150. Else If (sevenZEnabled = "true" && (romPath = originalRomPath || romPath = ""))
  151. {
  152. 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.")
  153. }
  154.  
  155. ;MsgBox, romPath: %romPath%`nromName: %romName%`nromExtension: %romExtension%`ngameType: %gameType%`ngameSerial: %gameSerial%`ngameDirectoryJunction: %gameDirectoryJunction%`ngamePPU: %gamePPU%`ngameDATA: %gameDATA%`nsevenZEnabled: %sevenZEnabled%`ngameSevenZEnabled: %gameSevenZEnabled%
  156.  
  157. ; Run the game
  158. If (Fileexist(romPath . "\EBOOT.BIN"))
  159. {
  160. primaryExe.Run(" """ . romPath . "\EBOOT.BIN""")
  161. }
  162. Else If (Fileexist(romPath . "\" . romName . ".BIN"))
  163. {
  164. primaryExe.Run(" """ . romPath . "\" . romName . ".BIN""")
  165. }
  166. Else If (Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\PS3_GAME\USRDIR\EBOOT.BIN"))
  167. {
  168. primaryExe.Run(" """ . emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\PS3_GAME\USRDIR\EBOOT.BIN""")
  169. }
  170. Else If (Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\USRDIR\EBOOT.BIN"))
  171. {
  172. primaryExe.Run(" """ . emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial . "\USRDIR\EBOOT.BIN""")
  173. }
  174. Else If (Fileexist(romPath . "\" . romName . romExtension))
  175. {
  176. primaryExe.Run(" """ . romPath . "\" . romName . romExtension . """")
  177. }
  178. Else
  179. {
  180. 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.")
  181. }
  182.  
  183. ; Waiting for main emulator window
  184. emuPrimaryWindow.Wait()
  185. emuPrimaryWindow.Active()
  186. emuPrimaryWindow.WaitActive()
  187.  
  188. If (sevenZEnabled = "true")
  189. {
  190. ; Find the game serial
  191. If (Fileexist(emuPath . "\games.yml") && gameSerial = "")
  192. {
  193. Loop, read, %emuPath%\games.yml
  194. {
  195. StringReplace, gameLine, A_LoopReadLine, /, \, All
  196. IfInString, gameLine, %gameFolder%
  197. {
  198. StringLeft, gameSerial, gameLine, 9
  199. break
  200. }
  201. }
  202. }
  203.  
  204. ; Create the directory junction
  205. If (!Fileexist(emuPath . "\dev_hdd0\" . gameType . "\" . gameSerial))
  206. {
  207. If (gameSerial != "" && gameType != "")
  208. {
  209. RunWait, %ComSpec% /c "mklink /J "%emuPath%\dev_hdd0\%gameType%\%gameSerial%" "%gameFolder%", , Hide
  210. gameDirectoryJunction := "true"
  211. }
  212. Else
  213. {
  214. 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.")
  215. }
  216. }
  217. }
  218.  
  219. ; Waiting 5 seconds to see if compiling window appears
  220. If (gameSerial != "" && gamePPU != "true")
  221. {
  222. WinWait, Compiling, , 5
  223. If (!ErrorLevel)
  224. {
  225. WinWaitClose, Compiling
  226. }
  227. }
  228.  
  229. ; Waiting for emulator game window
  230. emuGameWindow.Wait()
  231. emuGameWindow.Active()
  232. emuGameWindow.WaitActive()
  233.  
  234. BezelDraw()
  235. HideAppEnd(hideEmuObj,hideEmu)
  236. FadeInExit()
  237. primaryExe.Process("WaitClose")
  238. 7zCleanUp()
  239.  
  240. ; Remove the directory junction
  241. If (sevenZDelTemp = "true" && gameDirectoryJunction = "true")
  242. {
  243. RunWait, %ComSpec% /c "rmdir "%emuPath%\dev_hdd0\%gameType%\%gameSerial%", , Hide
  244. }
  245.  
  246. ; Remove the PPU files if they were extracted or creates PPU compressed file if needed
  247. If (sevenZDelTemp = "true" && gamePPU = "true" && gameSerial != "")
  248. {
  249. IfExist, %gamePPUemuPath%\%gameSerial%
  250. {
  251. FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
  252. }
  253. }
  254. Else If (gameSevenZEnabled = "true" && gameSerial != "")
  255. {
  256. IfExist, %gamePPUemuPath%\%gameSerial%
  257. {
  258. IfNotExist, %gamePPUromPath%
  259. {
  260. RunWait, %ComSpec% /c ""%sevenZPath%" a "%gamePPUromPath%" "%gamePPUemuPath%\%gameSerial%", , Hide
  261. }
  262. If (sevenZDelTemp = "true")
  263. {
  264. FileRemoveDir, %gamePPUemuPath%\%gameSerial%, 1
  265. }
  266. }
  267. }
  268.  
  269. ; Remove the Game Data files if they were extracted or creates Game Data compressed file if needed
  270. If (sevenZDelTemp = "true" && gameDATA = "true" && gameSerial != "" && gameType = "disc" && romExtension != ".lnk")
  271. {
  272. IfExist, %gameDATAemuPath%\%gameSerial%
  273. {
  274. FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
  275. }
  276. IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
  277. {
  278. FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
  279. }
  280. }
  281. Else If (gameSevenZEnabled = "true" && gameSerial != "" && gameType = "disc")
  282. {
  283. IfExist, %gameDATAemuPath%\%gameSerial%
  284. {
  285. IfNotExist, %gameDATAromPath%
  286. {
  287. RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%" -mx=0, , Hide
  288. }
  289. If (sevenZDelTemp = "true")
  290. {
  291. FileRemoveDir, %gameDATAemuPath%\%gameSerial%, 1
  292. }
  293. }
  294. IfExist, %gameDATAemuPath%\%gameSerial%GAMEDATA
  295. {
  296. IfNotExist, %gameDATAromPath%
  297. {
  298. RunWait, %ComSpec% /c ""%sevenZPath%" a "%gameDATAromPath%" "%gameDATAemuPath%\%gameSerial%GAMEDATA" -mx=0, , Hide
  299. }
  300. If (sevenZDelTemp = "true")
  301. {
  302. FileRemoveDir, %gameDATAemuPath%\%gameSerial%GAMEDATA, 1
  303. }
  304. }
  305. }
  306.  
  307. BezelExit()
  308. FadeOutExit()
  309. ExitModule()
  310.  
  311. CloseProcess:
  312. FadeOutStart()
  313. emuGameWindow.Close()
  314. emuPrimaryWindow.Close()
  315. Process, Close, %executable%
  316. Return
  317.  
  318. BezelLabel:
  319. disableHideBorder := "true"
  320. disableHideTitleBar := "true"
  321. disableHideToggleMenu := "true"
  322. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement