Advertisement
djvj

Untitled

Mar 11th, 2015
567
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. MEmu = FS-UAE
  2. MEmuV = v2.2.3
  3. MURL = http://fs-uae.net/
  4. MAuthor = djvj/faahrev
  5. MVersion = 2.0.2 BETA
  6. MCRC =
  7. iCRC =
  8. MID =
  9. MSystem = "Commodore Amiga","Commodore Amiga CD32","Commodore CDTV"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; Command Line Options - http://fs-uae.net/options
  13. ;
  14. ; Fade-, Bezel- and MultiGame supported.
  15. ; Be sure to set the paths to the BIOS roms in the Global Module Settings in HLHQ.
  16. ;
  17. ; Extensions for Amiga are .adf, .hdf or .zip
  18. ; Extension for AmigaCD32 and CDTV is cue
  19. ;
  20. ; .hdf and .zip are not MultiGame compatible
  21. ;
  22. ; If a rom consists of multiple discs,
  23. ; the discs will be automatically added to the swap list in FS-UAE (ingame F12)
  24. ; plus:
  25. ; If the media is floppies (adf) up to 4 discs will be inserted in the drives.
  26. ; Don't forget to set MultiGame to true in HLHQ for each system you wish to use it.
  27. ;
  28. ; By pressing F12 in the game any disc can be inserted in any drive
  29. ; and savestates can be saved and loaded.
  30. ; These are saved in emu\config\save states.
  31. ;
  32. ; Be sure to use the correct format for naming the discs
  33. ;
  34. ; By default the EmuDir\config.fs-uae file will be used for setting options
  35. ; If it doesn't exist, it will be created.
  36. ;
  37. ; Note: please be patient when loading floppy games.
  38. ; Floppies are loaded in real-time for best results.
  39. ;----------------------------------------------------------------------------
  40. StartModule()
  41. BezelGUI()
  42. FadeInStart()
  43.  
  44. ; This object controls how the module reacts to different systems. FS-UAE can play a lot of systems, but needs to know what system you want to run, so this module has to adapt.
  45. mType := Object("Commodore Amiga","A1200","Commodore Amiga CD32","CD32/FMV","Commodore CDTV","CDTV")
  46. ident := mType[systemName] ; search object for the systemName identifier FS-UAE uses
  47. If !ident
  48. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for this " . MEmu . " module: " . moduleName)
  49.  
  50. settingsFile := modulePath . "\" . moduleName . ".ini"
  51. configFile := emuPath . "\config.fs-uae"
  52. baseDir := emuPath . "\conf"
  53. fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  54. fullscreenRes := IniReadCheck(settingsFile, "Settings", "FullscreenResolution",,,1)
  55. windowedRes := IniReadCheck(settingsFile, "Settings", "WindowedResolution",,,1)
  56. a1200Rom := IniReadCheck(settingsFile, "Settings", "A1200_Rom",,,1)
  57. cd32Rom := IniReadCheck(settingsFile, "Settings", "CD32_Rom",,,1)
  58. cd32ExtRom := IniReadCheck(settingsFile, "Settings", "CD32_Ext_Rom",,,1)
  59. cdTVRom := IniReadCheck(settingsFile, "Settings", "CDTV_Rom",,,1)
  60. cdTVExtRom := IniReadCheck(settingsFile, "Settings", "CDTV_Ext_Rom",,,1)
  61. whdBootPath := IniReadCheck(settingsFile, "Settings", "WHDBootPath", emuPath . "\Hard Disks\WHDLoad\Boot",,1)
  62. whdBootPath := AbsoluteFromRelative(emuPath, whdBootPath)
  63. ; amigaModel := IniReadCheck(settingsFile, "Settings", "AmigaModel","A1200",,1) ; possible choices are A500+,A600,A1000,A1200,A1200/020,A3000,A4000/040,CD32,CDTV
  64. ; autoResume := IniReadCheck(settingsFile, "Settings", "autoResume","true",,1) ; if true, will automatically save your game's state on exit and reload it on the next launch of the same game.
  65.  
  66. ;clearing earlier settings in config
  67. IniWrite, Empty, %configFile%, fs-uae, floppy_drive_0
  68. IniWrite, Empty, %configFile%, fs-uae, hard_drive_0
  69. IniWrite, Empty, %configFile%, fs-uae, cdrom_drive_0
  70.  
  71. ;ejecting all CDROMS
  72. IndexMinusOne := -1
  73. Loop, 9
  74. { IndexMinusOne++
  75. IniWrite, Empty, %configFile%, fs-uae, cdrom_image_%IndexMinusOne%
  76. }
  77.  
  78. BezelStart()
  79.  
  80. If ident = A1200
  81. { a1200Rom := CheckFile(GetFullName(a1200Rom), "Could not find your A1200_Rom. " . systemName . " first requires the ""A1200_Rom"" to be set in HLHQ's module settings for " . MEmu . ".")
  82. kickstartBios := "" . a1200Rom . ""
  83. ; fastmem := " --fast_memory=8192"
  84. IniWrite, 8192, %configFile%, fs-uae, fastmem ; write fastmem size
  85. }Else if ident = CD32/FMV
  86. { cd32Rom := CheckFile(GetFullName(cd32Rom), "Could not find your CD32_Rom. " . systemName . " first requires the ""CD32_Rom"" to be set in HLHQ's module settings for " . MEmu . ".")
  87. cd32ExtRom := CheckFile(GetFullName(cd32ExtRom), "Could not find your CD32_Ext_Rom. " . systemName . " first requires the ""CD32_Ext_Rom"" to be set in HLHQ's module settings for " . MEmu . ".")
  88. kickstartBios := "" . cd32Rom . ""
  89. kickstartExtBios := "" . cd32ExtRom . ""
  90. }Else if Ident = CDTV
  91. { cdTVRom := CheckFile(GetFullName(cdTVRom), "Could not find your CDTV_Rom. " . systemName . " first requires the ""CDTV_Rom"" to be set in HLHQ's module settings for " . MEmu . ".")
  92. cdTVExtRom := CheckFile(GetFullName(cdTVExtRom), "Could not find your CDTV_Ext_Rom. " . systemName . " first requires the ""CDTV_Ext_Rom"" to be set in HLHQ's module settings for " . MEmu . ".")
  93. kickstartBios := "" . cdTVRom . ""
  94. kickstartExtBios := "" . cdTVExtRom . ""
  95. }
  96. ;amigaModel := " --amiga_model=" . ident
  97. ;fullscreen := " --fullscreen=" . (If Fullscreen = "true" ? 1 : 0)
  98. ;fullscreenMode := " --fullscreen_mode=fullscreen-window" ; sets fullscreen windowed rather than true fullscreen
  99.  
  100. fullscreen := (If Fullscreen = "true" ? 1 : 0)
  101. IniWrite, %fullscreen%, %configFile%, fs-uae, fullscreen
  102. IniWrite, fullscreen-window, %configFile%, fs-uae, fullscreen_mode ; sets fullscreen windowed rather than true fullscreen
  103. If (fullscreen = "true" && fullscreenRes != "") {
  104. Loop, Parse, fullscreenRes, x
  105. If A_index = 1
  106. fsuaeW := A_LoopField
  107. Else
  108. fsuaeH := A_LoopField
  109. IniWrite, %fsuaeW%, %configFile%, fs-uae, fullscreen_width
  110. IniWrite, %fsuaeH%, %configFile%, fs-uae, fullscreen_height
  111. } Else If (fullscreen != "true" && windowedRes != "") {
  112. Loop, Parse, windowedRes, x
  113. If A_index = 1
  114. fsuaeW := A_LoopField
  115. Else
  116. fsuaeH := A_LoopField
  117. IniWrite, %fsuaeW%, %configFile%, fs-uae, window_width
  118. IniWrite, %fsuaeH%, %configFile%, fs-uae, window_height
  119. }
  120. 7z(romPath, romName, romExtension, 7zExtractPath)
  121.  
  122. ; stateName := emuPath . "\states\" . romName . ".uss"
  123.  
  124. If romExtension in .adf,.zip
  125. gamePathMethod := "floppy_drive_0"
  126. Else If romExtension = .hdf
  127. gamePathMethod := "hard_drive_0"
  128. Else If romExtension = .whd
  129. gamePathMethod := "hard_drive_0=""" . WHDBootPath . """ --hard_drive_1"
  130. Else if romExtension = .cue
  131. gamePathMethod := "cdrom_drive_0"
  132. Else
  133. ScriptError("Unsupported extension supplied: """ . romExtension . """.") ; iso is not supported or mounting will not work
  134.  
  135. ;gamePath := " --" . gamePathMethod . "=""" . romPath . "\" . romName . romExtension . """"
  136.  
  137. ;injecting other variables in config file
  138. IniWrite, %baseDir%, %configFile%, fs-uae, base_dir
  139. IniWrite, %ident%, %configFile%, fs-uae, amiga_model ; write model to fs-uae
  140. IniWrite, %kickstartBios%, %configFile%, fs-uae, kickstart_file ; write rom to fs-uae
  141. IniWrite, %kickstartExtBios%, %configFile%, fs-uae, kickstart_ext_file ; write extended rom to fs-uae
  142. IniWrite, %kickstartExtBios%, %configFile%, fs-uae, kickstart_ext_file ; write extended rom to fs-uae
  143. If romName contains Disk,Disc
  144. { StringTrimRight, romNameNoDisc, romName, 9 ; gets gamename
  145. IndexMinusOne := -1
  146. Loop, %romPath%\%romNameNoDisc%*.cue
  147. { EnvAdd, IndexMinusOne, 1
  148. IniWrite, %romPath%\%romNameNoDisc% (Disk %A_index%)%romExtension%, %configFile%, fs-uae, cdrom_image_%IndexMinusOne% ; mounting discs
  149. }
  150. }
  151.  
  152. Run(executable . " " . configFile, emuPath)
  153.  
  154. /*
  155. If (FileExist(stateName) and autoResume="true") {
  156. clipboard = %stateName%
  157. WinWait("ahk_class AmigaPowah")
  158. Send {F7} ; open load state window
  159. WinWait("Restore a WinUAE snapshot file")
  160. Send ^v
  161. Send {Enter}
  162. }
  163. */
  164.  
  165. WinWait("FS-UAE ahk_class SDL_app")
  166. WinWaitActive("FS-UAE ahk_class SDL_app")
  167.  
  168. BezelDraw()
  169. FadeInExit()
  170. Process("WaitClose", executable)
  171. 7zCleanUp()
  172. BezelExit()
  173. FadeOutExit()
  174.  
  175. /*
  176. GroupAdd,DIE,DIEmWin
  177. GroupClose, DIE, A
  178. */
  179.  
  180. ExitModule()
  181.  
  182.  
  183. CloseProcess:
  184. ; If (FileExist(stateName) and autoResume="true")
  185. ; Send {F5} ; open save state window
  186. FadeOutStart()
  187. ; If (FileExist(stateName) and autoResume="true") {
  188. ; clipboard = %stateName% ; just in case something happened to clipboard in between start of module to now
  189. ; WinWait("Save a WinUAE snapshot file")
  190. ; Send ^v
  191. ; Send {Enter}
  192. ; Sleep, 50 ; always give time for a file operation to occur before closing an app
  193. ; }
  194. WinClose("FS-UAE ahk_class SDL_app")
  195. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement