Advertisement
rfancella

BeebEm Beta.ahk

Sep 19th, 2014
392
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.28 KB | None | 0 0
  1. MEmu = BeebEm
  2. MEmuV = v4.14
  3. MURL = http://www.mkw.me.uk/beebem
  4. MAuthor = craiganderson & rfancella
  5. MVersion = 1.3
  6. MCRC =
  7. iCRC =
  8. MID =
  9. MSystem = "Acorn BBC Micro"
  10. ;----------------------------------------------------------------------------
  11. ; Notes:
  12. ;The vast majority of images within the archive contain a BASIC loader file, so the following should suffice:
  13. ;
  14. ;This will happen auto if the file ext is .udf and it does not have " start)" in the file name:
  15. ;
  16. ;*TAPE
  17. ;PAGE=&E00
  18. ;CHAIN ""
  19. ;
  20. ;If it has " start)" in the file name, the module will enter this:
  21. ;
  22. ;*TAPE
  23. ;*RUN
  24. ;
  25. ;If the file extension is .ssd and has " start)" in the file name, it will enter:
  26. ;
  27. ;*RUN for you. I hope to make it extract the run name and enter it also soon.
  28. ;
  29. ;Added a key method. If you get a Bad Command when a game is run, try Method 2
  30. ;----------------------------------------------------------------------------
  31. StartModule()
  32. BezelGUI()
  33. FadeInStart()
  34.  
  35. 7z(romPath, romName, romExtension, 7zExtractPath)
  36.  
  37. screensize := ""
  38. settingsFile := modulePath . "\" . moduleName . ".ini"
  39. inputBlock := IniReadCheck(settingsFile, "Settings", "inputBlock","true",,1)
  40. Fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
  41. methodForKeys := IniReadCheck(settingsFile, "Settings", "methodForKeys",1,,1)
  42. startCommand := IniReadCheck(settingsFile, romName, "startCommand","",,1)
  43. keyDelay := IniReadCheck(settingsFile, "Settings" . "|" . romName, "keyDelay", "75",,1)
  44. SendCommandDelay := IniReadCheck(settingsFile, "Settings" . "|" . romName, "SendCommandDelay", "2000",,1)
  45. WaitBetweenSends := IniReadCheck(settingsFile, "Settings" . "|" . romName, "WaitBetweenSends", "false",,1)
  46.  
  47. CheckFile(moduleExtensionsPath . "\BlockInput.exe")
  48.  
  49. BezelStart()
  50. screensize := If Fullscreen = "true" ? "-fullscreen " : ""
  51.  
  52. If inputBlock = true
  53. {
  54. Run("BlockInput.exe 30", moduleExtensionsPath) ; start the tool that blocks all input so user cannot interrupt the launch process for 30 seconds
  55. }
  56.  
  57. Run(executable . " """ . romPath . "\" . romName . romExtension . """ " . screensize, emuPath)
  58. WinWait("ahk_class BEEBWIN")
  59. WinWaitActive("ahk_class BEEBWIN")
  60. BezelDraw()
  61. FadeInExit()
  62.  
  63. If romExtension = .ssd
  64. {
  65. If (startCommand <> "")
  66. {
  67. If (methodForKeys = 2)
  68. {
  69. Command := "*disk{Return}{wait}*run{SPACE}" . startCommand . "{Return}{wait}run{Return}"
  70. } Else {
  71. Command := "~disk{Return}{wait}~run{SPACE}" . startCommand . "{Return}{wait}run{Return}"
  72. }
  73. }
  74. } Else If romExtension = .uef
  75. {
  76. startString := "(RUN start)"
  77. startUEF := InStr(romName, startString)
  78. If (startUEF > 0) || (startCommand <> "")
  79. {
  80. If (methodForKeys = 2)
  81. {
  82. Command := "*tape{Return}{wait}*run{Return}"
  83. } Else {
  84. Command := "~tape{Return}{wait}~run{Return}"
  85. }
  86. } Else {
  87. If (methodForKeys = 2)
  88. {
  89. Command := "*tape{Enter}{wait}page=&e00{Enter}{wait}chain@@{Enter}"
  90. } Else {
  91. Command := "~tape{Enter}{wait}page_^e00{Enter}{wait}chain@@{Enter}"
  92. }
  93. }
  94. }
  95.  
  96. SendCommand(Command, SendCommandDelay, keyDelay, WaitBetweenSends)
  97.  
  98. If inputBlock = true
  99. {
  100. Process("Close", "BlockInput.exe") ; end script that blocks all input
  101. }
  102.  
  103. Process("WaitClose", executable)
  104. 7zCleanUp()
  105. BezelExit()
  106. FadeOutExit()
  107. ExitModule()
  108.  
  109. CloseProcess:
  110. FadeOutStart()
  111. WinClose("ahk_class BEEBWIN")
  112. Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement