Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MEmu = BeebEm
- MEmuV = v4.14
- MURL = http://www.mkw.me.uk/beebem
- MAuthor = craiganderson & rfancella
- MVersion = 1.3
- MCRC =
- iCRC =
- MID =
- MSystem = "Acorn BBC Micro"
- ;----------------------------------------------------------------------------
- ; Notes:
- ;The vast majority of images within the archive contain a BASIC loader file, so the following should suffice:
- ;
- ;This will happen auto if the file ext is .udf and it does not have " start)" in the file name:
- ;
- ;*TAPE
- ;PAGE=&E00
- ;CHAIN ""
- ;
- ;If it has " start)" in the file name, the module will enter this:
- ;
- ;*TAPE
- ;*RUN
- ;
- ;If the file extension is .ssd and has " start)" in the file name, it will enter:
- ;
- ;*RUN for you. I hope to make it extract the run name and enter it also soon.
- ;
- ;Added a key method. If you get a Bad Command when a game is run, try Method 2
- ;----------------------------------------------------------------------------
- StartModule()
- BezelGUI()
- FadeInStart()
- 7z(romPath, romName, romExtension, 7zExtractPath)
- screensize := ""
- settingsFile := modulePath . "\" . moduleName . ".ini"
- inputBlock := IniReadCheck(settingsFile, "Settings", "inputBlock","true",,1)
- Fullscreen := IniReadCheck(settingsFile, "Settings", "Fullscreen","true",,1)
- methodForKeys := IniReadCheck(settingsFile, "Settings", "methodForKeys",1,,1)
- startCommand := IniReadCheck(settingsFile, romName, "startCommand","",,1)
- keyDelay := IniReadCheck(settingsFile, "Settings" . "|" . romName, "keyDelay", "75",,1)
- SendCommandDelay := IniReadCheck(settingsFile, "Settings" . "|" . romName, "SendCommandDelay", "2000",,1)
- WaitBetweenSends := IniReadCheck(settingsFile, "Settings" . "|" . romName, "WaitBetweenSends", "false",,1)
- CheckFile(moduleExtensionsPath . "\BlockInput.exe")
- BezelStart()
- screensize := If Fullscreen = "true" ? "-fullscreen " : ""
- If inputBlock = true
- {
- Run("BlockInput.exe 30", moduleExtensionsPath) ; start the tool that blocks all input so user cannot interrupt the launch process for 30 seconds
- }
- Run(executable . " """ . romPath . "\" . romName . romExtension . """ " . screensize, emuPath)
- WinWait("ahk_class BEEBWIN")
- WinWaitActive("ahk_class BEEBWIN")
- BezelDraw()
- FadeInExit()
- Sleep, 100
- SetKeyDelay, %keyDelay%, 100
- If romExtension = .ssd
- {
- If (startCommand <> "")
- {
- If (methodForKeys = 2)
- {
- Send, {* down}{* up}{d down}{d up}{i down}{i up}{s down}{s up}{k down}{k up}{RETURN down}{RETURN up}
- Sleep, 100
- Send, {* down}{* up}{R down}{R up}{u down}{u up}{n down}{n up}{SPACE down}{SPACE up}
- StringSplit, commandArray, startCommand
- Loop, %commandArray0%
- {
- commandChar := commandArray%a_index%
- Send, {%commandChar% down}{%commandChar% up}
- }
- Send, {RETURN down}{RETURN up}
- Sleep, 100
- Send, {R down}{R up}{u down}{u up}{n down}{n up}{RETURN down}{RETURN up}
- } Else {
- Send, {@ down}{@ up}{d down}{d up}{i down}{i up}{s down}{s up}{k down}{k up}{RETURN down}{RETURN up}
- Sleep, 100
- Send, {@ down}{@ up}{R down}{R up}{u down}{u up}{n down}{n up}{SPACE down}{SPACE up}
- StringSplit, commandArray, startCommand
- Loop, %commandArray0%
- {
- commandChar := commandArray%a_index%
- Send, {%commandChar% down}{%commandChar% up}
- }
- Send, {RETURN down}{RETURN up}
- Sleep, 100
- Send, {R down}{R up}{u down}{u up}{n down}{n up}{RETURN down}{RETURN up}
- }
- }
- } Else If romExtension = .uef
- {
- startString := "(RUN start)"
- startUEF := InStr(romName, startString)
- If (startUEF > 0) || (startCommand <> "")
- {
- If (methodForKeys = 2)
- {
- Send, {* down}{* up}{t down}{t up}{a down}{a up}{p down}{p up}{e down}{e up}{ENTER down}{ENTER up}
- Sleep, 1000
- Send, {* down}{* up}{r down}{r up}{u down}{u up}{n down}{n up}{ENTER down}{ENTER up}
- } Else {
- Send, {@ down}{@ up}{t down}{t up}{a down}{a up}{p down}{p up}{e down}{e up}{ENTER down}{ENTER up}
- Sleep, 1000
- Send, {@ down}{@ up}{r down}{r up}{u down}{u up}{n down}{n up}{ENTER down}{ENTER up}
- }
- } Else {
- If (methodForKeys = 2)
- {
- Send, {* down}{* up}{t down}{t up}{a down}{a up}{p down}{p up}{e down}{e up}{ENTER down}{ENTER up}
- Sleep,1000
- Send, {p down}{p up}{a down}{a up}{g down}{g up}{e down}{e up}{= down}{= up}{& down}{& up}{e down}{e up}{0 down}{0 up}{0 down}{0 up}{ENTER down}{ENTER up}
- Sleep,1000
- Send, {c down}{c up}{h down}{h up}{a down}{a up}{i down}{i up}{n down}{n up}{@ down}{@ up}
- Sleep,100
- Send, {@ down}{@ up}{ENTER down}{ENTER up}
- } Else {
- Send, {~ down}{~ up}{t down}{t up}{a down}{a up}{p down}{p up}{e down}{e up}{ENTER down}{ENTER up}
- Sleep,1000
- Send, {p down}{p up}{a down}{a up}{g down}{g up}{e down}{e up}{_ down}{_ up}{^ down}{^ up}{e down}{e up}{0 down}{0 up}{0 down}{0 up}{ENTER down}{ENTER up}
- Sleep,1000
- Send, {c down}{c up}{h down}{h up}{a down}{a up}{i down}{i up}{n down}{n up}{@ down}{@ up}
- Sleep,100
- Send, {@ down}{@ up}{ENTER down}{ENTER up}
- }
- }
- }
- If inputBlock = true
- {
- Process("Close", "BlockInput.exe") ; end script that blocks all input
- }
- Process("WaitClose", executable)
- 7zCleanUp()
- BezelExit()
- FadeOutExit()
- ExitModule()
- CloseProcess:
- FadeOutStart()
- WinClose("ahk_class BEEBWIN")
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement