rfancella

AAE.ahk

Jan 14th, 2015
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. MEmu = AAE
  2. MEmuV = v12/13/08
  3. MURL = http://pages.suddenlink.net/aae/
  4. MAuthor = djvj
  5. MVersion = 2.0.4
  6. MCRC = FC2B9DFA
  7. iCRC = 3EAF94CD
  8. MID = 635038268873928953
  9. MSystem = "AAE"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ; To apply the updates, first extract the aae092808.zip to its own folder. Then extract aaeu1.zip (10/26/08 build) on top of it overwriting existing files. Do this again for aaeu2.zip (12/13/08 build)
  13. ; 12/13/08 release crashes on launch if you have joysticks plugged in or virtual joystick drivers like VJoy installed. If you cannot change this, use AAE from 10/26/08.
  14. ; Open your aae.log if it crashes and if it's filled with joystick control info, you need to unplug one joystick at a time until it stops happening.
  15. ; Even just having your 360 controller receiver in can crash the exe. Nothing you can do except use another emu or always know to unplug your controllers.
  16. ; In the aae.ini, If mame_rom_path has a # before it, remove it.
  17. ; You can start the emu and press TAB to set some options.
  18. ;----------------------------------------------------------------------------
  19. StartModule()
  20. BezelGUI()
  21. FadeInStart()
  22.  
  23. settingsFile := modulePath . "\" . moduleName . ".ini"
  24. Fullscreen := IniReadCheck(settingsFile, "settings", "Fullscreen","true",,1) ; true (fake full screen), false (Windowed mode) and Fullscreen (normal fullscreen. Do not work with Pause.)
  25. bezelMode := IniReadCheck(settingsFile, "Settings" . "|" . romName, "BezelMode","Layout",,1) ; "Layout" or "FixResMode"
  26. Artwork_Crop := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Artwork_Crop", "true",,1)
  27. Use_Artwork := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Use_Artwork", "true",,1)
  28. Use_Overlays := IniReadCheck(settingsFile, "Settings" . "|" . romName, "Use_Overlays", "true",,1)
  29.  
  30. aaeINI := CheckFile(emuPath . "\aae.ini")
  31.  
  32. ; Enabling Bezel components
  33. If bezelEnabled = true
  34. { If bezelMode = FixResMode
  35. { IniWrite, 0, %aaeINI%, main, bezel
  36. IniWrite, %Use_Artwork%, %aaeINI%, main, artwork
  37. IniWrite, %Use_Overlays%, %aaeINI%, main, overlay
  38. IniWrite, %Artwork_Crop%, %aaeINI%, main, artcrop
  39. BezelStart("FixResMode")
  40. } Else {
  41. IniWrite, 1, %aaeINI%, main, bezel
  42. IniWrite, %Use_Artwork%, %aaeINI%, main, artwork
  43. IniWrite, %Use_Overlays%, %aaeINI%, main, overlay
  44. IniWrite, %Artwork_Crop%, %aaeINI%, main, artcrop
  45. }
  46. } Else {
  47. IniWrite, 0, %aaeINI%, main, bezel
  48. IniWrite, %Use_Artwork%, %aaeINI%, main, artwork
  49. IniWrite, %Use_Overlays%, %aaeINI%, main, overlay
  50. IniWrite, %Artwork_Crop%, %aaeINI%, main, artcrop
  51. }
  52.  
  53. ; Creating fake fullscreen mode if fullscreen is true because Pause is not compatible with AAE fullscreen mode.
  54. IniRead, currentFullScreen, %aaeINI%, main, windowed
  55. If (currentFullScreen = 0) and (Fullscreen != "Fullscreen")
  56. IniWrite, 1, %aaeINI%, main, windowed
  57. Else If (currentFullScreen = 1) and (Fullscreen = "Fullscreen")
  58. IniWrite, 0, %aaeINI%, main, windowed
  59. If (Fullscreen = "true"){
  60. IniWrite, %A_ScreenWidth%, %aaeINI%, main, screenw
  61. IniWrite, %A_ScreenHeight%, %aaeINI%, main, screenh
  62. }
  63.  
  64. hideEmuObj := Object("ahk_class AllegroWindow",1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
  65. 7z(romPath, romName, romExtension, 7zExtractPath)
  66.  
  67. IniWrite, %romPath%, %aaeINI%, main, mame_rom_path ; update AAE's rom path so it's always correct and also works with 7z
  68.  
  69. HideEmuStart() ; This fully ensures windows are completely hidden even faster than winwait
  70.  
  71. Run(executable . A_Space . romName,emuPath)
  72.  
  73. WinWait("ahk_class AllegroWindow")
  74. WinWaitActive("ahk_class AllegroWindow")
  75.  
  76. If (Fullscreen = "true"){
  77. Sleep, 200
  78. WinSet, Style, -0xC00000, A
  79. }
  80.  
  81. BezelDraw()
  82. HideEmuEnd()
  83. FadeInExit()
  84. Process("WaitClose",executable)
  85. 7zCleanUp()
  86. BezelExit()
  87. FadeOutExit()
  88. ExitModule()
  89.  
  90.  
  91. RestoreEmu:
  92. timeout := A_TickCount
  93. Loop {
  94. WinClose("ahk_class #32770", "Crap")
  95. If (!ErrorLevel || timeout < A_TickCount - 3000)
  96. Break
  97. Sleep, 50
  98. }
  99. Return
  100.  
  101. CloseProcess:
  102. FadeOutStart()
  103. WinClose("ahk_class AllegroWindow")
  104. Return
Advertisement
Add Comment
Please, Sign In to add comment