rfancella

Atari800.ahk

Dec 1st, 2014
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.01 KB | None | 0 0
  1. MEmu = Atari800
  2. MEmuV = v3.0.0
  3. MURL = http://atari800.sourceforge.net/
  4. MAuthor = djvj & brolly
  5. MVersion = 2.0.3
  6. MCRC = DE313CEF
  7. iCRC = 70DC6577
  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. ; Settings are stored in the registry @ HKEY_CURRENT_USER\Software\Atari800WinPLus
  16. ;
  17. ; Atari 5200:
  18. ; 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)
  19. ;
  20. ; Atari XL:
  21. ; Make sure XL/XE bios paths point to ATARIXL.rom and BASIC points to ATARIBAS.ROM
  22. ;
  23. ; Supported emulation modes via CLI:
  24. ; -atari Emulate Atari 800
  25. ; -1200 Emulate Atari 1200XL
  26. ; -xl Emulate Atari 800XL
  27. ; -xe Emulate Atari 130XE
  28. ; -320xe Emulate Atari 320XE (Compy Shop)
  29. ; -rambo Emulate Atari 320XE (Rambo)
  30. ; -xegs Emulate Atari XEGS
  31. ; -5200 Emulate Atari 5200
  32. ;
  33. ; More CLI commands can be found in DOC\USAGE
  34. ;----------------------------------------------------------------------------
  35. StartModule()
  36. BezelGUI()
  37. FadeInStart()
  38.  
  39. mType := Object("Atari XEGS","xegs","Atari 8-Bit","xl","Atari 5200","5200")
  40. ident := mType[systemName] ; search object for the systemName identifier Atari800 uses
  41. If !ident
  42. ScriptError("Your systemName is: " . systemName . "`nIt is not one of the known supported systems for this Atari800 module: " . moduleName)
  43.  
  44. settingsFile := modulePath . "\" . moduleName . ".ini"
  45. SystemINI := CheckCreateFile(modulePath . "\" . systemName . ".ini")
  46.  
  47. bezelTopOffset := IniReadCheck(settingsFile, "Settings", "bezelTopOffset",32,,1)
  48. bezelBottomOffset := IniReadCheck(settingsFile, "Settings", "bezelBottomOffset",6,,1)
  49. bezelLeftOffset := IniReadCheck(settingsFile, "Settings", "bezelLeftOffset",7,,1)
  50. bezelRightOffset := IniReadCheck(settingsFile, "Settings", "bezelRightOffset",7,,1)
  51.  
  52. 7z(romPath, romName, romExtension, 7zExtractPath)
  53.  
  54. Fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  55. Mouse := IniReadCheck(SystemINI, romName, "Mouse","off",,1)
  56. CartType := IniReadCheck(SystemINI, romName, "CartType",0,,1) ; 1-59 Info found in DOC\cart.txt
  57.  
  58. BezelStart()
  59. fullscreen := If (Fullscreen="true") ? "-fullscreen" : "-windowed"
  60.  
  61. disableHideTitleBar := true
  62.  
  63. If (SystemName = "Atari 5200" and !CartType)
  64. { ;Mapping of a5200 cart sizes to types
  65. ;Note that 16KB carts can be of 2 types One Chip (default and id=16) and Two Chip (id=6), if a game uses a One Chip cart then it should be defined on Atari 5200.ini
  66. a5200cartMaps := Object(4,20,8,19,16,6,32,4,40,7)
  67.  
  68. FileGetSize, fsize, %romPath%\%romName%%romExtension%, K
  69. CartType := a5200cartMaps[fsize] ; search object for the systemName identifier Atari800 uses
  70.  
  71. If (!CartType)
  72. ScriptError("Unknown cart type, make sure you define a CartType for this game on Atari 5200.ini")
  73. }
  74. If (SystemName = "Atari 8-Bit")
  75. { Basic := IniReadCheck(SystemINI, romName, "Basic","false",,1)
  76. OSType := IniReadCheck(SystemINI, romName, "OSType",A_Space,,1)
  77. VideoMode := IniReadCheck(SystemINI, romName, "VideoMode","PAL",,1)
  78. MachineType := IniReadCheck(SystemINI, romName, "MachineType",ident,,1)
  79.  
  80. If MachineType = atari
  81. { ident := MachineType
  82. If (OSType)
  83. ostype := If (OSType="OSa" and VideoMode="PAL") ? "-800-rev a-pal" : (If (OSType="OSa" and VideoMode="NTSC") ? "-800-rev a-ntsc" : "-800-rev b-ntsc")
  84. }
  85. basic := If (Basic="true") ? "-basic" : "-nobasic"
  86. videomode := If (VideoMode="PAL") ? "-pal" : "-ntsc"
  87. }
  88.  
  89. carttype := If (CartType) ? "-cart-type " . CartType : ""
  90.  
  91. If romExtension in .a52,.car,.cart,.rom ; Carts
  92. options = %videomode% -cart
  93. Else if romExtension in .cas ; Tapes
  94. options = %videomode% -boottape
  95. Else if romExtension in .atr,.xfd,.atx ; Disks
  96. options = %ostype% %videomode% -disk1
  97. Else if romExtension in .xex,.com,.bas ; Programs
  98. options = %ostype% %videomode% -run
  99. Else
  100. ScriptError("Your rom has an extension of " . romExtension . ", only these extensions are supported:`a52,car,cart,rom,cas,atr,xfd,atx,xex,com,bas")
  101.  
  102. Run(executable . " " . fullscreen . " -" . ident . " " . carttype . " " . basic . " " . options . " """ . romPath . "\" . romName . romExtension . """ -mouse " . Mouse, emuPath)
  103.  
  104. WinWait("Atari 800 Emulator ahk_class SDL_app")
  105. WinSet, Transparent, On, ahk_class ConsoleWindowClass ; makes the console window transparent so you don't see it on exit
  106. WinWaitActive("Atari 800 Emulator ahk_class SDL_app")
  107.  
  108.  
  109. FadeInExit()
  110. BezelDraw()
  111. Process("WaitClose", executable)
  112. 7zCleanUp()
  113. BezelExit()
  114. FadeOutExit()
  115. ExitModule()
  116.  
  117.  
  118. CheckCreateFile(file){
  119. IfNotExist, %file%
  120. FileAppend,, %file%
  121. Return file
  122. }
  123.  
  124. CloseProcess:
  125. FadeOutStart()
  126. WinClose("Atari 800 Emulator ahk_class SDL_app")
  127. Return
Advertisement
Add Comment
Please, Sign In to add comment