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

View File

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