rfancella

WinUAE.ahk

Jun 8th, 2014
841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.38 KB | None | 0 0
  1. MEmu = WinUAE
  2. MEmuV = v3.0.0
  3. MURL = http://www.winuae.net/
  4. MAuthor = brolly,Turranius
  5. MVersion = 2.1.5
  6. MCRC = C2D9F2CC
  7. iCRC = F85B0AB
  8. mId = 635138307631183750
  9. MSystem = "Commodore Amiga","Commodore Amiga CD32","Commodore CDTV","Commodore Amiga CD","Commodore Amiga Demos"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; You can have specific configuration files inside a Configurations folder on WinUAE main dir.
  13. ; Just name them the same as the game name on the XML file.
  14. ; Make sure you create a host config files with these names:
  15. ; CD32 : cd32host.uae and cd32mousehost.uae;
  16. ; CDTV : cdtvhost.uae and cdtvmousehost.uae;
  17. ; Amiga : amigahost.uae;
  18. ; Amiga CD : amigacdhost.uae;
  19. ; cd32mouse and cdtvmouse are for mouse controlled games on these systems, you should configure
  20. ; Windows Mouse on Port1 and a CD32 pad on Port2. For Amiga and Amiga CD make sure you set both
  21. ; a joystick and a mouse on Port1 and only a joystick on Port2.
  22. ; Set all your other preferences like video display settings. And make sure you are saving a HOST
  23. ; configuration file and not a general configuration file.
  24. ;
  25. ; If you want to configure an exit key through WinUAE:
  26. ; Host-Input-Configuration #1-RAW Keyboard and then remap the desired key to Quit Emulator.
  27. ; If you want to configure a key to toggle fullscreen/windowed mode:
  28. ; Host-Input-Configuration #1-RAW Keyboard and then remap the desired key to Toggle windowed/fullscreen.
  29. ;
  30. ; CD32 and CDTV:
  31. ; A settings file called System_Name.ini should be placed on your module dir. on that file you can define if a
  32. ; game uses mouse or if it needs the special delay hack loading method amongst other things. Example of such a file:
  33. ;
  34. ; [Lemmings (Europe)]
  35. ; UseMouse=true
  36. ;
  37. ; [Project-X & F17 Challenge (Europe)]
  38. ; DelayHack=true
  39. ;
  40. ; Amiga:
  41. ; For MultiGame support make sure you don't change the default WinUAE diskswapper keys which are:
  42. ; END+1-0 (not numeric keypad) = insert image from swapper slot 1-10
  43. ; END+SHIFT+1-0 = insert image from swapper slot 11-20
  44. ; END+CTRL+1-4 = select drive
  45. ;
  46. ; To do that follow the same procedure as above for the exit
  47. ; key, but on F11 set it to Toggle windowed/fullscreen. Make sure you save your configuration afterwards.
  48. ; Note : If you want to use Send commands to WinUAE for any keys that you configured through Input-Configuration panel make sure you
  49. ; set those keys for Null Keyboard! This is a virtual keyboard that collects all input events that don't come from physical
  50. ; keyboards. This applies to the exit or windowed/fullscreen keys mentioned above.
  51. ;
  52. ; If you are using WHDLoad games, but want to keep your default user-startup file after exiting then make a copy of it in the
  53. ; WHDFolder\S (Set in PathToWHDFolder) and name it default-user-startup. This file will then be copied over S\user-startup on exit.
  54. ;
  55. ; Amiga CD:
  56. ; Several Amiga CD games require Hard drive installation, but will also require the game CD to be inserted in the CD drive.
  57. ; The module will take care of this automatically as long as you have the CD image alongside with HDD installed files (.hdf or .vhd).
  58. ;
  59. ; To use the shader options you must first download and put in place the shader pack from the WinUAE website found here:
  60. ; http://www.winuae.net/ download the Direct3D Pixel Shader Filters and place them in your emulator directory
  61. ;----------------------------------------------------------------------------
  62. StartModule()
  63. BezelGUI()
  64. FadeInStart()
  65.  
  66. settingsFile := modulePath . "\" . systemName . ".ini"
  67.  
  68. ; This object controls how the module reacts to different systems. WinUAE can play several systems, but needs to know what system you want to run, so this module has to adapt.
  69. mType := Object("Commodore Amiga","a500","Commodore Amiga CD32","cd32","Commodore CDTV","cdtv","Commodore Amiga CD","amigacd","Commodore Amiga Demos","a500")
  70. ident := mType[systemName] ; search object for the systemName identifier MESS uses
  71. If !ident
  72. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for this WinUAE module: " . moduleName)
  73.  
  74. specialcfg = %emuPath%\Configurations\%romName%.uae
  75.  
  76. If romExtension in .hdf,.vhd
  77. DefaultRequireWB := "true"
  78. Else
  79. DefaultRequireWB := "false"
  80.  
  81. If romExtension in .zip,.lha,.rar,.7z
  82. {
  83. SlaveFile := COM_Invoke(RLObject, "findByExtension", romPath . "\" . romName . romExtension, "slave")
  84. If (SlaveFile) {
  85. If romName contains (AGA)
  86. {
  87. defaultCycleExact := "false"
  88. defaultCpuSpeed := "max"
  89. } Else {
  90. defaultCycleExact := "true"
  91. defaultCpuSpeed := "real"
  92. }
  93. defaultImmediateBlittler = "false"
  94. defaultCpuCompatible := "false"
  95. defaultCacheSize := "0" ;8192
  96. }
  97. }
  98.  
  99. If (ident = "amigacd") {
  100. defaultz3Ram := "128"
  101. isAmigaCd := "true"
  102. }
  103.  
  104. ; Settings
  105. FS := IniReadCheck(settingsFile, "Settings" . "|" . romName, "ScreenMode","true",,1)
  106. quickstartmode := IniReadCheck(settingsFile, "Settings" . "|" . romName, "QuickStartMode",A_Space,,1)
  107. kickstart_rom_file := IniReadCheck(settingsFile, "Settings" . "|" . romName, "KickstartFile","",,1)
  108. options := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Options","",,1)
  109. bezelTopOffset := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Bezel_Top_Offset","0",,1)
  110. bezelBottomOffset := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Bezel_Bottom_Offset","0",,1)
  111. bezelRightOffset := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Bezel_Right_Offset","0",,1)
  112. bezelLeftOffset := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Bezel_Left_Offset","0",,1)
  113. use_gui := IniReadCheck(settingsFile, "Settings" . "|" . romName, "UseGui","false",,1)
  114. floppyspeed := IniReadCheck(settingsFile, "Settings" . "|" . romName, "FloppySpeed","turbo",,1)
  115. PathToWorkBenchBase := IniReadCheck(settingsFile, "Settings" . "|" . romName, "PathToWorkBenchBase", EmuPath . "\HDD\Workbench31_Lite.vhd",,1)
  116. PathToWorkBenchBase := AbsoluteFromRelative(EmuPath, PathToWorkBenchBase)
  117. usemouse := IniReadCheck(settingsFile, romName, "UseMouse","false",,1) ;Only needed for CDTV and CD32
  118. delayhack := IniReadCheck(settingsFile, romName, "DelayHack","false",,1) ;Only needed for CDTV and CD32
  119. requireswb := IniReadCheck(settingsFile, romName, "RequiresWB",DefaultRequireWB,,1)
  120.  
  121. ; Display
  122. videomode := IniReadCheck(settingsFile, "Display" . "|" . romName, "VideoMode","PAL",,1)
  123. gfx_width := IniReadCheck(settingsFile, "Display" . "|" . romName, "XResolution","native",,1)
  124. gfx_height := IniReadCheck(settingsFile, "Display" . "|" . romName, "YResolution","native",,1)
  125. gfx_blacker_than_black := IniReadCheck(settingsFile, "Display" . "|" . romName, "BlackerThanBlack","false",,1)
  126. gfx_flickerfixer := IniReadCheck(settingsFile, "Display" . "|" . romName, "RemoveInterlaceArtifacts","false",,1)
  127. gfx_linemode := IniReadCheck(settingsFile, "Display" . "|" . romName, "LineMode",,,1)
  128. gfx_filter_autoscale := IniReadCheck(settingsFile, "Display" . "|" . romName, "AutoScale",,,1)
  129. gfx_filter_mask := IniReadCheck(settingsFile, "Display" . "|" . romName, "ShaderMask",,,1)
  130. gfx_filter := IniReadCheck(settingsFile, "Display" . "|" . romName, "FilterShader",,,1)
  131. gfx_filter_mode := IniReadCheck(settingsFile, "Display" . "|" . romName, "FilterShaderScale",,,1)
  132.  
  133. ; CPU
  134. cpu := IniReadCheck(settingsFile, "CPU" . "|" . romName, "CPU","",,1)
  135. cpuspeed := IniReadCheck(settingsFile, "CPU" . "|" . romName, "CpuSpeed",defaultCpuSpeed,,1)
  136. cpucycleexact := IniReadCheck(settingsFile, "CPU" . "|" . romName, "CpuCycleExact","",,1)
  137. cpucompatible := IniReadCheck(settingsFile, "CPU" . "|" . romName, "CpuCompatible",defaultCpuCompatible,,1)
  138. mmu_model := IniReadCheck(settingsFile, "CPU" . "|" . romName, "MMU","false",,1)
  139. cpu_no_unimplemented := IniReadCheck(settingsFile, "CPU" . "|" . romName, "DisableUnimplementedCPU","true",,1)
  140. fpu := IniReadCheck(settingsFile, "CPU" . "|" . romName, "FPU","",,1)
  141. fpu_strict := IniReadCheck(settingsFile, "CPU" . "|" . romName, "MoreCompatibleFPU","false",,1)
  142. fpu_no_unimplemented := IniReadCheck(settingsFile, "CPU" . "|" . romName, "DisableUnimplementedFPU","true",,1)
  143. cachesize := IniReadCheck(settingsFile, "CPU" . "|" . romName, "CacheSize",defaultCacheSize,,1)
  144. 24bitaddressing := IniReadCheck(settingsFile, "CPU" . "|" . romName, "24-BitAddressing","true",,1)
  145.  
  146. ; Chipset
  147. cycleexact := IniReadCheck(settingsFile, "Chipset" . "|" . romName, "CycleExact",defaultCycleExact,,1)
  148. immediateblitter := IniReadCheck(settingsFile, "Chipset" . "|" . romName, "ImmediateBlitter",defaultImmediateBlittler,,1)
  149. blittercycleexact := IniReadCheck(settingsFile, "Chipset" . "|" . romName, "BlitterCycleExact","",,1)
  150. collisionlevel := IniReadCheck(settingsFile, "Chipset" . "|" . romName, "CollisionLevel","",,1)
  151.  
  152. ; RAM
  153. chipmemory := IniReadCheck(settingsFile, "RAM" . "|" . romName, "ChipMemory","",,1)
  154. fastmemory := IniReadCheck(settingsFile, "RAM" . "|" . romName, "FastMemory","",,1)
  155. autoconfigfastmemory := IniReadCheck(settingsFile, "RAM" . "|" . romName, "AutoConfigFastMemory","",,1)
  156. slowmemory := IniReadCheck(settingsFile, "RAM" . "|" . romName, "SlowMemory","",,1)
  157. z3fastmemory := IniReadCheck(settingsFile, "RAM" . "|" . romName, "Z3FastMemory",defaultz3Ram,,1)
  158. megachipmemory := IniReadCheck(settingsFile, "RAM" . "|" . romName, "MegaChipMemory","",,1)
  159. processorslotfastmemory := IniReadCheck(settingsFile, "RAM" . "|" . romName, "ProcessorSlotFast","",,1)
  160.  
  161. ; Expansions
  162. rtgcardtype := IniReadCheck(settingsFile, "Expansions" . "|" . romName, "RTGCardType","",,1)
  163. rtgvramsize := IniReadCheck(settingsFile, "Expansions" . "|" . romName, "RTGVRAMSize","",,1)
  164. rtghardwaresprite := IniReadCheck(settingsFile, "Expansions" . "|" . romName, "RTGHardwareSprite","",,1)
  165.  
  166. ; WHDLoad
  167. PathToWHDFolder := IniReadCheck(settingsFile, "WHDLoad" . "|" . romName, "PathToWHDFolder", EmuPath . "\HDD\WHD",,1)
  168. PathToWHDFolder := AbsoluteFromRelative(EmuPath, PathToWHDFolder)
  169. whdloadoptions := IniReadCheck(settingsFile, "WHDLoad" . "|" . romName, "WHDLoadOptions","PRELOAD",,1)
  170. neverextract := IniReadCheck(settingsFile, "WHDLoad" . "|" . romName, "NeverExtract","false",,1)
  171.  
  172. BezelStart()
  173.  
  174. ; Force Full Screen Windowed and Autoscale if Bezels are enabled. This must be done here since window class name changes from windowed to fullscreen modes
  175. If bezelPath {
  176. FS := "fullwindow"
  177. gfx_filter_autoscale := "scale"
  178. }
  179.  
  180. windowClass = PCsuxRox ;Class name is different depending on if the game is being run windowed or fullscreen
  181. If (FS = "true" or FS = "fullwindow")
  182. windowClass = AmigaPowah
  183.  
  184. If (cpucycleexact and blittercycleexact)
  185. cycleexact := "" ;No need to set cycle exact if both cpu and blitter are set as it could lead to inconsistent states
  186.  
  187. if (cpu != "68060" and cpu_no_unimplemented)
  188. cpu_no_unimplemented := "" ; cpu_no_unimplemented requires a 68060 CPU. Disable it if its true without a 68060 CPU.}
  189.  
  190. ; Make sure 24bitaddressing is false if using Z3 memory.
  191. If z3fastmemory
  192. 24bitaddressing := "false"
  193.  
  194. ;Fill both z3 slots when amount of RAM requires it
  195. If (z3fastmemory = "384") {
  196. z3fastmemory = "256"
  197. z3fastmemoryb = "128"
  198. } Else If (z3fastmemory = "768") {
  199. z3fastmemory = "512"
  200. z3fastmemoryb = "256"
  201. } Else If (z3fastmemory = "1536") {
  202. z3fastmemory = "1024"
  203. z3fastmemoryb = "512"
  204. }
  205.  
  206. videomode := If videomode = "NTSC" ? "-s ntsc=true" : ""
  207.  
  208. If (requireswb = "true") {
  209. ident := "a1200"
  210. CheckFile(PathToWorkBenchBase)
  211. wbDrive := "-s hardfile=rw,32,1,2,512," . """" . PathToWorkBenchBase . """"
  212. }
  213.  
  214. If romExtension in .hdf,.vhd
  215. {
  216. ident := "a1200"
  217. gameDrive := "-s hardfile=rw,32,1,2,512," . """" . romPath . "\" . romName . romExtension . """"
  218. }
  219.  
  220. options := options . " " . videomode
  221.  
  222. If (ident = "a500" or ident = "a1200") {
  223. If romName contains (AGA),(LW)
  224. ident := "a1200"
  225.  
  226. If (SlaveFile) {
  227. CheckFolder(PathToWHDFolder)
  228.  
  229. ident := "a1200"
  230.  
  231. ;Create the user-startup file to launch the game
  232. WHDUserStartupFile := PathToWHDFolder . "\S\user-startup"
  233. SplitPath, SlaveFile, SlaveName, SlaveFolder
  234.  
  235. FileDelete, %WHDUserStartupFile%
  236. FileAppend, echo "";`n, %WHDUserStartupFile%
  237. FileAppend, echo "Running: %SlaveName%";`n, %WHDUserStartupFile%
  238. FileAppend, echo "";`n, %WHDUserStartupFile%
  239. FileAppend, cd dh1:%SlaveFolder%;`n, %WHDUserStartupFile%
  240. FileAppend, whdload %SlaveName% %whdloadoptions%;`n, %WHDUserStartupFile%
  241. }
  242. }
  243.  
  244. hideEmuObj := Object("ahk_class " . windowClass,1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  245. 7z(romPath, romName, romExtension, 7zExtractPath)
  246.  
  247. ;--- Detecting what Configuration File to use (Or Quick Start Mode) ---
  248.  
  249. If FileExist(specialcfg) {
  250. ;Game specific configuration file exists
  251. configFile = %romName%.uae
  252. } Else {
  253. ;Game specific configuration file doesn't exist
  254. If (ident = "cd32" or ident = "cdtv") {
  255. configFile := If (usemouse = "true") ? ("host\" . ident . "mousehost.uae") : ("host\" . ident . "host.uae")
  256. quickcfg := If (ident = "cd32") ? ("-s quickstart=" . ident . "`,0 -s chipmem_size=8") : ("-s quickstart=" . ident . "`,0")
  257. } Else {
  258. ;Amiga or Amiga CD game
  259.  
  260. configFile := If systemName = "Commodore Amiga CD" ? "host\amigacdhost.uae" : "host\amigahost.uae"
  261. If quickstartmode
  262. quickcfg := "-s quickstart=" . quickstartmode
  263. Else
  264. quickcfg := If (ident = "a500") ? "-s quickstart=a500`,1" : (If (isAmigaCd = "true") ? "-s quickstart=a4000`,1" : "-s quickstart=a1200`,1")
  265. }
  266. }
  267.  
  268. ;--- Setting up command line arguments to use ---
  269.  
  270. ; Global command line arguments.
  271. If use_gui
  272. options := options . " -s use_gui=" . use_gui
  273.  
  274. If (FS = "true") {
  275. options := options . " -s gfx_width_fullscreen=" . gfx_width
  276. options := options . " -s gfx_height_fullscreen=" . gfx_height
  277. } Else If (FS = "false") {
  278. If (gfx_width != "native" and gfx_height != "native") {
  279. options := options . " -s gfx_width_windowed=" . gfx_width
  280. options := options . " -s gfx_height_windowed=" . gfx_height
  281. }
  282. }
  283.  
  284. If gfx_linemode
  285. options := options . " -s gfx_linemode=" . gfx_linemode
  286. If gfx_filter_autoscale
  287. options := options . " -s gfx_filter_autoscale=" . gfx_filter_autoscale
  288. If gfx_linemode
  289. options := options . " -s gfx_linemode=" . gfx_linemode
  290. If gfx_blacker_than_black
  291. options := options . " -s gfx_blacker_than_black=" . gfx_blacker_than_black
  292. If gfx_flickerfixer
  293. options := options . " -s gfx_flickerfixer=" . gfx_flickerfixer
  294. If gfx_filter_mode
  295. options := options . " -s gfx_filter_mode=" . gfx_filter_mode
  296.  
  297. If gfx_filter_mask {
  298. gfx_filter_mask_path := emuPath . "\Plugins\masks\" . gfx_filter_mask
  299. LOG("Filter - gfx_filter_mask_path = " . gfx_filter_mask_path ,5)
  300. If FileExist(gfx_filter_mask_path)
  301. options := options . " -s gfx_filter_mask=" . gfx_filter_mask
  302. }
  303.  
  304. If gfx_filter
  305. { gfxVarD3D := SubStr(gfx_filter, 1, 3)
  306. If (SubStr(gfx_filter, 1, 3) = "D3D")
  307. { StringTrimLeft, FilterFileName, gfx_filter, 4
  308. FilterFile := EmuPath . "\Plugins\filtershaders\direct3d\" . FilterFileName
  309. If FileExist(FilterFile)
  310. options := options . " -s gfx_filter=" . gfx_filter
  311. } ELSE
  312. { options := options . " -s gfx_filter=" . gfx_filter
  313. }
  314. }
  315.  
  316. If (ident = "cd32" or ident = "cdtv") {
  317. If (delayhack = "true")
  318. options := options . " -s cdimage0=" . """" . romPath . "\" . romName . romExtension . """" . "`,delay"
  319. Else
  320. options := options . " -cdimage=" . """" . romPath . "\" . romName . romExtension . """"
  321. } Else {
  322. If floppyspeed
  323. options := options . " -s floppy_speed=" . floppyspeed
  324. If kickstart_rom_file
  325. options := options . " -s kickstart_rom_file=" . """" . kickstart_rom_file . """"
  326. If (cachesize || cachesize = "0")
  327. options := options . " -s cachesize=" . cachesize
  328. If immediateblitter
  329. options := options . " -s immediate_blits=" . immediateblitter
  330. If cycleexact
  331. options := options . " -s cycle_exact=" . cycleexact
  332. If cpucycleexact
  333. options := options . " -s cpu_cycle_exact=" . cpucycleexact
  334. If blittercycleexact
  335. options := options . " -s blitter_cycle_exact=" . blittercycleexact
  336. If cpucompatible
  337. options := options . " -s cpu_compatible=" . cpucompatible
  338. If cpuspeed
  339. options := options . " -s cpu_speed=" . cpuspeed
  340. If cpu
  341. options := options . " -s cpu_model=" . cpu
  342. If cpu_no_unimplemented
  343. options := options . " -s cpu_no_unimplemented=" . cpu_no_unimplemented
  344. If (mmu_model = "true")
  345. options := options . " -s mmu_model=" . cpu ; not a typo. Actually needs the same value as CPU.
  346. If 24bitaddressing
  347. options := options . " -s cpu_24bit_addressing=" . 24bitaddressing
  348. If fpu
  349. options := options . " -s fpu_model=" . fpu
  350. If fpu_strict
  351. options := options . " -s fpu_strict=" . fpu_strict
  352. If fpu_no_unimplemented
  353. options := options . " -s fpu_no_unimplemented=" . fpu_no_unimplemented
  354. If collisionlevel
  355. options := options . " -s collision_level=" . collisionlevel
  356. If chipmemory
  357. options := options . " -s chipmem_size=" . chipmemory
  358. If fastmemory
  359. options := options . " -s fastmem_size=" . fastmemory
  360. If autoconfigfastmemory
  361. options := options . " -s fastmem_autoconfig=" . autoconfigfastmemory
  362. If slowmemory
  363. options := options . " -s bogomem_size=" . slowmemory
  364. If z3fastmemory
  365. options := options . " -s z3mem_size=" . z3fastmemory
  366. If z3fastmemoryb
  367. options := options . " -s z3mem2_size=" . z3fastmemoryb
  368. If megachipmemory
  369. options := options . " -s megachipmem_size=" . megachipmemory
  370. If processorslotfastmemory
  371. options := options . " -s mbresmem_size=" . processorslotfastmemory
  372. If rtgcardtype
  373. options := options . " -s gfxcard_type=" . rtgcardtype
  374. If rtgvramsize
  375. options := options . " -s gfxcard_size=" . rtgvramsize
  376. If rtghardwaresprite
  377. options := options . " -s gfxcard_hardware_sprite=" . rtghardwaresprite
  378.  
  379. If (SlaveFile) {
  380. ;WHDLoad Game
  381. options := options . " -s filesystem=rw,WHD:" . """" . PathToWHDFolder . """" . " -s filesystem=ro,Games:" . """" . romPath . "\" . romName . romExtension . """"
  382. }
  383. Else If (gameDrive) {
  384. ;HDD Game
  385. options := options . " " . wbDrive . " " . gameDrive
  386.  
  387. ;Check if there's also a CD to load
  388. IfExist, %romPath%\%romName%.cue
  389. cdDrive := romPath . "\" . romName . ".cue"
  390. IfExist, %romPath%\%romName%.iso
  391. cdDrive := romPath . "\" . romName . ".iso"
  392. If cdDrive
  393. options := options . " -cdimage=" . """" . cdDrive . """" . " -s win32.map_cd_drives=true -s scsi=true"
  394. } Else If romExtension in .cue,.iso
  395. {
  396. ;Amiga CD game
  397.  
  398. ;Check if game has a HDD installation
  399. IfExist, %romPath%\%romName%.hdf
  400. installedHdd := " -s hardfile=rw,32,1,2,512," . """" . romPath . "\" . romName . ".hdf" . """"
  401. IfExist, %romPath%\%romName%.vhd
  402. installedHdd := " -s hardfile=rw,32,1,2,512," . """" . romPath . "\" . romName . ".vhd" . """"
  403.  
  404. options := options . " " . wbDrive . installedHdd . " -cdimage=" . """" . romPath . "\" . romName . romExtension . """" . " -s win32.map_cd_drives=true -s scsi=true"
  405. } Else {
  406. ;Floppy Game
  407.  
  408. ;MultiDisk loading, this will load the first 2 disks into drives 0 and 1 since some games can read from both drives and therefore
  409. ;the user won't need to change disks through the MG menu. We can have up to 4 drives, but most of the games will only support 2 drives
  410. ;so disks are only loaded into the first 2 for better compatibility. Remaining drives will be loaded into quick disk slots.
  411.  
  412. romCount = % romTable.MaxIndex()
  413. If romName contains (Disk 1)
  414. {
  415. ;If the user boots any disk rather than the first one, multi disk support must be done through RocketLauncher MG menu
  416. If romCount > 1
  417. {
  418. options := options . " -s nr_floppies=2"
  419. mgoptions := " -s floppy1=" . """" . romTable[2,1] . """"
  420. }
  421. }
  422. options := options . " " . floppyspeed . " -s floppy0=" . """" . romPath . "\" . romName . romExtension . """" . mgoptions
  423.  
  424. If romCount > 1
  425. {
  426. ;DiskSwapper
  427. ;diskswapper := " -diskswapper "
  428. Loop % romTable.MaxIndex() ; loop each item in our array
  429. {
  430. ;diskswapper := diskswapper . """" . romTable[A_Index,1] . ""","
  431. diskswapper := diskswapper . " -s diskimage" . (A_Index-1) . "=" . """" . romTable[A_Index,1] . """"
  432. }
  433. options := options . diskswapper
  434. }
  435. }
  436. }
  437.  
  438. configFileFullPath := EmuPath . "\Configurations\" . configFile
  439.  
  440. ;param1 := "-f " . """" . configFileFullPath . """" . " " . quickcfg
  441. If FileExist(configFileFullPath)
  442. param1 := "-f " . """" . configFileFullPath . """"
  443. param1 := param1 . " " . quickcfg
  444.  
  445. param2 := "-s gfx_fullscreen_amiga=" . FS
  446. param3 := options
  447.  
  448. HideEmuStart()
  449. Run(Executable . A_Space . param1 . A_Space . param2 . A_Space . param3 . A_Space . " -portable", emuPath)
  450.  
  451. If (use_gui = "true") {
  452. WinWait("WinUAE Properties",,60)
  453. FadeInExit()
  454. WinWaitClose("WinUAE Properties")
  455. Sleep, 100
  456. Process("Exist",executable)
  457. If (ErrorLevel=0) {
  458. 7zCleanUp()
  459. ExitModule()
  460. }
  461. }
  462.  
  463. WinWait("ahk_class " . windowClass)
  464. WinWaitActive("ahk_class " . windowClass)
  465.  
  466. BezelDraw()
  467. HideEmuEnd()
  468. FadeInExit()
  469. Process("WaitClose",executable)
  470. 7zCleanUp()
  471. BezelExit()
  472. FadeOutExit()
  473. ExitModule()
  474.  
  475.  
  476. MultiGame:
  477. If currentButton = 10
  478. diskslot = 0
  479. Else If currentButton > 10
  480. diskslot := currentButton - 10
  481. Else
  482. diskslot := currentButton
  483.  
  484. If currentButton > 10
  485. Send, {End Down}{Shift Down}%diskslot%{Shift Up}{End Up}
  486. Else
  487. Send, {End Down}%diskslot%{End Up}
  488. Return
  489.  
  490. CloseProcess:
  491. If (ident = "a500" or ident = "a1200") {
  492. If (SlaveFile) {
  493. CheckFolder(PathToWHDFolder)
  494. ;Copy default-user-startup to user-startup if file exists
  495. IfExist, %PathToWHDFolder%\S\default-user-startup
  496. FileCopy,%PathToWHDFolder%\S\default-user-startup, %PathToWHDFolder%\S\user-startup, 1
  497. }
  498. }
  499. FadeOutStart()
  500. WinClose, ahk_class %windowClass%
  501. Return
Add Comment
Please, Sign In to add comment