support Panglos slave and T/S continuation

This commit is contained in:
Peter Ferrie 2018-06-08 19:13:00 -07:00
parent e1db615ad0
commit d5aef5c77c
2 changed files with 53 additions and 20 deletions

View File

@ -13,28 +13,34 @@ PanglosDOS
lda jCallRWTS+2 lda jCallRWTS+2
ldx #$00 ; check for "STY $48;STA $49" ldx #$00 ; check for "STY $48;STA $49"
ldy #$04 ; at RWTS entry point ldy #$04 ; at RWTS entry point
pha
jsr CompareMemory jsr CompareMemory
!byte $84,$48,$85,$49 !byte $84,$48,$85,$49
bcs .jmpexit pla
lda #$38 ; check for "SEC;RTS" at $38C3 bcs .jmpexit1
ldx #$C3 sec
sbc #5
ldx #$C3 ; check for "SEC;RTS" at $x8C3
ldy #$02 ldy #$02
pha
jsr CompareMemory jsr CompareMemory
!byte $38,$60 !byte $38,$60
bcs .jmpexit pla
lda #$38 ; check for "LDA $C08C,X" at $3862 bcs .jmpexit1
ldx #$62 ldx #$62 ; check for "LDA $C08C,X" at $x862
ldy #$03 ldy #$03
pha
jsr CompareMemory jsr CompareMemory
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
bcs .jmpexit pla
lda #$3D ; check for "JSR $3BF9" at $3DB9 bcs .jmpexit1
ldx #$B9 lda jCallRWTS+2
ldx #$B9 ; check for "JSR $xxF9" at $xDB9
ldy #$03 ldy #$03
jsr CompareMemory jsr CompareMemory
!byte $20,$F9,$3B !byte $20,$F9
bcc + bcc +
.jmpexit .jmpexit1
jmp .exit jmp .exit
+ lda #s_gathering + lda #s_gathering
@ -44,6 +50,18 @@ PanglosDOS
;$230 (560) bytes for data keys ;$230 (560) bytes for data keys
;=$460 bytes total ;=$460 bytes total
lda jCallRWTS+2
sta .patch5+2
sta .patch6+2
sta .patch7+2
sec
sbc #5
sta .patch1+2
sta .patch2+2
sta .patch3+2
sta .patch4+2
sta .patch8+2
sta .patch9+2
ldy #0 ldy #0
tya tya
- sta $900,y - sta $900,y
@ -59,10 +77,14 @@ PanglosDOS
sta $E00,y sta $E00,y
dey dey
bpl - bpl -
.patch1
sta $3881 sta $3881
.patch2
sta $38EF sta $38EF
lda #$A9 lda #$A9
.patch3
sta $3880 sta $3880
.patch4
sta $38EE sta $38EE
lda #$0F lda #$0F
sta .sector+1 sta .sector+1
@ -73,7 +95,7 @@ PanglosDOS
lda #BASEPAGE lda #BASEPAGE
sta gAddress+1 sta gAddress+1
jsr ReadSector jsr ReadSector
bcs .jmpexit bcs .jmpexit1
inc gAddress+1 inc gAddress+1
lda #$0B ;entry offset lda #$0B ;entry offset
.parsedir .parsedir
@ -82,17 +104,18 @@ PanglosDOS
lda BASEPAGE<<8,Y lda BASEPAGE<<8,Y
beq .setpanglos beq .setpanglos
cmp #$FF ;skip deleted files cmp #$FF ;skip deleted files
beq + beq .nextent
ldx (BASEPAGE<<8)+1,Y
.reparse
sta gTrack sta gTrack
lda (BASEPAGE<<8)+1,Y stx gSector
sta gSector
jsr ReadSector jsr ReadSector
bcs .jmpexit bcs .jmpexit2
ldx #0 ldx #0
ldy #0 ldy #0
.parsets .parsets
lda ((BASEPAGE+1)<<8)+$0C,X lda ((BASEPAGE+1)<<8)+$0C,X
beq + beq .chkextend
asl asl
asl asl
asl asl
@ -115,7 +138,12 @@ PanglosDOS
inx inx
inx inx
bne .parsets bne .parsets
+ lda .diroff+1 .chkextend
ldx ((BASEPAGE+1)<<8)+2
lda ((BASEPAGE+1)<<8)+1
bne .reparse
.nextent
lda .diroff+1
clc clc
adc #$23 adc #$23
bne .parsedir bne .parsedir
@ -124,15 +152,19 @@ PanglosDOS
.setpanglos .setpanglos
lda #$20 lda #$20
.patch5
sta $3DBE sta $3DBE
lda #<.callback lda #<.callback
.patch6
sta $3DBF sta $3DBF
lda #>.callback lda #>.callback
.patch7
sta $3DC0 sta $3DC0
lda #TRUE lda #TRUE
sta gIsPanglosDOS sta gIsPanglosDOS
clc clc
.jmpexit2
jmp .exit jmp .exit
.callback .callback
@ -152,13 +184,14 @@ PanglosDOS
adc #9 adc #9
sta modsrc+1 sta modsrc+1
lda (modsrc),Y lda (modsrc),Y
.patch8
sta $38EF ;address sum sta $38EF ;address sum
lda modsrc+1 lda modsrc+1
adc #3 adc #3
sta modsrc+1 sta modsrc+1
lda (modsrc),Y lda (modsrc),Y
.patch9
sta $3881 ;data sum sta $3881 ;data sum
rts
.exit .exit
rts rts

View File

@ -143,7 +143,7 @@ StringTable
; can be set directly before calling PrintByID. ; can be set directly before calling PrintByID.
; ;
.header .header
!text "Passport by 4am 2018-06-07",$00 !text "Passport by 4am 2018-06-08",$00
.mainmenu .mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " " !text " "