From 8740b3447c90a7ecc5160e997afa2811ff640987 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Tue, 16 Apr 2019 11:26:59 -0700 Subject: [PATCH] placeholder for write routine --- src/id/trace.a | 8 ++--- src/patchers/choplifter.a | 60 ++++++++++++++++++++++++---------- src/patchers/dos32muse.a | 4 +-- src/patchers/hallabs.a | 4 +-- src/patchers/rwtsswappenguin.a | 4 +-- 5 files changed, 52 insertions(+), 28 deletions(-) diff --git a/src/id/trace.a b/src/id/trace.a index 804ed4d..aac3506 100644 --- a/src/id/trace.a +++ b/src/id/trace.a @@ -20,15 +20,15 @@ Trace cpy #$4C beq + ldx #3 -+ ldy $B6FB + ldy $B6FB cpy #$4C - bne + - sta $B6FA,x ; hi byte of callback + bne ++ ++ sta $B6FA,x ; hi byte of callback pla sta $B6F9,x ; lo byte of callback jmp $B600 -+ pla +++ pla lda #s_canttrace ; unknown disk controller jsr PrintByID jmp UseUniversal diff --git a/src/patchers/choplifter.a b/src/patchers/choplifter.a index 6605671..433b874 100644 --- a/src/patchers/choplifter.a +++ b/src/patchers/choplifter.a @@ -11,6 +11,9 @@ Choplifter bit gMode ; nothing to do here in verify-only mode bpl .exit + +;;prepare write routine at $2000-21ff first + lda #$00 sta gCommand sta dct+1 @@ -27,12 +30,13 @@ Choplifter jsr ReadChoplifter lsr gTrack jsr WriteTrackNA - lda gTrack - clc - adc #$01 + ldx gTrack + inx + txa + pha jsr ChangeTrackNW jsr IncProgress - lda gTrack + pla cmp #$23 bne .read @@ -264,16 +268,22 @@ ReadChoplifter nop ; timing bits ldx #$00 - jsr .read4x4 - sta (BASEPAGE+8)<<8,x + sta (BASEPAGE+$0f)<<8,x inx jsr .read4x4 - sta (BASEPAGE+8)<<8,x + sta (BASEPAGE+$0f)<<8,x inx jsr .read4x4 - sta (BASEPAGE+8)<<8,x + sta (BASEPAGE+$0f)<<8,x inx cmp #$EA bne - + ldx #0 +.copywrite1 + lda $2000,x + sta (BASEPAGE+8)<<8,x + inx + bne .copywrite1 rts .readtrack22 @@ -284,7 +294,7 @@ ReadChoplifter dey bne + dex - beq ++ + beq .copywrite2 + lda KEY bmi .linkcancel3 jsr .readnib @@ -304,7 +314,13 @@ ReadChoplifter sta BASEPAGE<<8,x inx bne - -++ rts + +.copywrite2 + lda $2100,x + sta (BASEPAGE+7)<<8,x + inx + bne .copywrite2 + rts .read4x4 - lda $C0EC @@ -354,8 +370,18 @@ ReadChoplifter .stage2 !pseudopc $B000 { ; high address that won't be hit on the first round of SD lda $c057 + lda $c054 lda $c052 lda $c050 + ldx #$42 + txs + lda #>(.resume-1) + pha + lda #<(.resume-1) + pha + jmp $4000 + +.resume ldy #0 - lda .stager,y sta $500,y @@ -370,6 +396,7 @@ ReadChoplifter sty $807 ldy #$60 ; rts sty $84c + ldx $2b jsr .callSD ; including original $8xx to $7xx asl $807 ; 4xx, second table jmp $500 @@ -379,9 +406,11 @@ ReadChoplifter jsr .step lda #$60 sta $801 - lda #4 + lda #2 sta $27 - jsr $823 ; read patch table + jsr $823 ; read half of write routine to $200 (but starts at $207) + inc $27 + jsr $823 ; read patch table to $400 ldy #0 ; avoid CFFA bug - lda $400,y sta .patcher+1 @@ -400,13 +429,7 @@ ReadChoplifter sta $3d dec $27 jsr $823 ; read high scores - lsr $27 - lda #7 - sta $26 - jsr $823 ; read half of write routine to $207 - asl $27 - lda #0 - sta $26 + inc $27 jsr $823 ; read half of write routine to $600 ldy #0 ; avoid CFFA bug - lda ($26),y @@ -415,6 +438,7 @@ ReadChoplifter sta $300,y iny bne - + lda $C088,x jmp ($20) .callSD diff --git a/src/patchers/dos32muse.a b/src/patchers/dos32muse.a index c63051c..4833aaa 100644 --- a/src/patchers/dos32muse.a +++ b/src/patchers/dos32muse.a @@ -10,8 +10,8 @@ bpl .exit lda gIsDOS32 bne .exit - lda gTrack - cmp #$01 + ldx gTrack + dex bne .exit lda #$08 ldx #$D6 diff --git a/src/patchers/hallabs.a b/src/patchers/hallabs.a index b1a61af..4a6a9f2 100644 --- a/src/patchers/hallabs.a +++ b/src/patchers/hallabs.a @@ -11,8 +11,8 @@ bpl .exit lda gIsBoot0 bne .exit - lda gTrack - cmp #$01 + ldx gTrack + dex bne .exit ldy #(@search1end-@search1start) diff --git a/src/patchers/rwtsswappenguin.a b/src/patchers/rwtsswappenguin.a index 81d9d84..cdf4d76 100644 --- a/src/patchers/rwtsswappenguin.a +++ b/src/patchers/rwtsswappenguin.a @@ -12,8 +12,8 @@ !zone { bit gMode ; nothing to do here in verify-only mode bpl .exit - lda gTrack ; and track 1 - cmp #$01 + ldx gTrack ; and track 1 + dex bne .exit lda #$04 ldx #$52