Advertisement
djvj

Untitled

Jan 27th, 2015
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.14 KB | None | 0 0
  1. MEmu = RetroArch
  2. MEmuV = v12-25-2014 Nightly
  3. MURL = http://themaister.net/retroarch.html
  4. MAuthor = djvj,zerojay
  5. MVersion = 2.2.1
  6. MCRC = CE967CAD
  7. iCRC = 51E752D3
  8. MID = 635038268922229162
  9. MSystem = "AAE","Amstrad CPC","Amstrad GX4000","APF Imagination Machine","Atari 2600","Atari 5200","Atari 7800","Atari Jaguar","Atari Lynx","Atari ST","Bally Astrocade","Bandai Super Vision 8000","Bandai Wonderswan","Bandai Wonderswan Color","Casio PV-1000","Casio PV-2000","ColecoVision","Commodore Amiga","Creatronic Mega Duck","Dragon 64","Emerson Arcadia 2001","Entex Adventure Vision","Epoch Game Pocket Computer","Epoch Super Cassette Vision","Exidy Sorcerer","Fairchild Channel F","Final Burn Alpha","Funtech Super Acan","GamePark 32","GCE Vectrex","Hartung Game Master","JungleTac Sport Vii","MAME","Magnavox Odyssey 2","Microsoft MSX","Microsoft MSX2","Matra & Hachette Alice","Mattel Aquarius","Mattel Intellivision","NEC PC Engine","NEC PC Engine-CD","NEC PC-FX","NEC TurboGrafx-16","NEC SuperGrafx","NEC TurboGrafx-CD","Nintendo 64","Nintendo Arcade Systems","Nintendo DS","Nintendo Entertainment System","Nintendo Famicom","Nintendo Famicom Disk System","Nintendo Game Boy","Nintendo Game Boy Color","Nintendo Game Boy Japan","Nintendo Game Boy Advance","Nintendo Super Game Boy","Nintendo Pokemon Mini","Nintendo Virtual Boy","Nintendo Super Famicom","Nintendo Super Famicom Satellaview","Panasonic 3DO","Pecom 64","Philips CD-i","Philips Videopac","RCA Studio II","Sega 32X","Sega SC-3000","Sega SG-1000","Sega CD","Sega Game Gear","Sega Genesis","Sega Master System","Sega Mega Drive","Sega Pico","Sega Saturn","Sega Saturn Japan","Sega VMU","Sega ST-V","Sinclair ZX Spectrum","Sony PlayStation","Sony PocketStation","Sony PSP","Sord M5","SNK Neo Geo","SNK Neo Geo MVS","SNK Neo Geo AES","SNK Neo Geo Pocket","SNK Neo Geo CD","SNK Neo Geo Pocket Color","Spectravideo SV-328","Super Nintendo Entertainment System","Tandy TRS-80 Color Computer 3","Texas Instruments TI 99-4A","Thomson MO5","Tomy Tutor","VTech CreatiVision","Watara Supervision"
  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. ; Microsoft MSX/MSX2: Launch an MSX game and in the core options, set the console to be an MSX2 and it will play both just fine.
  39. ; Nintendo Famicom Disk System - Requires disksys.rom be placed in the folder you define as system_directory in the RetroArch's cfg.
  40. ; 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.
  41. ; 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.
  42. ; NEC TurboGrafx-CD - Requires "syscard3.pce" be placed in the folder you define as system_directory in the RetroArch's cfg.
  43. ; 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.
  44. ; 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.
  45. ;----------------------------------------------------------------------------
  46. StartModule()
  47. BezelGUI()
  48. FadeInStart()
  49.  
  50. ; 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.
  51. mType := Object("AAE","LibRetro_AAE","Amstrad CPC","LibRetro_CPC","Amstrad GX4000","LibRetro_GX4K","APF Imagination Machine","LibRetro_APF","Atari 2600","LibRetro_2600","Atari 5200","LibRetro_5200","Atari 7800","LibRetro_7800","Atari Jaguar","LibRetro_JAG","Atari Lynx","LibRetro_LYNX","Atari ST","LibRetro_ST","Bally Astrocade","LibRetro_BAST","Bandai Super Vision 8000","LibRetro_SV8K","Bandai Wonderswan","LibRetro_WSAN","Bandai Wonderswan Color","LibRetro_WSANC","Casio PV-1000","LibRetro_CAS1K","Casio PV-2000","LibRetro_CAS2K","ColecoVision","LibRetro_COLEC","Commodore Amiga","LibRetro_PUAE","Creatronic Mega Duck","LibRetro_DUCK","Dragon 64","LibRetro_DRAG64","Emerson Arcadia 2001","LibRetro_A2001","Entex Adventure Vision","LibRetro_AVISION","Epoch Game Pocket Computer","LibRetro_GPCKET","Epoch Super Cassette Vision","LibRetro_SCV","Exidy Sorcerer","LibRetro_SORCR","Fairchild Channel F","LibRetro_CHANF","Final Burn Alpha","LibRetro_FBA","Funtech Super Acan","LibRetro_SACAN","GamePark 32","LibRetro_GP32","GCE Vectrex","LibRetro_VECTX","Hartung Game Master","LibRetro_GMASTR","JungleTac Sport Vii","LibRddetro_SPORTV","MAME","LibRetro_MAME","Magnavox Odyssey 2","LibRetro_ODYS2","Mattel Aquarius","LibRetro_AQUA","Mattel Intellivision","LibRetro_INTV","MGT Sam Coupe","LibRetro_SAMCP","Microsoft MS-DOS","LibRetro_MSDOS","Microsoft MSX","LibRetro_MSX","Microsoft MSX2","LibRetro_MSX2","Microsoft Windows 3.x","LibRetro_WIN3X","Matra & Hachette Alice","LibRetro_ALICE","NEC PC Engine","LibRetro_PCE","NEC PC Engine-CD","LibRetro_PCECD","NEC PC-FX","LibRetro_PCFX","NEC SuperGrafx","LibRetro_SGFX","NEC TurboGrafx-16","LibRetro_TG16","NEC TurboGrafx-CD","LibRetro_TGCD","Nintendo 64","LibRetro_N64","Nintendo Arcade Systems","LibRetro_NINARC","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 Japan","LibRetro_GBJ","Nintendo Game Boy Advance","LibRetro_GBA","Nintendo Pokemon Mini","LibRetro_POKE","Nintendo Super Famicom","LibRetro_NSF","Nintendo Super Famicom Satellaview","LibRetro_NSFS","Nintendo Super Game Boy","LibRetro_SGB","Nintendo Virtual Boy","LibRetro_NVB","Panasonic 3DO","LibRetro_3DO","Pecom 64","LibRetro_P64","Philips CD-i","LibRetro_CDI","Philips Videopac","LibRetro_PVID","RCA Studio II","LibRetro_STUD2","SCUMMVM","LibRetro_SCUMM","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","Sega VMU","LibRetro_SVMU","Sony PlayStation","LibRetro_PSX","Sony PocketStation","LibRetro_POCKS","Sony PSP","LibRetro_PSP","Sega Saturn","LibRetro_SAT","Sega Saturn Japan","LibRetro_SAT","Sega SG-1000","LibRetro_SG1K","Sega SC-3000","LibRetro_SC3K","Sega ST-V","LibRetro_STV","SNK Neo Geo","LibRetro_NEO","SNK Neo Geo AES","LibRetro_NEOAES","SNK Neo Geo Pocket","LibRetro_NGP","SNK Neo Geo Pocket Color","LibRetro_NGPC","SNK Neo Geo CD","LibRetro_NEOCD","Sord M5","LibRetro_SORD","Spectravideo SV-328","LibRetro_SV328","Super Nintendo Entertainment System","LibRetro_SNES","Sinclair ZX Spectrum","LibRetro_SPECZX","Tandy TRS-80 Color Computer 3","LibRetro_TRS80","Texas Instruments TI 99-4A","LibRetro_TI99","Thomson MO5","LibRetro_MO5","Tomy Tutor","LibRetro_TOMY","VTech CreatiVision","LibRetro_VTECH","Watara Supervision","LibRetro_SUPRV")
  52. ident := mType[systemName] ; search object for the systemName identifier Retroarch uses for its cores
  53. If !ident
  54. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for this " . MEmu . " module: " . moduleName)
  55.  
  56. settingsFile := modulePath . "\" . moduleName . ".ini"
  57. Fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  58. hideConsole := IniReadCheck(settingsFile, "Settings", "HideConsole","true",,1)
  59. ; SystemConfigs := IniReadCheck(settingsFile, "Settings", "SystemConfigs","true",,1) ; If true,
  60. messRomPath := IniReadCheck(settingsFile, "Settings", "MESS_BIOS_Roms_Folder",,,1)
  61. useCoreConfigs := IniReadCheck(settingsFile, "Settings", "UseCoreConfigs","false",,1)
  62. libRetroFolder := IniReadCheck(settingsFile, "Settings", "LibRetroFolder", emuPath,,1)
  63. LibRetro_2600 := IniReadCheck(settingsFile, "Settings", "LibRetro_2600","stella_libretro",,1)
  64. LibRetro_5200 := IniReadCheck(settingsFile, "Settings", "LibRetro_5200","mess_libretro",,1)
  65. LibRetro_7800 := IniReadCheck(settingsFile, "Settings", "LibRetro_7800","prosystem_libretro",,1)
  66. LibRetro_32X := IniReadCheck(settingsFile, "Settings", "LibRetro_32X","picodrive_libretro",,1) ; picodrive is the 32x core, not genesis plus
  67. LibRetro_3DO := IniReadCheck(settingsFile, "Settings", "LibRetro_3DO","4do_libretro",,1)
  68. LibRetro_A2001 := IniReadCheck(settingsFile, "Settings", "LibRetro_A2001","mess_libretro",,1)
  69. LibRetro_AAE := IniReadCheck(settingsFile, "Settings", "LibRetro_AAE","mame_libretro",,1)
  70. LibRetro_ALICE := IniReadCheck(settingsFile, "Settings", "LibRetro_ALICE","mess_libretro",,1)
  71. LibRetro_APF := IniReadCheck(settingsFile, "Settings", "LibRetro_APF","mess_libretro",,1)
  72. LibRetro_AQUA := IniReadCheck(settingsFile, "Settings", "LibRetro_AQUA","mess_libretro",,1)
  73. LibRetro_AVISION := IniReadCheck(settingsFile, "Settings", "LibRetro_AVISION","mess_libretro",,1)
  74. LibRetro_BAST := IniReadCheck(settingsFile, "Settings", "LibRetro_BAST","mess_libretro",,1)
  75. LibRetro_CAS1K := IniReadCheck(settingsFile, "Settings", "LibRetro_CAS1K","mess_libretro",,1)
  76. LibRetro_CAS2K := IniReadCheck(settingsFile, "Settings", "LibRetro_CAS2K","mess_libretro",,1)
  77. LibRetro_CDI := IniReadCheck(settingsFile, "Settings", "LibRetro_CDI","mess_libretro",,1)
  78. LibRetro_CHANF := IniReadCheck(settingsFile, "Settings", "LibRetro_CHANF","mess_libretro",,1)
  79. LibRetro_COLEC := IniReadCheck(settingsFile, "Settings", "LibRetro_COLEC","mess_libretro",,1)
  80. LibRetro_CPC := IniReadCheck(settingsFile, "Settings", "LibRetro_CPC","mess_libretro",,1)
  81. LibRetro_DRAG64 := IniReadCheck(settingsFile, "Settings", "LibRetro_DRAG64","mess_libretro",,1)
  82. LibRetro_DS := IniReadCheck(settingsFile, "Settings", "LibRetro_DS","desmume_libretro",,1)
  83. LibRetro_DUCK := IniReadCheck(settingsFile, "Settings", "LibRetro_DUCK","mess_libretro",,1)
  84. LibRetro_FBA := IniReadCheck(settingsFile, "Settings", "LibRetro_FBA","fb_alpha_libretro",,1)
  85. LibRetro_GB := IniReadCheck(settingsFile, "Settings", "LibRetro_GB","gambatte_libretro",,1)
  86. LibRetro_GBC := IniReadCheck(settingsFile, "Settings", "LibRetro_GBC","gambatte_libretro",,1)
  87. LibRetro_GBA := IniReadCheck(settingsFile, "Settings", "LibRetro_GBA","vba_next_libretro",,1)
  88. LibRetro_GBJ := IniReadCheck(settingsFile, "Settings", "LibRetro_GBJ","gambatte_libretro",,1)
  89. LibRetro_GEN := IniReadCheck(settingsFile, "Settings", "LibRetro_GEN","genesis_plus_gx_libretro",,1)
  90. LibRetro_GG := IniReadCheck(settingsFile, "Settings", "LibRetro_GG","genesis_plus_gx_libretro",,1)
  91. LibRetro_GMASTR := IniReadCheck(settingsFile, "Settings", "LibRetro_GMASTR","mess_libretro",,1)
  92. LibRetro_GP32 := IniReadCheck(settingsFile, "Settings", "LibRetro_GP32","mess_libretro",,1)
  93. LibRetro_GPCKET := IniReadCheck(settingsFile, "Settings", "LibRetro_GPCKET","mess_libretro",,1)
  94. LibRetro_GX4K := IniReadCheck(settingsFile, "Settings", "LibRetro_GX4K","mess_libretro",,1)
  95. LibRetro_INTV := IniReadCheck(settingsFile, "Settings", "LibRetro_INTV","mess_libretro",,1)
  96. LibRetro_JAG := IniReadCheck(settingsFile, "Settings", "LibRetro_JAG","virtualjaguar_libretro",,1)
  97. LibRetro_LYNX := IniReadCheck(settingsFile, "Settings", "LibRetro_LYNX","handy_libretro",,1)
  98. LibRetro_MAME := IniReadCheck(settingsFile, "Settings", "LibRetro_MAME","mame_libretro",,1)
  99. LibRetro_MO5 := IniReadCheck(settingsFile, "Settings", "LibRetro_MO5","mess_libretro",,1)
  100. LibRetro_MSDOS := IniReadCheck(settingsFile, "Settings", "LibRetro_MSDOS","dosbox_libretro",,1)
  101. LibRetro_MSX := IniReadCheck(settingsFile, "Settings", "LibRetro_MSX","bluemsx_libretro",,1)
  102. LibRetro_MSX2 := IniReadCheck(settingsFile, "Settings", "LibRetro_MSX2","bluemsx_libretro",,1)
  103. LibRetro_N64 := IniReadCheck(settingsFile, "Settings", "LibRetro_N64","mupen64plus_libretro",,1)
  104. LibRetro_NEO := IniReadCheck(settingsFile, "Settings", "LibRetro_NEO","fb_alpha_libretro",,1)
  105. LibRetro_NEOCD := IniReadCheck(settingsFile, "Settings", "LibRetro_NEO","mess_libretro",,1)
  106. LibRetro_NEOAES := IniReadCheck(settingsFile, "Settings", "LibRetro_NEOAES","mess_libretro",,1)
  107. LibRetro_NES := IniReadCheck(settingsFile, "Settings", "LibRetro_NES","nestopia_libretro",,1)
  108. LibRetro_NFAM := IniReadCheck(settingsFile, "Settings", "LibRetro_NFAM","nestopia_libretro",,1)
  109. LibRetro_NFDS := IniReadCheck(settingsFile, "Settings", "LibRetro_NFDS","nestopia_libretro",,1)
  110. LibRetro_NSF := IniReadCheck(settingsFile, "Settings", "LibRetro_NSF","bsnes_balanced_libretro",,1)
  111. LibRetro_NSFS := IniReadCheck(settingsFile, "Settings", "LibRetro_NSFS","snes9x_libretro",,1)
  112. LibRetro_NVB := IniReadCheck(settingsFile, "Settings", "LibRetro_NVB","mednafen_vb_libretro",,1)
  113. LibRetro_NGP := IniReadCheck(settingsFile, "Settings", "LibRetro_NGP","mednafen_ngp_libretro",,1)
  114. LibRetro_NGPC := IniReadCheck(settingsFile, "Settings", "LibRetro_NGPC","mednafen_ngp_libretro",,1)
  115. LibRetro_NINARC := IniReadCheck(settingsFile, "Settings", "LibRetro_NINARC","mame_libretro",,1)
  116. LibRetro_ODYS2 := IniReadCheck(settingsFile, "Settings", "LibRetro_ODYS2","mess_libretro",,1)
  117. LibRetro_P64 := IniReadCheck(settingsFile, "Settings", "LibRetro_P64","mess_libretro",,1)
  118. LibRetro_PCE := IniReadCheck(settingsFile, "Settings", "LibRetro_PCE","mednafen_pce_fast_libretro",,1)
  119. LibRetro_PCECD := IniReadCheck(settingsFile, "Settings", "LibRetro_PCECD","mednafen_pce_fast_libretro",,1)
  120. LibRetro_PCFX := IniReadCheck(settingsFile, "Settings", "LibRetro_PCFX","mednafen_pcfx_libretro",,1)
  121. LibRetro_PICO := IniReadCheck(settingsFile, "Settings", "LibRetro_PICO","picodrive_libretro",,1)
  122. LibRetro_POCKS := IniReadCheck(settingsFile, "Settings", "LibRetro_POCKS","mess_libretro",,1)
  123. LibRetro_POKE := IniReadCheck(settingsFile, "Settings", "LibRetro_POKE","mess_libretro",,1)
  124. LibRetro_PSP := IniReadCheck(settingsFile, "Settings", "LibRetro_PSP","ppsspp_libretro",,1)
  125. LibRetro_PSX := IniReadCheck(settingsFile, "Settings", "LibRetro_PSX","mednafen_psx_libretro",,1)
  126. LibRetro_PUAE := IniReadCheck(settingsFile, "Settings", "LibRetro_PUAE","puae_libretro",,1)
  127. LibRetro_PVID := IniReadCheck(settingsFile, "Settings", "LibRetro_PVID","mess_libretro",,1)
  128. LibRetro_SACAN := IniReadCheck(settingsFile, "Settings", "LibRetro_SACAN","mess_libretro",,1)
  129. LibRetro_SAMCP := IniReadCheck(settingsFile, "Settings", "LibRetro_SAMCP","mess_libretro",,1)
  130. LibRetro_SAT := IniReadCheck(settingsFile, "Settings", "LibRetro_SAT","yabause_libretro",,1)
  131. LibRetro_SC3K := IniReadCheck(settingsFile, "Settings", "LibRetro_SC3K","mess_libretro",,1)
  132. LibRetro_SCD := IniReadCheck(settingsFile, "Settings", "LibRetro_SCD","genesis_plus_gx_libretro",,1)
  133. LibRetro_SCV := IniReadCheck(settingsFile, "Settings", "LibRetro_SCV","mess_libretro",,1)
  134. LibRetro_SCUMM := IniReadCheck(settingsFile, "Settings", "LibRetro_SCUMM","scummvm_libretro",,1)
  135. LibRetro_SG1K := IniReadCheck(settingsFile, "Settings", "LibRetro_SG1K","genesis_plus_gx_libretro",,1)
  136. LibRetro_SGB := IniReadCheck(settingsFile, "Settings", "LibRetro_SGB","bsnes_balanced_libretro",,1)
  137. LibRetro_SGFX := IniReadCheck(settingsFile, "Settings", "LibRetro_SGFX","mednafen_supergrafx_libretro",,1)
  138. LibRetro_SMS := IniReadCheck(settingsFile, "Settings", "LibRetro_SMS","genesis_plus_gx_libretro",,1)
  139. LibRetro_SNES := IniReadCheck(settingsFile, "Settings", "LibRetro_SNES","bsnes_balanced_libretro",,1)
  140. LibRetro_SORCR := IniReadCheck(settingsFile, "Settings", "LibRetro_SORCR","mess_libretro",,1)
  141. LibRetro_SORD := IniReadCheck(settingsFile, "Settings", "LibRetro_SORD","mess_libretro",,1)
  142. LibRetro_SPECZX := IniReadCheck(settingsFile, "Settings", "LibRetro_SPECZX","mess_libretro",,1)
  143. LibRetro_SPORTV := IniReadCheck(settingsFile, "Settings", "LibRetro_SPORTV","mess_libretro",,1)
  144. LibRetro_ST := IniReadCheck(settingsFile, "Settings", "LibRetro_ST","hatari_libretro",,1)
  145. LibRetro_STUD2 := IniReadCheck(settingsFile, "Settings", "LibRetro_STUD2","mess_libretro",,1)
  146. LibRetro_STV := IniReadCheck(settingsFile, "Settings", "LibRetro_STV","mame_libretro",,1)
  147. LibRetro_SV328 := IniReadCheck(settingsFile, "Settings", "LibRetro_SV328","mess_libretro",,1)
  148. LibRetro_SV8K := IniReadCheck(settingsFile, "Settings", "LibRetro_SV8K","mess_libretro",,1)
  149. LibRetro_SVMU := IniReadCheck(settingsFile, "Settings", "LibRetro_SVMU","mess_libretro",,1)
  150. LibRetro_SUPRV := IniReadCheck(settingsFile, "Settings", "LibRetro_SUPRV","mess_libretro",,1)
  151. LibRetro_TG16 := IniReadCheck(settingsFile, "Settings", "LibRetro_TG16","mednafen_pce_fast_libretro",,1)
  152. LibRetro_TGCD := IniReadCheck(settingsFile, "Settings", "LibRetro_TGCD","mednafen_pce_fast_libretro",,1)
  153. LibRetro_TI99 := IniReadCheck(settingsFile, "Settings", "LibRetro_TI99","mess_libretro",,1)
  154. LibRetro_TOMY := IniReadCheck(settingsFile, "Settings", "LibRetro_TOMY","mess_libretro",,1)
  155. LibRetro_TRS80 := IniReadCheck(settingsFile, "Settings", "LibRetro_TRS80","mess_libretro",,1)
  156. LibRetro_VECTX := IniReadCheck(settingsFile, "Settings", "LibRetro_VECTX","mess_libretro",,1)
  157. LibRetro_VTECH := IniReadCheck(settingsFile, "Settings", "LibRetro_VTECH","mess_libretro",,1)
  158. LibRetro_WIN3X := IniReadCheck(settingsFile, "Settings", "LibRetro_WIN3X","dosbox_libretro",,1)
  159. LibRetro_WSAN := IniReadCheck(settingsFile, "Settings", "LibRetro_WSAN","mednafen_wswan_libretro",,1)
  160. LibRetro_WSANC := IniReadCheck(settingsFile, "Settings", "LibRetro_WSANC","mednafen_wswan_libretro",,1)
  161. superGB := IniReadCheck(settingsFile, systemName . "|" . romName, "SuperGameBoy","false",,1)
  162. enableNetworkPlay := IniReadCheck(settingsFile, "Network|" . romName, "Enable_Network_Play","false",,1)
  163. overlay := IniReadCheck(settingsFile, systemName . "|" . romName, "Overlay",,,1)
  164. videoShader := IniReadCheck(settingsFile, systemName . "|" . romName, "VideoShader",,,1)
  165. aspectRatioIndex := IniReadCheck(settingsFile, systemName . "|" . romName, "AspectRatioIndex",,,1)
  166. customViewportWidth := IniReadCheck(settingsFile, systemName . "|" . romName, "CustomViewportWidth",,,1)
  167. customViewportHeight := IniReadCheck(settingsFile, systemName . "|" . romName, "CustomViewportHeight",,,1)
  168. customViewportX := IniReadCheck(settingsFile, systemName . "|" . romName, "CustomViewportX",,,1)
  169. customViewportY := IniReadCheck(settingsFile, systemName . "|" . romName, "CustomViewportY",,,1)
  170.  
  171.  
  172. messRomPath := GetFullName(messRomPath)
  173. libRetroFolder := If libRetroFolder ? GetFullName(libRetroFolder) : emuPath
  174. overlay := GetFullName(overlay)
  175. videoShader := GetFullName(videoShader)
  176.  
  177. retroArchSystem := systemName
  178.  
  179. If ((ident = "LibRetro_LYNX") or (ident = "wsan")) {
  180. rotateScreen := IniReadCheck(settingsFile, romName, "RotateScreen","None",,1)
  181. }
  182.  
  183. If (ident = "LibRetro_SGB" || If superGB = "true") ; if system or rom is set to use Super Game Boy
  184. { superGB = true ; setting this just in case it's false and the system is Nintendo Super Game Boy
  185. sgbRomPath := CheckFile(libRetroFolder . "\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: " . libRetroFolder . "\system")
  186. CheckFile(libRetroFolder . "\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: " . libRetroFolder . "\system")
  187. ident := "LibRetro_SGB" ; switching to Super Game Boy mode
  188. retroArchSystem := "Nintendo Super Game Boy"
  189. }
  190.  
  191. ; Find the dll for this system
  192. libDll := CheckFile(libRetroFolder . "\cores\" . %ident% . ".dll", "Your " . ident . " dll is set to " . %ident% . " but could not locate this file in any folder inside:`n" . libRetroFolder)
  193.  
  194. ; Find the cfg file to use
  195. globalRetroCfg := libRetroFolder . "\retroarch.cfg\"
  196. systemRetroCfg := libRetroFolder . "\config\" . retroArchSystem . ".cfg"
  197. coreRetroCfg := libRetroFolder . "\config\" . %ident% . ".dll.cfg"
  198. If FileExist(systemRetroCfg) ; check for system cfg first
  199. retroCFGFile := systemRetroCfg
  200. Else If (useCoreConfigs && FileExist(coreRetroCfg)) ; 2nd option is a core config
  201. retroCFGFile := coreRetroCfg
  202. Else { ; 3rd is global cfg
  203. retroCFGFile := globalRetroCfg
  204. }
  205. Log(MEmu . " is using " . retroCFGFile . " as its config file.")
  206.  
  207. retroCFG := LoadProperties(retroCFGFile) ; load the config into memory
  208. raCfgHasChanges :=
  209. If overlay {
  210. WriteProperty(retroCFG, "input_overlay", overlay,1,1)
  211. raCfgHasChanges := 1
  212. }
  213. If videoShader {
  214. WriteProperty(retroCFG, "video_shader", videoShader,1,1)
  215. raCfgHasChanges := 1
  216. }
  217. If aspectRatioIndex {
  218. WriteProperty(retroCFG, "aspect_ratio_index", aspectRatioIndex,1,1)
  219. raCfgHasChanges := 1
  220. }
  221. If customViewportWidth {
  222. WriteProperty(retroCFG, "custom_viewport_width", customViewportWidth,1,1)
  223. raCfgHasChanges := 1
  224. }
  225. If customViewportHeight {
  226. WriteProperty(retroCFG, "custom_viewport_height", customViewportHeight,1,1)
  227. raCfgHasChanges := 1
  228. }
  229. If customViewportX {
  230. WriteProperty(retroCFG, "custom_viewport_x", customViewportX,1,1)
  231. raCfgHasChanges := 1
  232. }
  233. If customViewportY {
  234. WriteProperty(retroCFG, "custom_viewport_y", customViewportY,1,1)
  235. raCfgHasChanges := 1
  236. }
  237. If raCfgHasChanges
  238. SaveProperties(retroCFGFile, retroCFG)
  239.  
  240. If RegExMatch(ident, "LibRetro_NFDS|LibRetro_SCD|LibRetro_TGCD|LibRetro_PCECD|LibRetro_PCFX") { ; these systems require the retroarch settings to be read
  241. retroSysDir := ReadProperty(retroCFG,"system_directory") ; read value
  242. retroSysDir := ConvertRetroCFGKey(retroSysDir) ; remove dbl quotes
  243. StringLeft, retroSysDirLeft, retroSysDir, 2
  244. If (retroSysDirLeft = ":\") { ; if retroarch is set to use a default folder
  245. StringTrimLeft, retroSysDir, retroSysDir, 1
  246. Log("Module - RetroArch is using a relative system path: """ . retroSysDir . """")
  247. retroSysDir := emuPath . retroSysDir
  248. }
  249. If !retroSysDir
  250. 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.")
  251. StringRight, checkForSlash, retroSysDir, 1
  252. If (checkForSlash = "\") ; check if a backslash is the last character. If it is, remove it, as this is non-standard method to define folders
  253. StringTrimRight, retroSysDir, retroSysDir, 1
  254. }
  255.  
  256. If (RegExMatch(ident, "LibRetro_N64|LibRetro_NES|LibRetro_LYNX|LibRetro_PSX") || RegExMatch(ident, "LibRetro_NES") && (InStr(%ident%, "nestopia_libretro"))) { ; these systems will use an ini to store game specific settings
  257. sysSettingsFile := CheckSysFile(modulePath . "\" . systemName . ".ini") ; create the ini if it does not exist
  258. coreOptionsCFGFile := CheckFile(libRetroFolder . "\retroarch-core-options.cfg", "Could not find retroarch-core-options.cfg in retroarch directory")
  259. coreOptionsCFG := LoadProperties(coreOptionsCFGFile)
  260. If InStr(ident, "LibRetro_N64") { ; Nintendo 64
  261. mupenGfx := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Gfx_Plugin", "auto",,1)
  262. mupenRsp := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_RSP_Plugin", "auto",,1)
  263. mupenCpu := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_CPU_Core", "dynamic_recompiler",,1)
  264. mupenPak1 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_1", "memory",,1)
  265. mupenPak2 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_2", "memory",,1)
  266. mupenPak3 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_3", "memory",,1)
  267. mupenPak4 := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Pak_4", "memory",,1)
  268. mupenGfxAccur := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Gfx_Accuracy", "high",,1)
  269. mupenExpMem := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Disable_Exp_Memory", "no",,1)
  270. mupenTexturFilt := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Texture_Filtering", "nearest",,1)
  271. mupenViRefresh := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_VI_Refresh", "2200",,1)
  272. mupenFramerate := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Framerate", "fullspeed",,1)
  273. mupenResolution := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Resolution", "640x480",,1)
  274. mupenPolyOffstFctr := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Polygon_Offset_Factor", "-3.0",,1)
  275. mupenPolyOffstUnts := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Polygon_Offset_Units", "-3.0",,1)
  276. mupenViOverlay := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_VI_Overlay", "disabled",,1)
  277. mupenAnalogDzone := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Mupen_Analog_Deadzone", "15",,1)
  278.  
  279. WriteProperty(coreOptionsCFG, "mupen64-gfxplugin", mupenGfx, 1)
  280. WriteProperty(coreOptionsCFG, "mupen64-rspplugin", mupenRsp, 1)
  281. WriteProperty(coreOptionsCFG, "mupen64-cpucore", mupenCpu, 1)
  282. WriteProperty(coreOptionsCFG, "mupen64-pak1", mupenPak1, 1)
  283. WriteProperty(coreOptionsCFG, "mupen64-pak2", mupenPak2, 1)
  284. WriteProperty(coreOptionsCFG, "mupen64-pak3", mupenPak3, 1)
  285. WriteProperty(coreOptionsCFG, "mupen64-pak4", mupenPak4, 1)
  286. WriteProperty(coreOptionsCFG, "mupen64-gfxplugin-accuracy", mupenGfxAccur, 1)
  287. WriteProperty(coreOptionsCFG, "mupen64-disableexpmem", mupenExpMem, 1)
  288. WriteProperty(coreOptionsCFG, "mupen64-filtering", mupenTexturFilt, 1)
  289. WriteProperty(coreOptionsCFG, "mupen64-virefresh", mupenViRefresh, 1)
  290. WriteProperty(coreOptionsCFG, "mupen64-framerate", mupenFramerate, 1)
  291. WriteProperty(coreOptionsCFG, "mupen64-screensize", mupenResolution, 1)
  292. WriteProperty(coreOptionsCFG, "mupen64-polyoffset-factor", mupenPolyOffstFctr, 1)
  293. WriteProperty(coreOptionsCFG, "mupen64-polyoffset-units", mupenPolyOffstUnts, 1)
  294. WriteProperty(coreOptionsCFG, "mupen64-angrylion-vioverlay", mupenViOverlay, 1)
  295. WriteProperty(coreOptionsCFG, "mupen64-astick-deadzone", mupenAnalogDzone, 1)
  296. } Else If InStr(ident, "LibRetro_NES") { ; these systems will use an ini to store game specific settings
  297. If InStr(%ident%, "nestopia_libretro") { ; Nestopia
  298. nestopiaBlargg := IniReadCheck(sysSettingsFile, "Nestopia" . "|" . romName, "Nestopia_Blargg_NTSC_Filter", "disabled",,1)
  299. nestopiaPalette := IniReadCheck(sysSettingsFile, "Nestopia" . "|" . romName, "Nestopia_Palette", "canonical",,1)
  300. nestopiaNoSprteLimit := IniReadCheck(sysSettingsFile, "Nestopia" . "|" . romName, "Nestopia_Remove_Sprites_Limit", "disabled",,1)
  301.  
  302. WriteProperty(coreOptionsCFG, "nestopia_blargg_ntsc_filter", nestopiaBlargg, 1)
  303. WriteProperty(coreOptionsCFG, "nestopia_palette", nestopiaPalette, 1)
  304. WriteProperty(coreOptionsCFG, "nestopia_nospritelimit", nestopiaNoSprteLimit, 1)
  305. }
  306. } Else If InStr(ident, "LibRetro_LYNX") { ; Atari Lynx
  307. handyRotate := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "Handy_Rotation", "None",,1)
  308.  
  309. WriteProperty(coreOptionsCFG, "handy_rot", handyRotate, 1)
  310. } Else If InStr(ident, "LibRetro_PSX") { ; Sony PlayStation
  311. p1ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P1_Controller_Type", """517""",,1)
  312. p2ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P2_Controller_Type", """517""",,1)
  313. p3ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P3_Controller_Type", """517""",,1)
  314. p4ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P4_Controller_Type", """517""",,1)
  315. p5ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P5_Controller_Type", """517""",,1)
  316. p6ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P6_Controller_Type", """517""",,1)
  317. p7ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P7_Controller_Type", """517""",,1)
  318. p8ControllerType := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "P8_Controller_Type", """517""",,1)
  319.  
  320. psxCdImageCache := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "PSX_CD_Image_Cache", """enabled""",,1)
  321. psxMemcardHandling := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "PSX_Memcard_Handling", """libretro""",,1)
  322. psxDualshockAnalogToggle := IniReadCheck(sysSettingsFile, systemName . "|" . romName, "PSX_Dualshock_Analog_Toggle", """enabled""",,1)
  323.  
  324. mednafenOptionsCFGFile := CheckFile(libRetroFolder . "\config\" . LibRetro_PSX . ".dll.cfg", "Could not find core configuration file in config directory.")
  325. mednafenOptionsCFG := LoadProperties(mednafenOptionsCFGFile)
  326.  
  327. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p1", p1ControllerType, 1)
  328. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p2", p2ControllerType, 1)
  329. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p3", p3ControllerType, 1)
  330. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p4", p4ControllerType, 1)
  331. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p5", p5ControllerType, 1)
  332. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p6", p6ControllerType, 1)
  333. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p7", p7ControllerType, 1)
  334. WriteProperty(mednafenOptionsCFG, "input_libretro_device_p8", p8ControllerType, 1)
  335.  
  336. SaveProperties(mednafenOptionsCFGFile, mednafenOptionsCFG)
  337.  
  338. WriteProperty(coreOptionsCFG, "beetle_psx_cdimagecache", psxCdImageCache, 1)
  339. WriteProperty(coreOptionsCFG, "beetle_psx_use_mednafen_memcard0_method", psxMemcardHandling, 1)
  340. WriteProperty(coreOptionsCFG, "beetle_psx_analog_toggle", psxDualshockAnalogToggle, 1)
  341. }
  342. SaveProperties(coreOptionsCFGFile, coreOptionsCFG)
  343. }
  344.  
  345. 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
  346. 7z(romPath, romName, romExtension, 7zExtractPath)
  347.  
  348. ; MESS core options
  349. messIdent :=
  350. messParam1 :=
  351. messParam2 :=
  352. messParam3 :=
  353. If InStr(%ident%, "mess") { ; if a mess core is used
  354. Log("Module - Retroarch MESS mode enabled")
  355. ; the messType object links the system name to the name mess recognizes
  356. messType := Object("Amstrad CPC","cpc464","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 Super Vision 8000","sv8000","Bandai WonderSwan","wswan","Bandai WonderSwan Color","wscolor","Casio PV-1000","pv1000","Casio PV-2000","pv2000","Coleco ADAM","adam","ColecoVision","coleco","Creatronic Mega Duck","megaduck","Dragon 64","dragon64","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","GamePark 32","gp32","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 Game Boy Japan","gameboy","Nintendo Pokemon Mini","pokemini","Nintendo Virtual Boy","vboy","Pecom 64","pecom64","Philips CD-i","cdimono1","Philips Videopac","videopac","RCA Studio II","studio2","Sega 32X","32x","Sega SC-3000","sc3000","Sega CD","segacd","Sega Game Gear","gamegear","Sega Genesis","genesis","Sega Master System","sms","Sega Mega Drive","megadriv","Sega VMU","svmu","Sinclair ZX Spectrum","spectrum","SNK Neo Geo AES","aes","SNK Neo Geo CD","neocdz","SNK Neo Geo Pocket","ngp","SNK Neo Geo Pocket Color","ngpc","Sony PlayStation","psx","Sony PocketStation","pockstat","Sord M5","m5","Spectravideo SV-328","svi328n","Super Nintendo Entertainment System","snes","Tandy TRS-80 Color Computer 3","coco3","Texas Instruments TI 99-4A","ti99_4a","Tiger Game.com","gamecom","Thomson MO5","mo5","Tomy Tutor","tutor","VTech CreatiVision","crvision","Watara Supervision","svision")
  357. messIdent := messType[systemName] ; search object for the systemName identifier Retroarch uses for its cores
  358. If !messIdent
  359. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for the MESS LibRetro core")
  360. Else
  361. Log("Module - MESS mode using a known ident: " . messIdent)
  362.  
  363. If !messRomPath
  364. 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.")
  365.  
  366. messParam1 :=
  367. messParam2 := " -rompath \" . """" . messRomPath . "\" . """"
  368. If messIdent = alice32
  369. messParam3 := " -cass1 \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  370. If messIdent = gp32
  371. messParam3 := " -memc \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  372. Else If messIdent = cpc464
  373. messParam3 := " -cass \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  374. Else If messIdent = spectrum
  375. messParam3 := " -cass \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  376. Else If messIdent = dragon64
  377. messParam3 := " -cass \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  378. Else If messIdent = cdimono1
  379. messParam3 := " -cdrom \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  380. Else If messIdent = neocd
  381. messParam3 := " -cdrom \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  382. Else If messIdent = neocdz
  383. messParam3 := " -cdrom \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  384. Else If messIdent = svi328n
  385. messParam3 := " -cass \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  386. Else If messIdent = pecom64
  387. messParam3 := " -cass \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  388. Else If messIdent = svmu
  389. messParam3 := " -quik \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  390. Else
  391. messParam3 := " -cart \" . """" . romPath . "\" . romName . romExtension . "\" . """"
  392.  
  393. fullRomPath := messParam1 . messParam2 . messParam3
  394. } Else If (superGB = "true") {
  395. Log("Module - Retroarch Super Game Boy mode enabled")
  396. fullRomPath := " """ . sgbRomPath . """ --subsystem sgb """ . romPath . "\" . romName . romExtension . """"
  397. } Else {
  398. Log("Module - Retroarch standard mode enabled")
  399. fullRomPath := " """ . romPath . "\" . romName . romExtension . """"
  400. }
  401.  
  402. If ident = LibRetro_NFDS ; Nintendo Famicom Disk System
  403. { IfNotExist, %retroSysDir%\disksys.rom
  404. ScriptError("RetroArch requires ""disksys.rom"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  405. } Else If ident = LibRetro_SCD ; Sega CD
  406. { If romExtension Not In .bin,.cue,.iso
  407. ScriptError("RetroArch only supports Sega CD games in bin|cue|iso format. It does not support:`n" . romExtension)
  408. IfNotExist, %retroSysDir%\bios_CD_E.bin
  409. ScriptError("RetroArch requires ""bios_CD_E.bin"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  410. IfNotExist, %retroSysDir%\bios_CD_U.bin
  411. ScriptError("RetroArch requires ""bios_CD_U.bin"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  412. IfNotExist, %retroSysDir%\bios_CD_J.bin
  413. ScriptError("RetroArch requires ""bios_CD_J.bin"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  414. } Else If ident in LibRetro_PCECD,LibRetro_TGCD ; NEC PC Engine-CD and NEC TurboGrafx-CD
  415. { If romExtension Not In .ccd,.cue
  416. ScriptError("RetroArch only supports " . retroArchSystem . " games in ccd or cue format. It does not support:`n" . romExtension)
  417. IfNotExist, %retroSysDir%\syscard3.pce
  418. ScriptError("RetroArch requires ""syscard3.pce"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  419. } Else If ident = LibRetro_PCFX
  420. { If romExtension Not In .ccd,.cue
  421. ScriptError("RetroArch only supports " . retroArchSystem . " games in ccd or cue format. It does not support:`n" . romExtension)
  422. IfNotExist, %retroSysDir%\pcfxbios.bin
  423. ScriptError("RetroArch requires ""pcfxbios.bin"" for " . retroArchSystem . " but could not find it in your system_directory: """ . retroSysDir . """")
  424. }
  425.  
  426.  
  427. networkSession :=
  428. If (enableNetworkPlay = "true") {
  429. Log("Module - Network Multi-Player is an available option for " . dbName,4)
  430.  
  431. netplayNickname := IniReadCheck(settingsFile, "Network", "NetPlay_Nickname","Player",,1)
  432. getWANIP := IniReadCheck(settingsFile, "Network", "Get_WAN_IP","false",,1)
  433.  
  434. If (getWANIP = "true")
  435. myPublicIP := GetPublicIP()
  436.  
  437. Log("Module - CAREFUL WHEN POSTING THIS LOG PUBLICALY AS IT CONTAINS YOUR IP ON THE NEXT LINE",2)
  438. defaultServerIP := IniReadCheck(settingsFile, "Network", "Default_Server_IP", myPublicIP,,1)
  439. defaultServerPort := IniReadCheck(settingsFile, "Network", "Default_Server_Port",,,1)
  440. lastIP := IniReadCheck(settingsFile, "Network", "Last_IP", defaultServerIP,,1) ; does not need to be on the ISD
  441. lastPort := IniReadCheck(settingsFile, "Network", "Last_Port", defaultServerPort,,1) ; does not need to be on the ISD
  442.  
  443. mpMenuStatus := MultiPlayerMenu(lastIP,lastPort,networkType,,0)
  444. If (mpMenuStatus = -1) { ; if user exited menu early
  445. Log("Module - Cancelled MultiPlayer Menu. Exiting module.",2)
  446. ExitModule()
  447. }
  448. If networkSession {
  449. Log("Module - Using a Network for " . dbName,4)
  450. IniWrite, %networkPort%, %settingsFile%, Network, Last_Port
  451. ; msgbox lastIP: %lastIP%`nlastPort: %lastPort%`nnetworkIP: %networkIP%`nnetworkPort: %networkPort%
  452. If (networkType = "client") {
  453. IniWrite, %networkIP%, %settingsFile%, Network, Last_IP ; Save last used IP and Port for quicker launching next time
  454. netCommand := " -C " . networkIP . " --port " . networkPort . " --nick """ . netplayNickname . """" ; -C = connect as client
  455. } Else { ; server
  456. netCommand := " -H --port " . networkPort . " --nick """ . netplayNickname . """" ; -H = host as server
  457. }
  458. Log("Module - CAREFUL WHEN POSTING THIS LOG PUBLICALY AS IT CONTAINS YOUR IP ON THE NEXT LINE",2)
  459. Log("Module - Starting a network session using the IP """ . networkIP . """ and PORT """ . networkPort . """",4)
  460. } Else
  461. Log("Module - User chose Single Player mode for this session",4)
  462. }
  463.  
  464. BezelStart()
  465.  
  466. fullscreen := If fullscreen = "true" ? " -f" : ""
  467. srmPath := libRetroFolder . "\srm\" . retroArchSystem ; path for this system's srm files
  468. saveStatePath := libRetroFolder . "\save\" . retroArchSystem ; path for this system's save state files
  469.  
  470. IfNotExist, %srmPath%
  471. FileCreateDir, %srmPath% ; creating srm dir if it doesn't exist
  472. IfNotExist, %saveStatePath%
  473. FileCreateDir, %saveStatePath% ; creating save dir if it doesn't exist
  474.  
  475. HideEmuStart() ; This fully ensures windows are completely hidden even faster than winwait
  476.  
  477. If InStr(%ident%, "mess") { ; if a mess core is used
  478. Run(executable . " """ . (messIdent ? messIdent : "") . fullRomPath . """" . A_Space . fullscreen . " -c """ . retroCFGFile . """ -L """ . libDll . """ -s """ . srmPath . "\" . romName . ".srm"" -S """ . saveStatePath . "\" . romName . ".state""" . netCommand, emuPath, "Hide")
  479. } Else If (ident = "LibRetro_SGB" || If superGB = "true") { ; For some reason, the order of our command line matters in this particular case.
  480. Run(executable . " " . fullscreen . " -c """ . retroCFGFile . """ -L """ . libDll . """ -s """ . srmPath . "\" . romName . ".srm"" -S """ . saveStatePath . "\" . romName . ".state""" . fullRomPath . netCommand, emuPath, "Hide")
  481. } Else If (ident = "LibRetro_LYNX" ) {
  482. Run(executable . " " . fullRomPath . fullscreen . rotateScreen . " -c """ . retroCFGFile . """ -L """ . libDll . """ -s """ . srmPath . "\" . romName . ".srm"" -S """ . saveStatePath . "\" . romName . ".state""", emuPath, "Hide")
  483. } Else {
  484. Run(executable . " " . fullRomPath . fullscreen . " -c """ . retroCFGFile . """ -L """ . libDll . """ -s """ . srmPath . "\" . romName . ".srm"" -S """ . saveStatePath . "\" . romName . ".state""" . netCommand, emuPath, "Hide")
  485. }
  486.  
  487. mpMenuStatus :=
  488. If networkSession {
  489. canceledServerWait := false
  490. multiplayerMenuExit := false
  491. SetTimer, NetworkConnectedCheck, 500
  492.  
  493. If (networkType = "server") {
  494. Log("Module - Waiting for a client to connect to your server")
  495. mpMenuStatus := MultiPlayerMenu(,,,,,,,,"You are the server. Please wait for your client to connect.")
  496. } Else { ; client
  497. Log("Module - Trying to contact the server to establish a connection.")
  498. mpMenuStatus := MultiPlayerMenu(,,,,,,,,"Attempting to connect to the server...")
  499. }
  500.  
  501. If (mpMenuStatus = -1) { ; if user exited menu early before a client connected
  502. Log("Module - Cancelled waiting for the " . If (networkType = "server") ? "client to connect" : "server to respond" . ". Exiting module.",2)
  503. If Process("Exist", executable)
  504. Process("Close", executable) ; must close process as the exe is waiting for a client to connect and no window was drawn yet
  505. ExitModule()
  506. } Else { ; blank response from MultiPlayerMenu, exited properly
  507. Log("Module - " . If (networkType = "server") ? "Client has connected" : "Connected to the server")
  508. WinWait("RetroArch ahk_class RetroArch")
  509. WinWaitActive("RetroArch ahk_class RetroArch")
  510. }
  511. SetTimer, NetworkConnectedCheck, Off
  512. } Else { ; single player
  513. WinWait("RetroArch ahk_class RetroArch")
  514. WinWaitActive("RetroArch ahk_class RetroArch")
  515. }
  516.  
  517. If hideConsole = true
  518. WinSet, Transparent, On, ahk_class ConsoleWindowClass ; makes the console window transparent so you don't see it on exit
  519.  
  520. BezelDraw()
  521. HideEmuEnd()
  522. FadeInExit()
  523. Process("WaitClose", executable)
  524. 7zCleanUp()
  525. BezelExit()
  526. FadeOutExit()
  527. ExitModule()
  528.  
  529.  
  530. ; Used to convert between RetroArch keys and usable data
  531. ConvertRetroCFGKey(txt,direction="read"){
  532. Global emuPath
  533. If direction = read
  534. { StringTrimLeft,newtxt,txt,1 ; removes the " from the left of the txt
  535. StringTrimRight,newtxt,newtxt,1 ; removes the " from the right of the txt
  536. If InStr(newtxt,":") { ; if the path contains a ":" then it is a relative path
  537. Log("ConvertRetroCFGKey - " . newtxt . " is a relative path",4)
  538. StringTrimLeft,newtxt,newtxt,1 ; removes the : from the left of the txt
  539. newtxt := AbsoluteFromRelative(emuPath, "." . newtxt) ; convert relative to absolute
  540. }
  541. If InStr(newtxt,"/")
  542. StringReplace,newtxt,newtxt,/,\,1 ; replaces all forward slashes with backslashes
  543. } Else If direction = write
  544. { newtxt = "%txt%" ; wraps the txt with ""
  545. If InStr(newtxt,"\")
  546. StringReplace,newtxt,newtxt,\,/,1 ; replaces all backslashes with forward slashes
  547. } Else
  548. ScriptError("Not a valid use of ConvertRetroCFGKey. Only ""read"" or ""write"" are supported.")
  549. Log("ConvertRetroCFGKey - Converted " . txt . " to " . newtxt,4)
  550. Return newtxt
  551. }
  552.  
  553. ; This will simply create a new blank ini if one does not exist
  554. CheckSysFile(file){
  555. IfNotExist, %file%
  556. FileAppend,, %file%
  557. Return file
  558. }
  559.  
  560. NetworkConnectedCheck:
  561. If clientConnected
  562. multiplayerMenuExit := true
  563. Else If WinExist("RetroArch ahk_class RetroArch") {
  564. Log("Module - RetroArch session started, closing the MultiPlayer menu",4)
  565. multiplayerMenuExit := true
  566. }
  567. Return
  568.  
  569. CloseProcess:
  570. FadeOutStart()
  571. WinClose("RetroArch ahk_class RetroArch")
  572. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement