NEW: identify Dinkey-DOS (Ultima V, Times of Lore, others)

This commit is contained in:
4am 2017-12-06 14:12:45 -05:00
parent 04161ee164
commit 5bbce307a8
7 changed files with 49 additions and 6 deletions

View File

@ -2,7 +2,7 @@
; globally-accessible variables
; in fixed position to allow
; compressed code to work
; offsets must match t00defs.a
; offsets must match apidefs.a
;-------------------------------
;gNIBTable
@ -122,6 +122,10 @@ FIRSTFILTER
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in IDBootloader() after reading T00,S00
;gIsDinkeyDOS
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in IDBootloader() after reading T00,S00
;gIsProDOS
!byte FALSE ; 0=true, 1=false
; reset before each operation

View File

@ -62,7 +62,8 @@ gIsBoot1 = gIsBoot0-$01 ; byte
gIsMaster = gIsBoot1-$01 ; byte
gIsRWTS = gIsMaster-$01 ; byte
gIsProDOS = gIsRWTS-$01 ; byte
gIsPascal = gIsProDOS-$01 ; byte
gIsDinkeyDOS = gIsProDOS-$01 ; byte
gIsPascal = gIsDinkeyDOS-$01 ; byte
gIsProtDOS = gIsPascal-$01 ; byte
gIsDavidDOS = gIsProtDOS-$01 ; byte
gIsEA = gIsDavidDOS-$01 ; byte
@ -123,6 +124,7 @@ ConstructStandardDelivery = jConstructStandardDelivery
!warn "gIsMaster=",gIsMaster
!warn "gIsRWTS=",gIsRWTS
!warn "gIsProDOS=",gIsProDOS
!warn "gIsDinkeyDOS=",gIsDinkeyDOS
!warn "gIsPascal=",gIsPascal
!warn "gIsProtDOS=",gIsProtDOS
!warn "gIsDavidDOS=",gIsDavidDOS

19
src/id/dinkeydos.a Normal file
View File

@ -0,0 +1,19 @@
;-------------------------------
; IDDinkeyDOS
; identify Dinkey-DOS by filename in ProDOS catalog
;
; in: track buffer contains T00,S0B
; out: C clear if Dinkey-DOS found
; C set otherwise
; all registers clobbered
; all other flags clobbered
;-------------------------------
!zone {
IDDinkeyDOS
lda #$0B
ldx #$2B
ldy #$0B
jsr compare ; if T00,S0B,$2B ==
!byte $29,$44,$49,$4E,$4B,$45,$59,$44,$4F,$53,$00
rts
}

View File

@ -187,7 +187,20 @@ IDBootloader
lda #TRUE
sta gIsProDOS
jsr IDVolumeName
bvc .useuniv ; always branches
bcs .useuniv
; [note: execution may fall through here]
;
; Dinkey-DOS (ProDOS file structure with DOS 3.3-ish RWTS in language card)
; detectable now because IDVolumeName just read the first sector of the
; volume directory into memory so we can look for a unique filename
;
jsr IDDinkeyDOS
bcs .useuniv
lda #s_dinkeydos
jsr PrintByID
lda #TRUE
sta gIsDinkeyDOS
beq .useuniv ; always branches
;
; Apple Pascal (all versions)
;

View File

@ -146,6 +146,7 @@ FirstMover
!source "id/laureate.a"
!source "id/micrograms.a"
!source "id/volumename.a"
!source "id/dinkeydos.a"
!source "print.a"
!source "compare.a"
!source "modify.a"
@ -320,7 +321,7 @@ ADStyle
UseUniversal
jsr IncProgress
jsr StartWithUniv
lda gIsProDOS
lda gIsDinkeyDOS
bne ReadWithRWTS
; On disks with a ProDOS bootloader, we patch the universal RWTS in memory
; so it can also read protected Origin disks like Ultima V and Times of Lore.

View File

@ -111,6 +111,7 @@ StringTable
!word .muse
!word .origin
!word .volumename
!word .dinkeydos
;
; Text can contain substitution strings, which
; are replaced by current values at runtime. Each
@ -136,7 +137,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2017-12-05",$00
!text "Passport by 4am 2017-12-06",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "
@ -425,4 +426,6 @@ StringTable
!text "address epilogue contains a timing bit.",$8D,$00
.volumename
!text "T%t,S%0 Volume name is ",$00
.dinkeydos
!text "T00,S0B Found Dinkey-DOS",$8D,$00
}

View File

@ -99,4 +99,5 @@ s_sra = $5D
s_muse = $5E
s_origin = $5F
s_volumename = $60
STRINGCOUNT = $61
s_dinkeydos = $61
STRINGCOUNT = $62