Skip to content

Commit 448bff5

Browse files
Tests: Various automations and de-duping
Also fix SetProDOSDate bit shifting
1 parent 7c864d8 commit 448bff5

File tree

14 files changed

+24
-52
lines changed

14 files changed

+24
-52
lines changed

tests/calendar.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ end)
1717
test.Step(
1818
"Calendar - without real-time clock",
1919
function()
20-
-- Remove clock driver
21-
a2d.OpenPath("/A2.DESKTOP/EXTRAS/BASIC.SYSTEM")
22-
a2d.WaitForRestart()
23-
apple2.TypeLine("DELETE /A2.DESKTOP/CLOCK.SYSTEM")
24-
apple2.TypeLine("PR#7")
25-
a2d.WaitForRestart()
20+
RemoveClockDriverAndRestart()
2621

2722
a2d.OpenPath("/A2.DESKTOP/APPLE.MENU/CALENDAR")
2823
a2d.WaitForRepaint()

tests/configs/iic4.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ DISKARGS="-flop1 $FLOP1IMG"
66
77
======================================== ENDCONFIG ]]--
88

9-
emu.wait(50) -- IIc emulation is very slow
10-
119
test.Step(
1210
"Apple > About This Apple II",
1311
function()

tests/configs/iicplus.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ DISKARGS="-flop3 $HARDIMG"
66
77
======================================== ENDCONFIG ]]--
88

9-
emu.wait(50) -- IIc emulation is very slow
10-
119
test.Step(
1210
"Apple > About This Apple II",
1311
function()

tests/control_panel.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ DISKARGS="-flop3 $HARDIMG"
66
77
======================================== ENDCONFIG ]]--
88

9-
emu.wait(50) -- IIc emulation is very slow
10-
119
test.Step(
1210
"custom and default pattern",
1311
function()

tests/date_and_time.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,7 @@ test.Step(
7777
a2d.CloseAllWindows()
7878
end)
7979

80-
-- Remove clock driver
81-
a2d.OpenPath("/A2.DESKTOP/EXTRAS/BASIC.SYSTEM")
82-
a2d.WaitForRestart()
83-
apple2.TypeLine("DELETE /A2.DESKTOP/CLOCK.SYSTEM")
84-
apple2.TypeLine("PR#7")
85-
a2d.WaitForRestart()
80+
RemoveClockDriverAndRestart()
8681

8782
test.Step(
8883
"Fresh disk image",

tests/international.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
============================================================]]--
77

88
-- Remove clock driver (to avoid build-relative dates)
9-
a2d.OpenPath("/A2.DESKTOP/EXTRAS/BASIC.SYSTEM")
10-
a2d.WaitForRestart()
11-
apple2.TypeLine("DELETE /A2.DESKTOP/CLOCK.SYSTEM")
12-
apple2.TypeLine("PR#7")
13-
a2d.WaitForRestart()
9+
RemoveClockDriverAndRestart()
1410

1511
test.Step(
1612
"International - full repaint",

tests/key_caps_apple2c.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ DISKARGS="-flop1 $FLOP1IMG -flop2 $FLOP2IMG"
66
77
======================================== ENDCONFIG ]]--
88

9-
emu.wait(50) -- IIc emulation is very slow
10-
119
test.Step(
1210
"Key Caps - Apple IIc",
1311
function()

tests/key_caps_apple2cp.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ DISKARGS="-flop3 $HARDIMG"
66
77
======================================== ENDCONFIG ]]--
88

9-
emu.wait(50) -- IIc emulation is very slow
10-
119
test.Step(
1210
"Key Caps - Apple IIc+",
1311
function()

tests/lib/a2d.lua

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ function a2d.WaitForCopyToRAMCard()
8181
end
8282

8383
function a2d.WaitForRestart()
84-
emu.wait(10)
84+
if manager.machine.system.name:match("^apple2c") then
85+
-- Apple IIc drive emulation is very slow
86+
emu.wait(50)
87+
else
88+
emu.wait(10)
89+
end
8590
end
8691

8792
function a2d.WaitForRepaint()
@@ -353,6 +358,18 @@ function a2d.CopyPath(src, dst)
353358
a2d.CopyTo(dst)
354359
end
355360

361+
--------------------------------------------------
362+
-- Configuration
363+
--------------------------------------------------
364+
365+
function RemoveClockDriverAndRestart()
366+
a2d.OpenPath("/A2.DESKTOP/EXTRAS/BASIC.SYSTEM")
367+
a2d.WaitForRestart()
368+
apple2.TypeLine("DELETE /A2.DESKTOP/CLOCK.SYSTEM")
369+
apple2.TypeLine("PR#7")
370+
a2d.WaitForRestart()
371+
end
372+
356373
--------------------------------------------------
357374
-- Mouse Keys
358375
--------------------------------------------------
@@ -519,7 +536,7 @@ end
519536
--------------------------------------------------
520537

521538
function a2d.SetProDOSDate(y,m,d)
522-
local hi = (y % 100) << 1 | (m >> 4)
539+
local hi = (y % 100) << 1 | (m >> 3)
523540
local lo = (m << 5) | d
524541
apple2.WriteRAMDevice(0xBF90, lo)
525542
apple2.WriteRAMDevice(0xBF91, hi)

tests/options.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ DISKARGS="-flop3 $HARDIMG"
66
77
======================================== ENDCONFIG ]]--
88

9-
emu.wait(50) -- IIc emulation is very slow
10-
119
test.Step(
1210
"No prompt if no change",
1311
function()

0 commit comments

Comments
 (0)