Advertisement
djvj

Untitled

Dec 27th, 2014
843
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.47 KB | None | 0 0
  1. MEmu = RetroArch
  2. MEmuV = v1.0.0.3
  3. MURL = http://themaister.net/retroarch.html
  4. MAuthor = djvj
  5. MVersion = 2.1.8
  6. MCRC = D32CC7D8
  7. iCRC = C3B20A93
  8. MID = 635038268922229162
  9. MSystem = "Atari 2600","Atari 5200","Atari 7800","Atari Jaguar","Atari Lynx","Bandai Wonderswan","Bandai Wonderswan Color","Commodore Amiga","Final Burn Alpha","MAME","Microsoft MSX","NEC PC Engine","NEC PC Engine-CD","NEC TurboGrafx-16","NEC SuperGrafx","NEC TurboGrafx-CD","Nintendo 64","Nintendo DS","Nintendo Entertainment System","Nintendo Famicom","Nintendo Famicom Disk System","Nintendo Game Boy","Nintendo Game Boy Color","Nintendo Game Boy Advance","Nintendo Super Game Boy","Nintendo Virtual Boy","Nintendo Super Famicom","Panasonic 3DO","Sega 32X","Sega CD","Sega Game Gear","Sega Genesis","Sega Master System","Sega Mega Drive","Sega Pico","Sony PlayStation","Sony PSP","Sega Saturn","Sega SG-1000","SNK Neo Geo","SNK Neo Geo MVS","SNK Neo Geo Pocket","SNK Neo Geo Pocket Color","Super Nintendo Entertainment System"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; If the emu doesn't load and you get no error, usually this means the LibRetro DLL is not working!
  13. ; Devs stated they will never add support for mounted images (like via DT)
  14. ; Fullscreen is controlled via the module setting in HLHQ
  15. ; This module uses the CLI version of RetroArch (retroarch.exe), not the GUI (retroarch-phoenix.exe).
  16. ; The emu may make a mouse cursor appear momentarily during launch, MouseMove and hide_cursor seem to have no effect
  17. ; Enable 7z support for archived roms
  18. ; Available CLI options: https://github.com/PyroFilmsFX/iOS/blob/master/docs/retroarch.1
  19. ;
  20. ; LibRetro DLLs:
  21. ; LibRetro DLLs come with the emu, but here is another source for them: http://forum.themaister.net/
  22. ; Whatever cores you decide to use, make sure they are extracted anywhere in your Emu_Path folder (place them in a LibRetros subfolder if you like). The module will find and load the core you choose for each system.
  23. ; You can find supported cores that Retroarch supports simply by downloading them from the "retroarch-phoenix.exe" or by visiting here: https://github.com/libretro/libretro.github.com/wiki/Supported-cores
  24. ; Some good discussion on cores and filters: http://forum.themaister.net/viewtopic.php?id=270
  25. ; The module's LibRetro settings in HLHQ need to match the name of that core for each system you use this emu. Read the tooltips to see the default one used when they are not customized by you.
  26. ;
  27. ; SRM files:
  28. ; srm are stored in a "srm" dir in the emu folder. Each system ran through retroarch gets its own folder inside srm
  29. ;
  30. ; Save states:
  31. ; Save states are stored in a "save" dir in the emu folder. Each system ran through retroarch gets its own folder inside save
  32. ;
  33. ; Config files:
  34. ; RetroArch will use per-system cfg files named to match your System Name. The global one is "retroarch.cfg" but the module will search for cfg files in any of the emu's subfolders. If system ones exist, they take precedence over retroarch.cfg.
  35. ; This allows different settings for each system you use this emulator for. If you want all systems to use the same retroarch.cfg, do not have any system named cfg files, or just create ones for the systems you want custom settings.
  36. ;
  37. ; System Specific Notes:
  38. ; Nintendo Famicom Disk System - Requires disksys.rom be placed in the folder you define as system_directory in the RetroArch's cfg.
  39. ; Sega CD - Requires "bios_CD_E.bin", "bios_CD_J.bin", "bios_CD_U.bin" all be placed in the folder you define as system_directory in the RetroArch's cfg.
  40. ; Super Nintendo Entertainment System - requires split all 10 dsp# & st### roms all be placed in the folder you define as system_directory in the RetroArch's cfg. Many games, like Super Mario Kart require these.
  41. ; NEC TurboGrafx-CD - Requires "syscard3.pce" be placed in the folder you define as system_directory in the RetroArch's cfg.
  42. ; Nintendo Super Game Boy - Set the Module setting in HLHQ SuperGameBoy to true to enable a system or only a rom to use SGB mode. This is not needed if your systemName is set to the official name of "Nintendo Super Game Boy". Requires "sgb.boot.rom" and "Super Game Boy (World).sfc" to be placed in the folder you define as system_directory in the RetroArch's cfg. This is needed if you want to use Super game boy mode and color palettes. Also requires using the latest bsnes core. Not all games support SGB mode.
  43. ; MAME: Turn off the nag screen by running a game, then press F1 and go to core options and switch off the nag screen there.
  44. ;----------------------------------------------------------------------------
  45. StartModule()
  46. BezelGUI()
  47. FadeInStart()
  48.  
  49. ; This object controls how the module reacts to different systems. RetroArch can play a lot of systems, but needs to know what system you want to run, so this module has to adapt.
  50. mType := Object("Atari 2600","LibRetro_2600","Atari 5200","LibRetro_5200","Atari 7800","LibRetro_7800","Atari Jaguar","LibRetro_JAG","Atari Lynx","LibRetro_LYNX","Atari ST","LibRetro_ST","Bandai Wonderswan","LibRetro_WSAN","Bandai Wonderswan Color","LibRetro_WSANC","Commodore Amiga","LibRetro_PUAE","Final Burn Alpha","LibRetro_FBA","MAME","LibRetro_MAME","Microsoft MSX","Libretro_MSX","NEC PC Engine","LibRetro_PCE","NEC PC Engine-CD","LibRetro_PCECD","NEC SuperGrafx","LibRetro_SGFX","NEC TurboGrafx-16","LibRetro_TG16","NEC TurboGrafx-CD","LibRetro_TGCD","Nintendo 64","LibRetro_N64","Nintendo DS","LibRetro_DS","Nintendo Entertainment System","LibRetro_NES","Nintendo Famicom","LibRetro_NFAM","Nintendo Famicom Disk System","LibRetro_NFDS","Nintendo Game Boy","LibRetro_GB","Nintendo Game Boy Color","LibRetro_GBC","Nintendo Game Boy Advance","LibRetro_GBA","Nintendo Super Famicom","LibRetro_NSF","Nintendo Super Game Boy","LibRetro_SGB","Nintendo Virtual Boy","LibRetro_NVB","Panasonic 3DO","LibRetro_3DO","Sega 32X","LibRetro_32X","Sega CD","LibRetro_SCD","Sega Game Gear","LibRetro_GG","Sega Genesis","LibRetro_GEN","Sega Mega Drive","LibRetro_GEN","Sega Master System","LibRetro_SMS","Sega Pico","LibRetro_PICO","Sony PlayStation","LibRetro_PSX","Sony PSP","LibRetro_PSP","Sega Saturn","LibRetro_SAT","Sega SG-1000","LibRetro_SG1K","SNK Neo Geo","LibRetro_NEO","SNK Neo Geo Pocket","LibRetro_NGP","SNK Neo Geo Pocket Color","LibRetro_NGPC","Super Nintendo Entertainment System","LibRetro_SNES")
  51. ident := mType[systemName] ; search object for the systemName identifier Retroarch uses for its cores
  52. If !ident
  53. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for this " . MEmu . " module: " . moduleName)
  54.  
  55. settingsFile := modulePath . "\" . moduleName . ".ini"
  56. Fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  57. hideConsole := IniReadCheck(settingsFile, "Settings", "HideConsole","true",,1)
  58. ; SystemConfigs := IniReadCheck(settingsFile, "Settings", "SystemConfigs","true",,1) ; If true,
  59. messRomPath := IniReadCheck(settingsFile, "Settings", "MESS_BIOS_Roms_Folder",,,1)
  60. libRetroFolder := IniReadCheck(settingsFile, "Settings", "LibRetroFolder", emuPath,,1)
  61. LibRetro_2600 := IniReadCheck(settingsFile, "Settings", "LibRetro_2600","stella_libretro",,1)
  62. LibRetro_5200 := IniReadCheck(settingsFile, "Settings", "LibRetro_5200","mess_libretro",,1)
  63. LibRetro_7800 := IniReadCheck(settingsFile, "Settings", "LibRetro_7800","prosystem_libretro",,1)
  64. LibRetro_32X := IniReadCheck(settingsFile, "Settings", "LibRetro_32X","picodrive_libretro",,1) ; picodrive is the 32x core, not genesis plus
  65. LibRetro_3DO := IniReadCheck(settingsFile, "Settings", "LibRetro_3DO","4do_libretro",,1)
  66. LibRetro_DS := IniReadCheck(settingsFile, "Settings", "LibRetro_DS","desmume_libretro",,1)
  67. LibRetro_FBA := IniReadCheck(settingsFile, "Settings", "LibRetro_FBA","fb_alpha_libretro",,1)
  68. LibRetro_GB := IniReadCheck(settingsFile, "Settings", "LibRetro_GB","gambatte_libretro",,1)
  69. LibRetro_GBC := IniReadCheck(settingsFile, "Settings", "LibRetro_GBC","gambatte_libretro",,1)
  70. LibRetro_GBA := IniReadCheck(settingsFile, "Settings", "LibRetro_GBA","vba_next_libretro",,1)
  71. LibRetro_GEN := IniReadCheck(settingsFile, "Settings", "LibRetro_GEN","genesis_plus_gx_libretro",,1)
  72. LibRetro_GG := IniReadCheck(settingsFile, "Settings", "LibRetro_GG","genesis_plus_gx_libretro",,1)
  73. LibRetro_JAG := IniReadCheck(settingsFile, "Settings", "LibRetro_JAG","virtualjaguar_libretro",,1)
  74. LibRetro_LYNX := IniReadCheck(settingsFile, "Settings", "LibRetro_LYNX","handy_libretro",,1)
  75. LibRetro_MAME := IniReadCheck(settingsFile, "Settings", "LibRetro_MAME","mame_libretro",,1)
  76. LibRetro_MSX := IniReadCheck(settingsFile, "Settings", "LibRetro_MSX","bluemsx_libretro",,1)
  77. LibRetro_N64 := IniReadCheck(settingsFile, "Settings", "LibRetro_N64","mupen64plus_libretro",,1)
  78. LibRetro_NEO := IniReadCheck(settingsFile, "Settings", "LibRetro_NEO","fb_alpha_libretro",,1)
  79. LibRetro_NES := IniReadCheck(settingsFile, "Settings", "LibRetro_NES","nestopia_libretro",,1)
  80. LibRetro_NFAM := IniReadCheck(settingsFile, "Settings", "LibRetro_NFAM","nestopia_libretro",,1)
  81. LibRetro_NFDS := IniReadCheck(settingsFile, "Settings", "LibRetro_NFDS","nestopia_libretro",,1)
  82. LibRetro_NSF := IniReadCheck(settingsFile, "Settings", "LibRetro_NSF","bsnes_balanced_libretro",,1)
  83. LibRetro_NVB := IniReadCheck(settingsFile, "Settings", "LibRetro_NVB","mednafen_vb_libretro",,1)
  84. LibRetro_NGP := IniReadCheck(settingsFile, "Settings", "LibRetro_NGP","mednafen_ngp_libretro",,1)
  85. LibRetro_NGPC := IniReadCheck(settingsFile, "Settings", "LibRetro_NGPC","mednafen_ngp_libretro",,1)
  86. LibRetro_PCE := IniReadCheck(settingsFile, "Settings", "LibRetro_PCE","mednafen_pce_fast_libretro",,1)
  87. LibRetro_PCECD := IniReadCheck(settingsFile, "Settings", "LibRetro_PCECD","mednafen_pce_fast_libretro",,1)
  88. LibRetro_PICO := IniReadCheck(settingsFile, "Settings", "LibRetro_PICO","picodrive_libretro",,1)
  89. LibRetro_PSP := IniReadCheck(settingsFile, "Settings", "LibRetro_PSP","ppsspp_libretro",,1)
  90. LibRetro_PSX := IniReadCheck(settingsFile, "Settings", "LibRetro_PSX","mednafen_psx_libretro",,1)
  91. LibRetro_PUAE := IniReadCheck(settingsFile, "Settings", "LibRetro_PUAE","puae_libretro",,1)
  92. LibRetro_SAT := IniReadCheck(settingsFile, "Settings", "LibRetro_SAT","yabause_libretro",,1)
  93. LibRetro_SCD := IniReadCheck(settingsFile, "Settings", "LibRetro_SCD","genesis_plus_gx_libretro",,1)
  94. LibRetro_SG1K := IniReadCheck(settingsFile, "Settings", "LibRetro_SG1K","genesis_plus_gx_libretro",,1)
  95. LibRetro_SGB := IniReadCheck(settingsFile, "Settings", "LibRetro_SGB","bsnes_balanced_libretro",,1)
  96. LibRetro_SGFX := IniReadCheck(settingsFile, "Settings", "LibRetro_SGFX","mednafen_pce_fast_libretro",,1)
  97. LibRetro_SMS := IniReadCheck(settingsFile, "Settings", "LibRetro_SMS","genesis_plus_gx_libretro",,1)
  98. LibRetro_SNES := IniReadCheck(settingsFile, "Settings", "LibRetro_SNES","bsnes_balanced_libretro",,1)
  99. LibRetro_ST := IniReadCheck(settingsFile, "Settings", "LibRetro_ST","hatari_libretro",,1)
  100. LibRetro_TG16 := IniReadCheck(settingsFile, "Settings", "LibRetro_TG16","mednafen_pce_fast_libretro",,1)
  101. LibRetro_TGCD := IniReadCheck(settingsFile, "Settings", "LibRetro_TGCD","mednafen_pce_fast_libretro",,1)
  102. LibRetro_WSAN := IniReadCheck(settingsFile, "Settings", "LibRetro_WSAN","mednafen_wswan_libretro",,1)
  103. LibRetro_WSANC := IniReadCheck(settingsFile, "Settings", "LibRetro_WSANC","mednafen_wswan_libretro",,1)
  104. superGB := IniReadCheck(settingsFile, systemName . "|" . romName, "SuperGameBoy", "false",,1)
  105. messRomPath := GetFullName(messRomPath)
  106. libRetroFolder := GetFullName(libRetroFolder)
  107.  
  108. retroArchSystem := systemName
  109.  
  110. If (ident = "LibRetro_SGB" || If superGB = "true") ; if system or rom is set to use Super Game Boy
  111. { superGB = true ; setting this just in case it's false and the system is Nintendo Super Game Boy
  112. sgbRomPath := CheckFile(emuPath . "\system\Super Game Boy (World).sfc","Could not find the rom required for Super Game Boy support. Make sure the rom ""Super Game Boy (World).sfc"" is located in: " . emupath . "\system")
  113. CheckFile(emuPath . "\system\sgb.boot.rom","Could not find the bios required for Super Game Boy support. Make sure the bios ""sgb.boot.rom"" is located in: " . emupath . "\system")
  114. ident := "LibRetro_SGB" ; switching to Super Game Boy mode
  115. retroArchSystem := "Nintendo Super Game Boy"
  116. }
  117.  
  118. ; Find the cfg file to use
  119. Loop, %emuPath%\*.cfg,,1 ; loop through all folder in emuPath
  120. If (A_LoopFileName = retroArchSystem . ".cfg") {
  121. sysRetroCfg := A_LoopFileLongPath
  122. Break ; retroArchSystem configs are preferred, so break after one is found
  123. } Else If (A_LoopFileName = "retroarch.cfg")
  124. globalRetroCfg := A_LoopFileLongPath
  125. retroCFGFile := If sysRetroCfg ? sysRetroCfg : globalRetroCfg
  126. Log(MEmu . " is using " . retroCFGFile . " as it's config file.")
  127.  
  128. ; Find the dll for this system
  129. Loop, %libRetroFolder%\*.dll,,1 ; loop through all folder in emuPath looking for the ident dll
  130. If (A_LoopFileName = %ident% . ".dll") {
  131. libDll := A_LoopFileLongPath
  132. Break
  133. }
  134. If !libDll
  135. ScriptError("Your " . ident . " dll is set to " . %ident% . " but could not locate this file in any folder inside:`n" . libRetroFolder)
  136.  
  137. If ident In LibRetro_NFDS,LibRetro_SCD,LibRetro_TGCD,LibRetro_PCECD
  138. { retroCFG := LoadProperties(retroCFGFile) ; load the config into memory
  139. retroSysDir := ReadProperty(retroCFG,"system_directory") ; read value
  140. retroSysDir := ConvertRetroCFGKey(retroSysDir) ; remove dbl quotes
  141. StringLeft, retroSysDirLeft, retroSysDir, 2
  142. If (retroSysDirLeft = ":\") { ; if retroarch is set to use a default folder
  143. StringTrimLeft, retroSysDir, retroSysDir, 1
  144. Log("Module - RetroArch is using a relative system path: """ . retroSysDir . """")
  145. retroSysDir := emuPath . retroSysDir
  146. }
  147. If !retroSysDir
  148. ScriptError("RetroArch requires you to set your system_directory and place bios rom(s) in there for """ . retroArchSystem . """ to function. Please do this first by running ""retroarch-phoenix.exe"" manually.")
  149. StringRight, checkForSlash, retroSysDir, 1
  150. If (checkForSlash = "\") ; check if a backslash is the last character. If it is, remove it, as this is non-standard method to define folders
  151. StringTrimRight, retroSysDir, retroSysDir, 1
  152. }
  153.  
  154. If InStr(ident, "LibRetro_N64") { ; these systems will use an ini to store game specific settings
  155. sysSettingsFile := CheckSysFile(modulePath . "\" . systemName . ".ini") ; create the ini if it does not exist
  156. If InStr(ident, "LibRetro_N64") { ; Nintendo 64
  157. mupenGfx := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Gfx_Plugin", "auto",,1)
  158. mupenRsp := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_RSP_Plugin", "auto",,1)
  159. mupenCpu := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_CPU_Core", "dynamic_recompiler",,1)
  160. mupenPak1 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_1", "memory",,1)
  161. mupenPak2 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_2", "memory",,1)
  162. mupenPak3 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_3", "memory",,1)
  163. mupenPak4 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_4", "memory",,1)
  164. mupenGfxAccur := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Gfx_Accuracy", "high",,1)
  165. mupenExpMem := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Disable_Exp_Memory", "no",,1)
  166. mupenTexturFilt := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Texture_Filtering", "nearest",,1)
  167. mupenViRefresh := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_VI_Refresh", "2200",,1)
  168. mupenFramerate := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Framerate", "fullspeed",,1)
  169.  
  170. coreOptionsCFGFile := CheckFile(emuPath . "\configs\.retroarch-core-options.cfg", "Could not find .retroarch-core-options.cfg in configs directory")
  171. coreOptionsCFG := LoadProperties(coreOptionsCFGFile)
  172.  
  173. WriteProperty(coreOptionsCFG, "mupen64-gfxplugin", mupenGfx, 1)
  174. WriteProperty(coreOptionsCFG, "mupen64-rspplugin", mupenRsp, 1)
  175. WriteProperty(coreOptionsCFG, "mupen64-cpucore", mupenCpu, 1)
  176. WriteProperty(coreOptionsCFG, "mupen64-pak1", mupenPak1, 1)
  177. WriteProperty(coreOptionsCFG, "mupen64-pak2", mupenPak2, 1)
  178. WriteProperty(coreOptionsCFG, "mupen64-pak3", mupenPak3, 1)
  179. WriteProperty(coreOptionsCFG, "mupen64-pak4", mupenPak4, 1)
  180. WriteProperty(coreOptionsCFG, "mupen64-gfxplugin-accuracy", mupenGfxAccur, 1)
  181. WriteProperty(coreOptionsCFG, "mupen64-disableexpmem", mupenExpMem, 1)
  182. WriteProperty(coreOptionsCFG, "mupen64-filtering", mupenTexturFilt, 1)
  183. WriteProperty(coreOptionsCFG, "mupen64-virefresh", mupenViRefresh, 1)
  184. WriteProperty(coreOptionsCFG, "mupen64-framerate", mupenFramerate, 1)
  185.  
  186. SaveProperties(coreOptionsCFGFile, coreOptionsCFG)
  187. }
  188. }
  189.  
  190. hideEmuObj := Object("ahk_class ConsoleWindowClass",0,"RetroArch ahk_class RetroArch",1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  191. 7z(romPath, romName, romExtension, 7zExtractPath)
  192.  
  193. ; MESS core options
  194. messIdent :=
  195. messParam1 :=
  196. messParam2 :=
  197. messParam3 :=
  198. If InStr(%ident%, "mess") { ; if a mess core is used
  199. Log("Module - Retroarch MESS mode enabled")
  200. ; the messType object links the system name to the name mess recognizes
  201. messType := Object("Amstrad GX4000","gx4000","APF Imagination Machine","apfimag","Apple IIGS","apple2gs","Atari 8-bit","a800","Atari 2600","a2600","Atari 5200","a5200","Atari 7800","a7800","Atari Jaguar","jaguar","Atari Lynx","lynx","Bally Astrocade","astrocde","Bandai WonderSwan","wswan","Bandai WonderSwan Color","wscolor","Casio PV-1000","pv1000","Casio PV-2000","pv2000","Coleco ADAM","adam","ColecoVision","coleco","Creatronic Mega Duck","megaduck","Emerson Arcadia 2001","arcadia","Entex Adventure Vision","advision","Epoch Game Pocket Computer","gamepock","Epoch Super Cassette Vision","scv","Exidy Sorcerer","sorcerer","Fairchild Channel F","channelf","Funtech Super Acan","supracan","GCE Vectrex","vectrex","Hartung Game Master","gmaster","Interton VC 4000","vc4000","JungleTac Sport Vii","vii","Magnavox Odyssey 2","odyssey2","Matra & Hachette Alice","alice32","Mattel Aquarius","aquarius","Mattel Intellivision","intv","NEC PC Engine","pce","NEC PC Engine-CD","pce","NEC SuperGrafx","sgx","NEC TurboGrafx-16","tg16","NEC TurboGrafx-CD","tg16","Nintendo 64","n64","Nintendo Entertainment System","nes","Nintendo Famicom Disk System","famicom","Nintendo Game Boy","gameboy","Nintendo Game Boy Advance","gba","Nintendo Game Boy Color","gbcolor","Nintendo Virtual Boy","vboy","Philips CD-i","cdimono1","RCA Studio II","studio2","Sega 32X","32x","Sega CD","segacd","Sega Game Gear","gamegear","Sega Genesis","genesis","Sega Master System","sms","Sega Mega Drive","megadriv","SNK Neo Geo AES","aes","SNK Neo Geo CD","neocdz","SNK Neo Geo Pocket","ngp","SNK Neo Geo Pocket Color","ngpc","Sony PlayStation","psx","Sord M5","m5","Super Nintendo Entertainment System","snes","Texas Instruments TI 99-4A","ti99_4a","Tiger Game.com","gamecom","Tomy Tutor","tutor","VTech CreatiVision","crvision","Watara Supervision","svision")
  202. messIdent := messType[systemName] ; search object for the systemName identifier Retroarch uses for its cores
  203. If !messIdent
  204. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for the MESS LibRetro core")
  205. Else
  206. Log("Module - MESS mode using a known ident: " . messIdent)
  207.  
  208. If !messRomPath
  209. ScriptError("Please set the RetroArch module setting ""MESS_BIOS_Roms_Folder"" to the folder that contains your MESS BIOS roms to use MESS with RetroArch.")
  210.  
  211. messParam1 :=
  212. messParam2 := " -rompath \" . """" . messRomPath . "\" . """"
  213. messParam3 := " -cart \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  214. fullRomPath := messParam1 . messParam2 . messParam3
  215. } Else If (superGB = "true") {
  216. Log("Module - Retroarch Super Game Boy mode enabled")
  217. fullRomPath := " """ . sgbRomPath . """ -g """ . romPath . "\" . romName . romExtension . """"
  218. } Else {
  219. Log("Module - Retroarch standard mode enabled")
  220. fullRomPath := " """ . romPath . "\" . romName . romExtension . """"
  221. }
  222.  
  223. If ident = LibRetro_NFDS ; Nintendo Famicom Disk System
  224. { IfNotExist, %retroSysDir%\disksys.rom
  225. ScriptError("RetroArch requires ""disksys.rom"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  226. } Else If ident = LibRetro_SCD ; Sega CD
  227. { If romExtension Not In .bin,.cue,.iso
  228. ScriptError("RetroArch only supports Sega CD games in bin|cue|iso format. It does not support:`n" . romExtension)
  229. IfNotExist, %retroSysDir%\bios_CD_E.bin
  230. ScriptError("RetroArch requires ""bios_CD_E.bin"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  231. IfNotExist, %retroSysDir%\bios_CD_U.bin
  232. ScriptError("RetroArch requires ""bios_CD_U.bin"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  233. IfNotExist, %retroSysDir%\bios_CD_J.bin
  234. ScriptError("RetroArch requires ""bios_CD_J.bin"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  235. } Else If ident in LibRetro_PCECD,LibRetro_TGCD ; NEC PC Engine-CD and NEC TurboGrafx-CD
  236. { If romExtension Not In .ccd,.cue
  237. ScriptError("RetroArch only supports " . retroArchSystem . " games in ccd or cue format. It does not support:`n" . romExtension)
  238. IfNotExist, %retroSysDir%\syscard3.pce
  239. ScriptError("RetroArch requires ""syscard3.pce"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  240. }
  241.  
  242. ; WriteProperty(retroCFGFile,"system_directory","""D:\test""") ; write a new value to the RetroArch cfg file
  243. ; SaveProperty() ; save RetroArch cfg file to disk
  244.  
  245. BezelStart()
  246.  
  247. fullscreen := If fullscreen = "true" ? " -f" : ""
  248. srmPath := emuPath . "\srm\" . retroArchSystem ; path for this system's srm files
  249. saveStatePath := emuPath . "\save\" . retroArchSystem ; path for this system's save state files
  250.  
  251. IfNotExist, %srmPath%
  252. FileCreateDir, %srmPath% ; creating srm dir if it doesn't exist
  253. IfNotExist, %saveStatePath%
  254. FileCreateDir, %saveStatePath% ; creating save dir if it doesn't exist
  255.  
  256. HideEmuStart() ; This fully ensures windows are completely hidden even faster than winwait
  257.  
  258. ; Run(executable . " """ . (If superGB = "true" ? sgbRomPath . """ -g """ : "") . romPath . "\" . romName . romExtension . """" . fullscreen . " -c """ . retroCFGFile . """ -L """ . libDll . """ -s """ . srmPath . "\" . romName . ".srm"" -S """ . saveStatePath . "\" . romName . ".state""", emuPath, "Hide")
  259. ; Run(executable . " -L " . """" . libDll . """ " . """" . "a5200 -cart \" . """" . fullRomPath . "\" . """ " . """" . fullscreen . """" . " -c """ . retroCFGFile . """ -s """ . srmPath . "\" . romName . ".srm"" -S """ . saveStatePath . "\" . romName . ".state", emuPath, "Hide")
  260. Run(executable . A_Space . (messIdent ? messIdent : "") . fullRomPath . fullscreen . " -c """ . retroCFGFile . """ -L """ . libDll . """ -s """ . srmPath . "\" . romName . ".srm"" -S """ . saveStatePath . "\" . romName . ".state""", emuPath, "Hide")
  261.  
  262. WinWait("RetroArch ahk_class RetroArch")
  263. WinWaitActive("RetroArch ahk_class RetroArch")
  264.  
  265. If hideConsole = true
  266. WinSet, Transparent, On, ahk_class ConsoleWindowClass ; makes the console window transparent so you don't see it on exit
  267.  
  268. BezelDraw()
  269. HideEmuEnd()
  270. FadeInExit()
  271. Process("WaitClose", executable)
  272. 7zCleanUp()
  273. BezelExit()
  274. FadeOutExit()
  275. ExitModule()
  276.  
  277.  
  278. ; Used to convert between RetroArch keys and usable data
  279. ConvertRetroCFGKey(txt,direction="read"){
  280. Global emuPath
  281. If direction = read
  282. { StringTrimLeft,newtxt,txt,1 ; removes the " from the left of the txt
  283. StringTrimRight,newtxt,newtxt,1 ; removes the " from the right of the txt
  284. If InStr(newtxt,":") { ; if the path contains a ":" then it is a relative path
  285. Log("ConvertRetroCFGKey - " . newtxt . " is a relative path",4)
  286. StringTrimLeft,newtxt,newtxt,1 ; removes the : from the left of the txt
  287. newtxt := AbsoluteFromRelative(emuPath, "." . newtxt) ; convert relative to absolute
  288. }
  289. If InStr(newtxt,"/")
  290. StringReplace,newtxt,newtxt,/,\,1 ; replaces all forward slashes with backslashes
  291. } Else If direction = write
  292. { newtxt = "%txt%" ; wraps the txt with ""
  293. If InStr(newtxt,"\")
  294. StringReplace,newtxt,newtxt,\,/,1 ; replaces all backslashes with forward slashes
  295. } Else
  296. ScriptError("Not a valid use of ConvertRetroCFGKey. Only ""read"" or ""write"" are supported.")
  297. Log("ConvertRetroCFGKey - Converted " . txt . " to " . newtxt,4)
  298. Return newtxt
  299. }
  300.  
  301. ; This will simply create a new blank ini if one does not exist
  302. CheckSysFile(file){
  303. IfNotExist, %file%
  304. FileAppend,, %file%
  305. Return file
  306. }
  307.  
  308. CloseProcess:
  309. FadeOutStart()
  310. ; Send !{F4}
  311. WinClose("RetroArch ahk_class RetroArch")
  312. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement