refactor rwtslog and add RDOS support

This commit is contained in:
4am 2017-09-07 09:52:27 -04:00
parent bdda0f89ea
commit 4278a70f23
5 changed files with 84 additions and 31 deletions

View File

@ -221,6 +221,7 @@ IDBootloader
bcs + bcs +
lda #s_micrograms lda #s_micrograms
jsr PrintByID jsr PrintByID
bcc .useuniv ; always branches
; ;
; Quick-DOS ; Quick-DOS
; ;
@ -228,6 +229,14 @@ IDBootloader
bcs + bcs +
lda #s_quickdos lda #s_quickdos
jsr PrintByID jsr PrintByID
bcc .useuniv ; always branches
;
; RDOS
;
+ jsr IDRDOS
bcs +
lda #s_rdos
jsr PrintByID
+ +
.useuniv .useuniv

26
src/id/rdos.a Normal file
View File

@ -0,0 +1,26 @@
;-------------------------------
; IDRDOS
; identify RDOS 16-sector bootloader
;
; in: $0800..$08FF contains T00,S00
; first page of track buffer also contains T00,S00
; out: C clear if RDOS 16-sector bootloader found
; C set otherwise
; all registers clobbered
; all other flags clobbered
;-------------------------------
!zone {
IDRDOS
lda #$00
ldx #$00
ldy #$0E
jsr compare ; if T00,S00,$00 ==
!byte $01
!byte $A9,$60 ; LDA #$60
!byte $8D,$01,$08; STA $0801
!byte $A2,$00 ; LDX #$00
!byte $A0,$1F ; LDY #$1F
!byte $B9,$00,$08; LDA $0800,Y
!byte $49 ; EOR
rts
}

View File

@ -155,6 +155,7 @@ FirstMover
!source "id/dos33.a" !source "id/dos33.a"
!source "id/prodos.a" !source "id/prodos.a"
!source "id/pascal.a" !source "id/pascal.a"
!source "id/rdos.a"
!source "id/jsr8b3.a" !source "id/jsr8b3.a"
!source "id/mecc.a" !source "id/mecc.a"
!source "id/datasoft.a" !source "id/datasoft.a"

View File

@ -11,36 +11,45 @@
; disk allows either $D4 or $D5 for the ; disk allows either $D4 or $D5 for the
; first address prologue nibble ; first address prologue nibble
;------------------------------- ;-------------------------------
lda gIsRWTS ; if DOS 3.3 RWTS ; DOS 3.3 variant
bne +
lda #$03 lda #$03
sta gDisplayBytes sta gDisplayBytes
ldx #$4F ldx #$4F
ldy #$0A ldy #$0A
jsr compare ; and T00,S03,$4F == jsr compare ; if T00,S03,$4F ==
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
!byte $10,$FB !byte $10,$FB
!byte $4A !byte $4A
!byte WILDCARD,$6A !byte WILDCARD,$6A
!byte $D0,$EF !byte $D0,$EF
bcs + bcc .yeslsr
; RDOS variant
ldx #$4D
ldy #$0A
jsr compare ; or T00,S03,$4D ==
!byte $BD,$8C,$C0
!byte $10,$FB
!byte $4A
!byte WILDCARD,$6A
!byte $D0,$EF
bcs .endlsr
.yeslsr
lda #s_lsr6a lda #s_lsr6a
jsr PrintByID jsr PrintByID
inc gPatchCount inc gPatchCount
+ .endlsr
;------------------------------- ;-------------------------------
; RWTS "CMP #$08 / BCS" identification ; RWTS "CMP #$08 / BCS" identification
; disk allows either $DE or a timing bit ; disk allows either $DE or a timing bit
; for the first address epilogue nibble ; for the first address epilogue nibble
;------------------------------- ;-------------------------------
lda gIsRWTS ; if DOS 3.3 RWTS ; DOS 3.3 variant
bne +
lda #$03 lda #$03
sta gDisplayBytes sta gDisplayBytes
ldx #$8B ldx #$8B
ldy #$15 ldy #$15
jsr compare ; and T00,S03,$8B == jsr compare ; if T00,S03,$8B ==
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
!byte $10,$FB !byte $10,$FB
!byte $C9,$DE !byte $C9,$DE
@ -53,53 +62,57 @@
!byte $EA !byte $EA
!byte $18 !byte $18
!byte $60 !byte $60
bcs + bcc .yesbcs
; RDOS variant
ldx #$89
ldy #$11
jsr compare ; or T00,S03,$89 ==
!byte $BD,$8C,$C0
!byte $10,$FB
!byte $C9,$DE
!byte $F0,$09
!byte $48
!byte $68
!byte $BD,$8C,$C0
!byte $C9,$80
!byte $B0
bcs .endbcs
.yesbcs
lda #s_bcs08 lda #s_bcs08
jsr PrintByID jsr PrintByID
inc gPatchCount inc gPatchCount
+ .endbcs
;------------------------------- ;-------------------------------
; RWTS "CMP / BNE 0" identification ; RWTS "CMP / BNE 0" identification
; disk allows any value for ; disk allows any value for
; for the first address epilogue nibble ; for the first address epilogue nibble
;------------------------------- ;-------------------------------
lda gIsRWTS ; if DOS 3.3 RWTS ; DOS 3.3 variant
bne +
lda #$03 lda #$03
sta gDisplayBytes sta gDisplayBytes
ldx #$8B ldx #$8B
ldy #$09 ldy #$09
jsr compare ; and T00,S03,$8B == jsr compare ; if T00,S03,$8B ==
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
!byte $10,$FB !byte $10,$FB
!byte $C9,WILDCARD !byte $C9,WILDCARD
!byte $D0,$00 !byte $D0,$00
bcs + bcc .yesbne0
lda #s_cmpbne0 ; David-DOS variant
jsr PrintByID
inc gPatchCount
+
;-------------------------------
; RWTS "CMP / BNE 0" identification (David-DOS variant)
; disk allows any value for
; for the first address epilogue nibble
;-------------------------------
lda gIsDavidDOS ; if David-DOS bootloader
bne +
lda #$05 lda #$05
sta gDisplayBytes sta gDisplayBytes
ldx #$8B ldx #$8B
ldy #$09 ldy #$09
jsr compare ; and T00,S05,$8B == jsr compare ; or T00,S05,$8B ==
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
!byte $10,$FB !byte $10,$FB
!byte $C9,WILDCARD !byte $C9,WILDCARD
!byte $D0,$00 !byte $D0,$00
bcs + bcs .endbne0
.yesbne0
lda #s_cmpbne0 lda #s_cmpbne0
jsr PrintByID jsr PrintByID
inc gPatchCount inc gPatchCount
+ .endbne0
} }

View File

@ -107,7 +107,8 @@ s_advint = $58
s_dos32b0 = $59 s_dos32b0 = $59
s_bootwrite = $5A s_bootwrite = $5A
s_rwtswrite = $5B s_rwtswrite = $5B
STRINGCOUNT = $5C s_rdos = $5C
STRINGCOUNT = $5D
!zone { !zone {
StringTable StringTable
@ -203,6 +204,7 @@ StringTable
!word .dos32boot0 !word .dos32boot0
!word .bootwrite !word .bootwrite
!word .rwtswrite !word .rwtswrite
!word .rdos
; ;
; Text can contain substitution strings, which ; Text can contain substitution strings, which
; are replaced by current values at runtime. Each ; are replaced by current values at runtime. Each
@ -228,7 +230,7 @@ StringTable
; can be set directly before calling PrintByID. ; can be set directly before calling PrintByID.
; ;
.header .header
!text "Passport by 4am 2017-09-05",$00 !text "Passport by 4am 2017-09-07",$00
.mainmenu .mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " " !text " "
@ -506,4 +508,6 @@ StringTable
!text "bootloader",$8D,$00 !text "bootloader",$8D,$00
.rwtswrite .rwtswrite
!text "T00,S02 Writing built-in RWTS",$8D,$00 !text "T00,S02 Writing built-in RWTS",$8D,$00
.rdos
!text "T00,S00 Found RDOS bootloader",$8D,$00
} }