add support for patching diskvol check on PanglosDOS disks with non-standard volume number [fixes Diet Analysis Program]

This commit is contained in:
4am 2019-04-03 15:19:11 -04:00
parent 48e3a33d38
commit 646157a1f5
5 changed files with 30 additions and 7 deletions

View File

@ -97,7 +97,6 @@ AnalyzeT00
!source "../patchers/jmpbbfe.a"
!source "../patchers/datasoft.a"
!source "../patchers/nibtable.a"
!source "../patchers/diskvol.a"
!source "../patchers/milliken.a"
!source "../patchers/methods.a"
!source "../patchers/jsr8b3.a"
@ -117,6 +116,8 @@ AnalyzeT00
!source "../patchers/springboard.a"
;add only above this line
!source "../patchers/diskvol.a"
rts
!if * > $4000 {

View File

@ -1,7 +1,8 @@
;-------------------------------
; #DISKVOL
; non-standard disk volume prevents
; DOS from loading
; disk from loading its own files
; or even its own DOS
;-------------------------------
!zone {
bit gMode ; nothing to do here in verify-only mode
@ -25,6 +26,14 @@
lda gForceDiskVol
beq .yes
lda gIsPanglosDOS
bne +
lda gCapturedDiskVolumeNumber
bne +
lda gDiskVolumeNumber
cmp #$FE
bne .yes
+
ldx #$EB
ldy #$01
jsr compare ; and T00,S01,$EB !=
@ -43,15 +52,25 @@
!byte $A0,$03 ; LDY #$03
!byte $B1,$48 ; LDA ($48),Y
!byte $48 ; PHA
bcc .veryyes
ldx #$16 ; or T00,S08,$16 == the same thing
ldy #$05 ; (variation used by PanglosDOS)
jsr compare ; preserves A/X
!byte $A0,$03
!byte $B1,$48
!byte $48
bcs .exit
.veryyes
lda #s_diskvol
jsr PrintByID
jsr PrintByID ; preserves X
lda #$08
ldx #$12
inx
inx ; now $12 or $18 (depending on which compare matched)
ldy #$02
jsr modify ; then set T00,S08,$12 =
jsr modify ; then set T00,S08,$12/18 =
!byte $A9,$00 ; LDA #$00
.exit
}

View File

@ -8,6 +8,8 @@
bne .exit
lda gTriedUniv
beq .exit
lda gIsPanglosDOS
beq .yes
lda jCallRWTS+2; #$3D or #$BD
sec
sbc #$04 ; #$39 or #$B9
@ -16,6 +18,7 @@
jsr CompareMemory
!byte $99,$2C,$00; STA $002C,Y
bcs .exit
.yes
lda $2F ; disk volume number of last sector read
sta gDiskVolumeNumber
lda #TRUE

View File

@ -172,4 +172,4 @@ ClearScreen
bne .begin
.home
jmp HOME
}
}

View File

@ -155,7 +155,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2019-02-16",$00
!text "Passport by 4am 2019-04-03",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "