Guest User

Yuzu RL Module

a guest
Feb 3rd, 2018
1,061
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MEmu := "yuzu"
  2. MEmuV := "20180203-1a8f5bf"
  3. MURL := ["https://github.com/yuzu-emu/yuzu"]
  4. MAuthor := ["djvj","bleasby","tonesmalone"]
  5. MVersion := "1.0"
  6. MCRC := "9EF66675"
  7. iCRC := "86DE2C7A"
  8. MID := "635038268916444338"
  9. MSystem := ["Nintendo Switch"]
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; GitHub: https://github.com/yuzu-emu/yuzu
  13. ;
  14. ; Set the emulator exe to 'yuzu.exe'
  15. ; Use 'nso' extension for homebrew roms
  16. ;----------------------------------------------------------------------------
  17. StartModule()
  18. BezelGUI()
  19. FadeInStart()
  20.  
  21. primaryExe := new Emulator(emuPath . "\" . executable) ; instantiate emulator executable object
  22. primaryWindowClassName := "Qt5QWindowIcon"
  23. emuPrimaryWindow := new Window(new WindowTitle("yuzu Nightly",primaryWindowClassName)) ; instantiate primary emulator window object
  24. emuConsoleWindow := new Window(new WindowTitle(,"ConsoleWindowClass"))
  25.  
  26. Fullscreen := moduleIni.Read("Settings", "Fullscreen","true",,1)
  27.  
  28. YuzuIni := new IniFile(A_AppData . "\yuzu\config\qt-config.ini")
  29. YuzuIni.CheckFile("Could not find Yuzu's ini file. Please run Yuzu manually first and make sure that you use the module recommended emulator version.")
  30.  
  31. ; Disabling the emu exit confirmation
  32. confirmClose := YuzuIni.Read("UI", "confirmClose")
  33. If (confirmClose = "true")
  34. YuzuIni.Write("false", "UI", "confirmClose")
  35.  
  36. ; Setting the game to launch on an extra window.
  37. singleWindowMode := YuzuIni.Read("UI", "singleWindowMode")
  38. If (singleWindowMode = "true")
  39. YuzuIni.Write("false", "UI", "singleWindowMode")
  40.  
  41. BezelStart()
  42.  
  43. hideEmuObj := Object(emuConsoleWindow,0,emuPrimaryWindow,1)
  44.  
  45. 7z(romPath, romName, romExtension, SevenZExtractPath)
  46.  
  47. HideAppStart(hideEmuObj,hideEmu)
  48. primaryExe.Run("""" . romPath . "\" . romName . romExtension . """")
  49.  
  50. ; Waiting for main emu window
  51. emuPrimaryWindow.Wait()
  52. emuPrimaryWindow.WaitActive()
  53.  
  54. ; Hiding yuzu console window
  55. emuConsoleWindow.Set("Transparent",0)
  56.  
  57. ; Waiting for game to load
  58. TimeOut := 3000
  59. StartTime := A_TickCount
  60. Loop, {
  61. WinGet, IDList, List, ahk_class %primaryWindowClassName% ; get a list of all windows which match this windowTitle
  62. Loop, % IDList ; IDList set to number of matches found
  63. { id := IDList%A_Index%
  64. ControlGet, OutputVar, Hwnd,, Qt5QWindowOwnDCIcon1, ahk_id %id%
  65. If !ErrorLevel
  66. { gameWindowID := id
  67. Break
  68. }
  69. }
  70. If (TimeOut && A_TickCount - StartTime > TimeOut)
  71. Break
  72. }
  73. ; Saving id of extra emulator window to be hidden
  74. WinGet, IDList, List, ahk_class %primaryWindowClassName% ; Get a list of all windows which match this windowTitle
  75. Loop, % IDList ; IDList set to number of matches found
  76. { id := IDList%A_Index%
  77. If !(id = gameWindowID) {
  78. launchWindowID := id
  79. launchWindow := new Window(new WindowTitle(,,,launchWindowID))
  80. Break
  81. }
  82. }
  83.  
  84. ; Hiding extra emulator window
  85. If (launchWindowID) {
  86. launchWindow.Hide()
  87. }
  88.  
  89. ; Waiting for game window to be active if it is not
  90. gameWindow := new Window(new WindowTitle(,,,gameWindowID))
  91. gameWindow.WaitActive()
  92.  
  93. if (Fullscreen = "true"){ ; Creating fake full screen as the emu always launches in windowed mode
  94. WinGet emulatorID, ID, A
  95. emulatorWindow := new Window(new WindowTitle(,,,emulatorID))
  96. RLObject.hideWindowTitleBar(emulatorID)
  97. RLObject.hideWindowBorder(emulatorID)
  98. emulatorWindow.Move(0,0,A_screenWidth,A_screenHeight + 38)
  99. }
  100.  
  101. BezelDraw()
  102. HideAppEnd(hideEmuObj,hideEmu)
  103. FadeInExit()
  104. primaryExe.Process("WaitClose")
  105. 7zCleanUp()
  106. BezelExit()
  107. FadeOutExit()
  108. ExitModule()
  109.  
  110. CloseProcess:
  111. FadeOutStart()
  112. If (launchWindowID)
  113. launchWindow.Close()
  114. Else
  115. gameWindow.Close()
  116. Return
  117.  
  118. BezelLabel:
  119. disableHideBorder := "true"
  120. disableHideTitleBar := "true"
  121. disableHideToggleMenu := "true"
  122. Return
RAW Paste Data