From c1530c01640e2d3e149a62eea2fa1b5fa14088c9 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Sat, 16 Mar 2024 16:16:05 -0700 Subject: [PATCH] Disk Copy: Apply GS/OS case bits to ProDOS volume names, if present Turned out to be easier to slip in than I thought. Fixes #428 --- RELEASE-NOTES.md | 1 + disk_copy/auxlc.s | 53 ++++++++++++++++++++++++++++++++++++------- res/notes/testplan.md | 4 +++- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index c446c42b..392a8829 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -69,6 +69,7 @@ Project Page: https://github.com/a2stuff/a2d * Hide "Select Quit..." once menu is not accessible. * Show correct block counts during Quick Copy. * Show progress bar during copy. +* Apply GS/OS case bits to ProDOS volume names, if present. ([#428](https://github.com/a2stuff/a2d/issues/428)) ### Desk Accessories diff --git a/disk_copy/auxlc.s b/disk_copy/auxlc.s index a788640e..6270d4f5 100644 --- a/disk_copy/auxlc.s +++ b/disk_copy/auxlc.s @@ -590,8 +590,7 @@ source_is_pro: lda main__on_line_buffer2+1 jmp check_source_error : - sta main__on_line_buffer2 - param_call AdjustCase, main__on_line_buffer2 + param_call AdjustOnLineEntryCase, main__on_line_buffer2 jsr DrawSourceDriveInfo check_source_finish: @@ -667,8 +666,7 @@ use_sd: tax ; slot/drive lda #kAlertMsgConfirmEraseSlotDrive ; X = unit number ELSE - sta main__on_line_buffer2 - param_call AdjustCase, main__on_line_buffer2 + param_call AdjustOnLineEntryCase, main__on_line_buffer2 ldxy #main__on_line_buffer2 lda #kAlertMsgConfirmErase ; X,Y = ptr to volume name END_IF @@ -1366,13 +1364,52 @@ match: clc ;;; ============================================================ -.proc AdjustCase +;;; Input: A,X is ON_LINE data buffer entry *including* the +;;; slot/drive bits, not just the name. +;;; Output: entry is length-prefix, case-adjusted + +.proc AdjustOnLineEntryCase ptr := $A stax ptr + + ldy #0 + lda (ptr),y + pha + and #UNIT_NUM_MASK ; stash unit number + sta main__block_params_unit_num + pla + and #NAME_LENGTH_MASK + sta (ptr),y ; mask off length + + ;; -------------------------------------------------- + ;; Check for GS/OS case bits, apply if found + + copy16 #2, main__block_params_block_num + copy16 #default_block_buffer, main__block_params_data_buffer + jsr main__ReadBlock + bcs fallback + + case_bytes := default_block_buffer + $1A + asl16 case_bytes + bcc fallback ; High bit set = GS/OS case bits present + + ldy #1 +bloop: asl16 case_bytes ; Shift out high byte first + bcc :+ + lda (ptr),y + ora #AS_BYTE(~CASE_MASK) + sta (ptr),y +: iny + cpy #16 ; bits + bcc bloop + rts + + ;; -------------------------------------------------- + ;; Use heuristic +fallback: ldy #0 lda (ptr),y - and #NAME_LENGTH_MASK ; handle ON_LINE results, etc beq done ;; Walk backwards through string. At char N, check char N-1; if @@ -1399,7 +1436,7 @@ check_alpha: sta (ptr),y : dey bpl loop ; always -.endproc ; AdjustCase +.endproc ; AdjustOnLineEntryCase ;;; ============================================================ @@ -1522,7 +1559,7 @@ is_prodos: sta drive_unitnum_table,x ldax $06 - jsr AdjustCase + jsr AdjustOnLineEntryCase lda num_drives asl a asl a diff --git a/res/notes/testplan.md b/res/notes/testplan.md index b7159ecc..ff366246 100644 --- a/res/notes/testplan.md +++ b/res/notes/testplan.md @@ -1033,15 +1033,17 @@ With Sci.Calc: * Configure a system with 8 or fewer drives. Launch DeskTop. Special > Copy Disk.... Verify that the scrollbar is inactive. * Configure a system with 9 or more drives. Launch DeskTop. Special > Copy Disk.... Verify that the scrollbar is active. -* Launch DeskTop. Special > Copy Disk.... Verify that ProDOS disk names in the device list have adjusted case (e.g. "Volume" not "VOLUME"). +* Launch DeskTop. Special > Copy Disk.... Verify that ProDOS disk names in the device list have adjusted case (e.g. "Volume" not "VOLUME"). Verify that GS/OS disk names in the device list have correct case (e.g. "GS.OS.disk" not "Gs.Os.Disk"). * Launch DeskTop. Special > Copy Disk.... Verify that Pascal disk names in the device list do not have adjusted case (e.g. "TGP:" not "Tgp:"). * Launch DeskTop. Special > Copy Disk.... Verify that DOS 3.3 disk names in the device list appear as "DOS 3.3 Sn, Dn" and do not have adjusted case. * Launch DeskTop. Special > Copy Disk.... Select a ProDOS disk as a source disk. Verify that after the "Insert source disk" prompt is dismissed, the volume name appears on the "Source" line and the name has adjusted case (e.g. "Volume" not "VOLUME"). +* Launch DeskTop. Special > Copy Disk.... Select a GS/OS disk as a source disk. Verify that after the "Insert source disk" prompt is dismissed, the volume name appears on the "Source" line and the name has correct case (e.g. "GS.OS.disk" not "Gs.Os.Disk"). * Launch DeskTop. Special > Copy Disk.... Select a Pascal disk as a source disk. Verify that after the "Insert source disk" prompt is dismissed, the volume name appears on the "Source" line and the name does not have adjusted case (e.g. "TGP:" not "Tgp:"). * Launch DeskTop. Special > Copy Disk.... Select a DOS 3.3 disk as a source disk. Verify that after the "Insert source disk" prompt is dismissed, no volume name appears on the "Source" line. * Launch DeskTop. Special > Copy Disk.... Select a ProDOS disk as a destination disk. Verify that in the "Do you want to erase ...?" dialog that the name has adjusted case (e.g. "Volume" not "VOLUME"), and the name is quoted. +* Launch DeskTop. Special > Copy Disk.... Select a GS/OS disk as a destination disk. Verify that in the "Do you want to erase ...?" dialog that the name has correct case (e.g. "GS.OS.disk" not "Gs.Os.Disk"), and the name is quoted. * Launch DeskTop. Special > Copy Disk.... Select a Pascal disk as a destination disk. Verify that in the "Do you want to erase ...?" dialog that the name does not have adjusted case (e.g. "TGP:" not "Tgp:"), and the name is quoted. * Launch DeskTop. Special > Copy Disk.... Select a DOS 3.3 disk as a destination disk. Verify that in the "Do you want to erase ...?" dialog that the prompt describes the disk using slot and drive, and is not quoted.