Skip to content

Commit cdf8fd0

Browse files
DeskTop: Don't show error checking all drives with empty floppy
When polling Disk II devices, ERR_DEVICE_NOT_CONNECTED is returned by the ProDOS driver if there is no disk in the drive. This case wasn't explicitly handled by Special > Check All Drives (or Special > Check Drive) so an error was shown. Filter that out. Doesn't repro in Virtual ][ but does repro in MAME and this looks like a real issue, not emulator. Probably regressed with the rework after the 1.5 branch.
1 parent 0b4c6ca commit cdf8fd0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/desktop/main.s

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4873,6 +4873,15 @@ close_loop:
48734873
jmp FormatUnitNum
48744874
END_IF
48754875

4876+
IF A = #ERR_DEVICE_NOT_CONNECTED
4877+
;; If Disk II this just means it is empty
4878+
ldy devlst_index
4879+
lda DEVLST,y
4880+
;; NOTE: Not masked with `UNIT_NUM_MASK`, `IsDiskII` handles it.
4881+
jsr IsDiskII
4882+
RTS_IF ZS ; is Disk II; that's fine
4883+
END_IF
4884+
48764885
;; Show an alert for other errors only if requested by the
48774886
;; caller. The history here is that an error should only be
48784887
;; shown if there is an unexpected type of error (i.e. not one

tests/check_all_drives.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--[[ BEGINCONFIG ========================================
2+
3+
DISKARGS="-hard1 $HARDIMG"
4+
5+
======================================== ENDCONFIG ]]--
6+
-- NOTE: Need at least one empty Disk II drive
7+
8+
test.Step(
9+
"No error if floppy is empty",
10+
function()
11+
a2d.InvokeMenuItem(a2d.SPECIAL_MENU, a2d.SPECIAL_CHECK_ALL_DRIVES)
12+
a2d.WaitForRepaint()
13+
test.Snap("verify no alert shown")
14+
end)

0 commit comments

Comments
 (0)