2017-06-01 23:20:54 +00:00
|
|
|
on run argv
|
|
|
|
set my_path to (system attribute "PWD") & "/"
|
|
|
|
set my_disk to item 1 of argv
|
|
|
|
set my_audio to item 2 of argv
|
|
|
|
set my_screen1 to item 3 of argv
|
|
|
|
set my_timeout1 to item 4 of argv
|
|
|
|
set my_screen2 to item 5 of argv
|
|
|
|
set my_timeout2 to item 6 of argv
|
|
|
|
set my_down to item 7 of argv
|
2017-06-03 18:56:07 +00:00
|
|
|
set my_tapedelay to item 8 of argv
|
|
|
|
set my_demo to item 9 of argv
|
2017-06-01 23:20:54 +00:00
|
|
|
|
|
|
|
tell application "Virtual ]["
|
|
|
|
activate
|
|
|
|
-- may need delay for this error: execution error: Virtual ][ got an error: Connection is invalid. (-609)
|
|
|
|
delay 1.5
|
|
|
|
-- Close all open machines
|
|
|
|
close every machine saving no
|
|
|
|
-- Create a new (AppleIIe)
|
|
|
|
set theMachine to (make new AppleIIe)
|
|
|
|
tell theMachine
|
|
|
|
-- Change to a color screen
|
|
|
|
set monochrome screen to false
|
|
|
|
set scanlines to true
|
2017-06-02 21:37:36 +00:00
|
|
|
set speaker volume to 0.50
|
2017-06-01 23:20:54 +00:00
|
|
|
|
|
|
|
-- load disk
|
|
|
|
insert my_path & my_disk into device "S6D1"
|
|
|
|
|
|
|
|
-- splash page
|
|
|
|
try
|
|
|
|
with timeout of my_timeout1 seconds
|
|
|
|
waiting until screen equals imagefile POSIX path of (my_path & my_screen1)
|
|
|
|
end timeout
|
|
|
|
on error
|
|
|
|
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen1
|
|
|
|
end try
|
|
|
|
|
|
|
|
-- full speed ahead
|
2017-06-03 18:56:07 +00:00
|
|
|
if (my_demo = "0") then
|
|
|
|
set speed to maximum
|
|
|
|
end if
|
2017-06-01 23:20:54 +00:00
|
|
|
|
|
|
|
-- main screen
|
|
|
|
try
|
|
|
|
with timeout of my_timeout2 seconds
|
|
|
|
waiting until screen equals imagefile POSIX path of (my_path & my_screen2)
|
|
|
|
end timeout
|
|
|
|
on error
|
|
|
|
return "ERROR: TIMEOUT: Virtual ][ screen != " & my_screen2
|
|
|
|
end try
|
|
|
|
|
|
|
|
-- normal speed
|
|
|
|
set speed to regular
|
|
|
|
|
|
|
|
-- down arrow 17x and return
|
|
|
|
repeat my_down times
|
|
|
|
type key down arrow
|
|
|
|
delay 0.03
|
|
|
|
end repeat
|
|
|
|
delay 0.5
|
|
|
|
type line ""
|
|
|
|
delay 1.0
|
|
|
|
|
|
|
|
-- send audio
|
|
|
|
play my_path & my_audio on device "cassette recorder"
|
|
|
|
delay 1.0
|
|
|
|
-- full speed ahead
|
2017-06-03 18:56:07 +00:00
|
|
|
if (my_demo = "0") then
|
|
|
|
set speed to maximum
|
|
|
|
end if
|
|
|
|
delay my_tapedelay
|
2017-06-01 23:20:54 +00:00
|
|
|
-- normal speed
|
|
|
|
set speed to regular
|
|
|
|
|
|
|
|
-- eject tape
|
|
|
|
eject device "cassette recorder"
|
|
|
|
|
|
|
|
end tell
|
|
|
|
-- delay 0.5
|
|
|
|
-- close every machine saving no
|
|
|
|
-- quit
|
|
|
|
end tell
|
|
|
|
end run
|
|
|
|
|