rfancella

Atari800 Beta.ahk

Dec 4th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.89 KB | None | 0 0
  1. MEmu = Atari800
  2. MEmuV = v2.2.1 svn r2186
  3. MURL = http://atari800.sourceforge.net/
  4. MAuthor = djvj, brolly & wahoobrian
  5. MVersion = 2.0.3
  6. MCRC = 65EF3D1B
  7. iCRC = 137AEE2A
  8. MID = 635038268874969816
  9. MSystem = "Atari XEGS","Atari 8-Bit","Atari 5200"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; Enter the UI by pressing F1. ESC is used to return to the previous screen.
  13. ; On this menu go to Emulator Settings and make sure you set Save Settings on Exit to Yes otherwise your settings won't save!
  14. ;
  15. ; Atari 5200:
  16. ; In the UI, enter the Emulator Settings and set a 5200 bios to 5200.rom (you should place this in a Rom subfolder in your Emu_Path)
  17. ;
  18. ; Atari XL:
  19. ; Make sure XL/XE bios paths point to ATARIXL.rom and BASIC points to ATARIBAS.ROM
  20. ;
  21. ; Supported emulation modes via CLI:
  22. ; -atari Emulate Atari 800
  23. ; -1200 Emulate Atari 1200XL
  24. ; -xl Emulate Atari 800XL
  25. ; -xe Emulate Atari 130XE
  26. ; -320xe Emulate Atari 320XE (Compy Shop)
  27. ; -rambo Emulate Atari 320XE (Rambo)
  28. ; -xegs Emulate Atari XEGS
  29. ; -5200 Emulate Atari 5200
  30. ;
  31. ; More CLI commands can be found in DOC\USAGE
  32. ;
  33. ; The Bezel offset values are needed if you are not running in Hardware Acceleration mode in the emulator. With Harware Acceleration disabled, the title bar and borders of the emulator window is not hidden.
  34. ;
  35. ;----------------------------------------------------------------------------
  36. StartModule()
  37. BezelGUI()
  38. FadeInStart()
  39.  
  40. mType := Object("Atari XEGS","xegs","Atari 8-Bit","xl","Atari 5200","5200")
  41. ident := mType[systemName] ; search object for the systemName identifier Atari800 uses
  42. If !ident
  43. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for this Atari800 module: " . moduleName)
  44.  
  45. IfExist, % modulePath . "\" . systemName . ".ini" ; use a custom systemName ini if it exists
  46. settingsFile := modulePath . "\" . systemName . ".ini"
  47. Else
  48. settingsFile := modulePath . "\" . moduleName . ".ini"
  49.  
  50. 7z(romPath, romName, romExtension, 7zExtractPath)
  51.  
  52. Fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  53. VideoMode := IniReadCheck(settingsFile, romName, "VideoMode","PAL",,1)
  54. MouseMode := IniReadCheck(settingsFile, romName, "MouseMode",A_Space,,1)
  55.  
  56. ;Bezel settings
  57. bezelTopOffset := IniReadCheck(settingsFile, "Settings", "Bezel_Top_Offset","0",,1)
  58. bezelBottomOffset := IniReadCheck(settingsFile, "Settings", "Bezel_Bottom_Offset","0",,1)
  59. bezelRightOffset := IniReadCheck(settingsFile, "Settings", "Bezel_Right_Offset", "0",,1)
  60. bezelLeftOffset := IniReadCheck(settingsFile, "Settings", "Bezel_Left_Offset", "0",,1)
  61.  
  62. BezelStart()
  63.  
  64. cliOptions := If (Fullscreen="true") ? "-fullscreen " : "-windowed "
  65.  
  66. ;set video mode
  67. ;if (VideoMode = "PAL")
  68. ; cliOptions := cliOptions . " -pal "
  69. ;else
  70. ; cliOptions := cliOptions . " -ntsc "
  71.  
  72. ;set mouse mode
  73. if (MouseMode in Paddle,Lightgun,Lightpen)
  74. if (MouseMode = "Paddle")
  75. cliOptions := cliOptions . " -mouse pad"
  76. else if (MouseMode = "Lightgun")
  77. cliOptions := cliOptions . " -mouse gun"
  78. else if (MouseMode = "Lightpen")
  79. cliOptions := cliOptions . " -mouse pen"
  80. else {
  81. cliOptions := cliOptions . " -mouse off"
  82. }
  83.  
  84. If (SystemName = "Atari 5200") {
  85. cliOptions := cliOptions . " -5200 "
  86. CartType := IniReadCheck(settingsFile, romName, "CartType",0,,1)
  87. if (!CartType) {
  88. a5200cartMaps := Object(4,20,8,19,16,6,32,4,40,7)
  89. FileGetSize, fsize, %romPath%\%romName%%romExtension%, K
  90. CartType := a5200cartMaps[fsize] ; search object for the systemName identifier Atari800 uses
  91. }
  92.  
  93. If (!CartType)
  94. ScriptError("Unknown cart type, make sure you define a CartType for this game on Atari 5200.ini")
  95.  
  96. cliOptions := cliOptions . " -cart-type " . CartType
  97. cliOptions := cliOptions . " -cart "
  98. }
  99.  
  100. Else If (SystemName = "Atari XEGS") {
  101. cliOptions := cliOptions . " -xegs -cart "
  102. }
  103.  
  104. Else If (SystemName = "Atari 8-Bit")
  105. {
  106. Basic := IniReadCheck(settingsFile, romName, "Basic","false",,1)
  107. OSType := IniReadCheck(settingsFile, romName, "OSType",2,,1)
  108. MachineType := IniReadCheck(settingsFile, romName, "MachineType","xl",,1)
  109. CassetteLoadingMethod := IniReadCheck(settingsFile, romName, "CassetteLoadingMethod","Auto",,1)
  110. CartType := IniReadCheck(settingsFile, romName, "CartType",0,,1)
  111. Command := IniReadCheck(settingsFile, romName, "Command", "",,1)
  112. SendCommandDelay := IniReadCheck(settingsFile, romName, "SendCommandDelay", "2000",,1)
  113. DisableSIOPatch := IniReadCheck(settingsFile, romName, "DisableSIOPatch","false",,1)
  114. LoadBasicAsCart := IniReadCheck(settingsFile, romName, "LoadBasicAsCart","",,1)
  115.  
  116. ;set OSType (OS-A, OS-B), Machine Type
  117. if (OSType = "0")
  118. cliOptions := cliOptions . " -800-rev a-pal -atari "
  119. else if (OSType = "1")
  120. cliOptions := cliOptions . " -800-rev b-ntsc -atari "
  121. else
  122. cliOptions := cliOptions . " -" . MachineType
  123.  
  124. ;set sio patch (fast i/o access)
  125. if (DisableSIOPatch = "true")
  126. cliOptions := cliOptions . " -nopatch "
  127.  
  128. if (Basic = "true")
  129. cliOptions := cliOptions . " -basic "
  130. else
  131. cliOptions := cliOptions . " -nobasic "
  132.  
  133. if (LoadBasicAsCart)
  134. {
  135. PathToBasicCart := AbsoluteFromRelative(EmuPath, LoadBasicAsCart)
  136. CheckFile(PathToBasicCart)
  137. cliOptions := cliOptions . " -cart """ . PathToBasicCart . """ -cart-type 1"
  138. }
  139.  
  140. fullRomPath := romPath . "\" . romName . romExtension
  141.  
  142. If romExtension in .a52,.car,.cart,.rom ;Carts
  143. {
  144. cliOptions := cliOptions . " -cart-type " . CartType
  145. cliOptions := cliOptions . " -cart "
  146. }
  147. Else if romExtension in .atr,.xfd,.atx ;Disks
  148. cliOptions := cliOptions . " -disk1 "
  149. Else if romExtension in .xex,.com,.bas ;Programs
  150. cliOptions := cliOptions . " -run "
  151. Else if romExtension in .cas ;Tapes
  152. {
  153. if (CassetteLoadingMethod = "Auto")
  154. cliOptions := cliOptions . " -boottape "
  155. else
  156. cliOptions := cliOptions . " -tape "
  157. }
  158. Else
  159. ScriptError("Your rom has an extension of " . romExtension . ", only these extensions are supported:`a52,car,cart,rom,cas,atr,xfd,atx,xex,com,bas")
  160. }
  161.  
  162. Run(executable . " " . cliOptions . " """ . romPath . "\" . romName . romExtension, emuPath)
  163.  
  164. WinWait("Atari 800 Emulator ahk_class SDL_app")
  165. WinSet, Transparent, On, ahk_class ConsoleWindowClass ; makes the console window transparent so you don't see it on exit
  166. WinWaitActive("Atari 800 Emulator ahk_class SDL_app")
  167. BezelDraw()
  168.  
  169. if (CassetteLoadingMethod="CLOAD+RUN") {
  170. Sleep,1000
  171. SendCommand("CLOAD{Enter}", 100)
  172. SendCommand("{Enter}", 100)
  173. Sleep, 3000
  174. SendCommand("RUN{Enter}", 100)
  175. }
  176.  
  177. SendCommand(Command, 2000)
  178.  
  179. FadeInExit()
  180. Process("WaitClose", executable)
  181. 7zCleanUp()
  182. FadeOutExit()
  183. ExitModule()
  184.  
  185. CheckCreateFile(file){
  186. IfNotExist, %file%
  187. FileAppend,, %file%
  188. Return file
  189. }
  190.  
  191. CloseProcess:
  192. FadeOutStart()
  193. BezelExit()
  194. WinClose("Atari 800 Emulator ahk_class SDL_app")
  195. Return
Advertisement
Add Comment
Please, Sign In to add comment