BuhBye: Cycle through volumes after the boot volume more intuitively

Previously, the boot volume was shown first, but then tab would cycle
from the highest priority volume to the lowest. This would be awkward
if the boot volume was not the highest priority volume. For example,
with these devices (listed lowest to highest priority, like DEVLST),
/HD1 is the boot volume but the RAM disks are highest priority:

(low) /FLOPPY2 /FLOPPY1 /HD4 /HD3 /HD2 /HD1 /RAMWORKS /RAM (high)

Prior to this fix, it would cycle:

/HD1 /RAM /RAMWORKS /HD1 /HD2 /HD3 /HD4 /FLOPPY1 /FLOPPY2 /RAM ...

After this fix, it will cycle:

/HD1 /HD2 /HD3 /HD4 /FLOPPY1 /FLOPPY2 /RAM /RAMWORKS /HD1 ...

To fit, a little bit of code golfing was necessary.
This commit is contained in:
Joshua Bell 2022-09-01 20:38:07 -07:00
parent 145aba1f66
commit 9590bc4b9e
1 changed files with 21 additions and 20 deletions

View File

@ -100,7 +100,7 @@ loop: lda (src_ptr) ; *src_ptr = *dst_ptr
read_buffer := $2000 ; Also, start location for launched SYS files read_buffer := $2000 ; Also, start location for launched SYS files
;; Device/Prefix enumeration ;; Device/Prefix enumeration
next_device_num := $65 ; next device number to try cur_device_num := $65 ; device number to try
prefix_depth := $6B ; 0 = root prefix_depth := $6B ; 0 = root
;; Directory enumeration ;; Directory enumeration
@ -146,22 +146,23 @@ loop: lda (src_ptr) ; *src_ptr = *dst_ptr
sta BITMAP sta BITMAP
;; Find device ;; Find device
lda DEVCNT ; max device num ldx DEVCNT
sta next_device_num : lda DEVLST,x
lda DEVNUM and #%11110000
bne check_device cmp DEVNUM
beq check_device
dex
bra :-
next_device: next_device:
ldx next_device_num ldx cur_device_num
lda DEVLST,x dex
cpx #1 bpl :+
bcs :+
ldx DEVCNT ldx DEVCNT
inx : lda DEVLST,x
: dex
stx next_device_num
check_device: check_device:
stx cur_device_num
sta on_line_params_unit sta on_line_params_unit
MLI_CALL ON_LINE, on_line_params MLI_CALL ON_LINE, on_line_params
bcs next_device bcs next_device
@ -256,9 +257,9 @@ store_entry:
sta (curr_ptr),y sta (curr_ptr),y
dey dey
bpl :- bpl :-
iny ; Y = 0; storage_type/name_length in A ; storage_type/name_length in A
and #%00001111 ; mask off name_length (remove storage_type) and #%00001111 ; mask off name_length (remove storage_type)
sta (curr_ptr),y ; store length sta (curr_ptr) ; store length
inc num_entries inc num_entries
@ -300,9 +301,9 @@ next_in_block:
lda entry_pointer lda entry_pointer
adc entry_length adc entry_length
sta entry_pointer sta entry_pointer
lda entry_pointer+1 bcc :+
adc #0 inc entry_pointer+1
sta entry_pointer+1 :
inc block_entries inc block_entries
@ -568,9 +569,9 @@ loop: lda help_string,y
clc clc
adc curr_ptr+1 adc curr_ptr+1
sta curr_ptr+1 sta curr_ptr+1
ldy #0 lda (curr_ptr)
lda (curr_ptr),y
sta curr_len sta curr_len
ldy #0 ; needed by caller
;; fall through ;; fall through
.endproc .endproc
@ -691,7 +692,7 @@ cout: jmp COUT
;;; ------------------------------------------------------------ ;;; ------------------------------------------------------------
.endproc .endproc
.assert .sizeof(selector) <= max_size, error, "Must fit in $300 bytes" .assert .sizeof(selector) <= max_size, error, .sprintf("Must fit in $300 bytes, is: $%x", .sizeof(selector))
install_size = .sizeof(selector) install_size = .sizeof(selector)
poporg poporg