RAMDRV: Place new unit number last in DEVLST

ProDOS prefers disks sorted with the fastest (e.g. ramdisks) at the
end and slowest (e.g. 5.25 floppies) at the start. This facilitates
pathname resolution starting at the end of DEVLST, so misses are
cheap.
This commit is contained in:
Joshua Bell 2022-06-02 22:15:45 -07:00
parent c323b205bc
commit 536ed14b60

View File

@ -341,13 +341,10 @@ copy_driver:
dey dey
bpl :- bpl :-
;; Shift devices up by one ;; Otherwise, insert at end. ProDOS resolves names to devices
;; from last to first, so fast RAM disks should go last.
inc DEVCNT inc DEVCNT
ldy DEVCNT ldy DEVCNT
: lda DEVLST-1,y
sta DEVLST,y
dey
bne :-
;; Install device in ProDOS via DEVLST/DEVADR. ;; Install device in ProDOS via DEVLST/DEVADR.
;; (Y has index in DEVLST) ;; (Y has index in DEVLST)