p** peek+poke+wait 24-BIT PATCH FOR THE sUPERcpu* aLSO PATCHES LOAD/SAVE** vERS. 2: cHANGE ONLY lda (),y -> lda [], USE $50 $51 $52*   AS 24-BIT ADDRESS. (BUT ALSO $14 $15 AS BEFORE).  tHIS*   SHOULD MAXIMIZE COMPATIBILITY.**   nOTE THAT sys PATCH IS TRIVIAL.** sTEPHEN l. jUDD 12/6/97** 1/3/98 aDDED sys AND load PATCHES.** 12/14/99 -- aDDED TO jAMMON*linnum = $14 ;vARIABLEnum24 = $50 ;nEW 24-BIT DEST.chrget = $73txtptr = $7ahighptr = $ab ;hIGH BYTE OF END SAVE ADDR.*===============================getbyte = $b79bgetnum = $b7ebgetchk = getnum+6getadr = $b7f7peek = $b80dpoke = $b824wait = $b82d*===============================* getadr PATCH -> getadr+7p1adr = getadr+7patch1 = $99 ;cmp #$91 -> cmp #$99* getadr PATCH -> getadr+$0dp2adr = getadr+$0dpatch2 = $4c ;jmp linfetch* peek PATCH -> peek+9p3adr = peek+11patch3a = $a7 ;lda [$50]patch3b = num24* poke PATCH -> poke+4p4adr = poke+6patch4a = $87 ;sta [$50]patch4b = patch3b* wait PATCH -> wait+17p5adr = wait+19patch5a = patch3a ;lda [$50]patch5b = patch3b*===============================init* pATCH basic* iNIT ieval VECTOR lda $f7e5 cmp #$91 ;cHECK FOR ppp bne :skip lda $030a ;oLD ieval sta $0334 lda $030b sta $0335:skip >>> PER,hexeval pla sta $030a pla sta $030b* sET UP BANK 1 PATCHES clc dfb $fb ;XCE dfb $e2,$30 ;SEP #$30 lda #$01 pha dfb $ab ;plb -- STORE TO BANK 1* pATCH basic lda #patch1 ;getadr sta p1adr lda #patch2 sta p2adr >>> PER,linfetch pla* lda #<linfetch sta p2adr+1 pla* lda #>linfetch sta p2adr+2 lda #patch3a ;peek+wait sta p3adr sta p5adr lda #patch3b sta p3adr+1 sta p5adr+1 sta p4adr+1 ;poke lda #patch4a sta p4adr* pATCH sys lda #$dc ;jmp [] sta $e144 lda #num24 sta $e145* gET FILENAME+ADDRESS PATCH >>> PER,getit pla* lda #<getit sta $e1f7 pla* lda #>getit sta $e1f8* pATCH save ROUTINEspatch >>> PER,save pla* lda #<save sta $e157* lda #>save pla sta $e158 >>> PER,sb0* lda #<sb0 pla sta $f606* lda #>sb0 pla sta $f607 lda #$04 sta $f5f5 ;cmp #$04 lda #$90 ;bcc ... sta $f5f6 lda #$a6 ;ldx $b9 sta $f5f8 lda #$b9 sta $f5f9 lda #$ae ;START ADDRESS IN $ae/f sta $f61b lda #$af sta $f620 lda #$ea ;nop OUT $c1->$ac COPY sta $f617 sta $f618 sta $f619 >>> PER,cmpsave* lda #<cmpsave pla sta $f625* lda #>cmpsave pla sta $f626 >>> PER,incsave* lda #<incsave pla sta $f63b* lda #>incsave pla sta $f63c lda #$a7 ;lda [$ae] sta $f629 lda #$ae sta $f62a* pATCH load ROUTINElpatch >>> PER,load* lda #<load pla sta $e16d pla* lda #>load sta $e16e >>> PER,saveaddr pla sta $f4f1 sta $f39f pla sta $f4f2 sta $f3a0 lda #$c7 sta $f512 ;cmp [$ae] lda #$87 sta $f51c ;sta [$ae] sta $f7e5 sta $f7f0 lda #$20 sta $f51e ;jsr incsave sta $f7e7 >>> PER,incsave pla* lda #<incsave sta $f51f sta $f7e8 pla* lda #>incsave sta $f520 sta $f7e9 lda #$ea ;nop nop nop sta $f521 sta $f522 sta $f523 sta $f7ea sta $f7eb sta $f7ec lda #$b0 sta $f75b ;lda $00b0,y lda #$b3 sta $f765 ;SPRITES -> $b3 sta $f7ff inc $f805 ;pla/sta ETC. inc $f808 inc $f80b sec dfb $fb ;XCE lda #$00 pha dfb $ab ;plb -- STORE TO BANK 0* fURTHER load PATCH ldx #f4c1-f4a7-1:loop lda f4a7,x hex 9fa7f401 ;sta $01f4a7,x dex bpl :loop rtsf4a7 hex 6490 ;stz $90 lda $ba cmp #$04 bcs :cont jmp $f713:cont ldy $b7 bne :c2 jmp $f2cc:c2 ldx $b9 bpl :c3 ;rEALLY JUST WANT $ff inx hex 2c:c3 hex 64b0 ;stz $b0f4c1* pATCH eval TO READ IN HEX VALUEShexeval jsr chrget cmp #'$' bne nope lda #$c0 sta $0e ;128+64 = 24-BIT INTEGER lda #00 sta $61 ;fac1=0 sta $0d ;valtyp = NUMERICloop jsr chrget beq linrts bcc :number sbc #8 ;a-f WILL BE 10-15:number sbc #47 cmp #16 bcc ok ;cAN USE E.G. $D0+5 NOW cmp #46-55 ;cHECK FOR DECIMAL PT. bne linrtserror ldx #14 ;iLLEGAL QUANTITY jmp ($0300)ok pha >>> PER,sixteen pla tax pla tay txa* lda #<sixteen* ldy #>sixteen jsr $ba28 ;mULTIPLY fac1 BY 16 pla jsr $bd7e ;aDD TO fac1 jmp loopnope ldx txtptr ;bACK UP txtptr bne :skip dec txtptr+1:skip dec txtptr jmp ($0334) ;nORMAL ROUTINEsixteen flo 16 ;16 IN 5-BYTE FP ($85 00 00 00 00) txt 'JUDD'** cOPY BYTES OF fac1 INTO linnum AND num24** oN EXIT, .y .a = linnum+1, linnum*linfetch lda $63 ;HIGH sta num24+2 lda $64 ;MED ldy $65 ;LOW sty linnum sty num24 sta linnum+1 sta num24+1linrts rts** pATCH load+save COMMAND TO READ ADDRESS IF PRESENT.*save jsr getparms ;gET 1ST TWO PARMS bne linrts ;eXIT jsr setnum ;$ac IS NOW START ADDRESS jsr getit jsr chek24 bne error ;REQUIRE ANOTHER ADDRESS ldy num24+1 ;END ADDRESS lda num24+2 sta highptr pla pla lda #$ac ;START ADDRESS jmp $e156+9load jsr getparms bne linrts jsr setnum pla ;OLD RETURN ADDRESS pla lda $0a jmp $e16c+9 ;iNTO THE LOAD ROUTINEgetit jsr $e20e ;cHECK FOR COMMA jsr $ad8a ;GET NUMBER jsr $b7f7 ;CONVERT TO INT ldx num24 ;LOW BYTE IN .x rtsgetparms jsr $e1d4 ;gET 1ST TWO PARMSchek24 ldy #$ff lda $0e ;cHECK FOR 24-BIT HEX VALUE cmp #$c0 bne :rts sty $b9 ;sa -- 24-BIT FLAG:rts rtssetnum ldx num24 stx $ac ;save START ADDRESSES ldy num24+1 sty $ad lda num24+2 sta $b0 ;aLWAYS HIGH ADDRESS rts** save COMPARE AND INCREMENT ROUTINES*cmpsave sec lda $ae sbc $ac lda $af sbc $ad lda $b0 sbc highptr rtsincsave inc $ae bne :rts inc $af bne :rts inc $b0:rts rts** pATCH save VARIABLES*sb0 inx ;.x CONTAINS sa beq :skip ;oNE BYTE SHORT OF A FIT INTO dfb $64,$b0 ;save ITSELF. dfb $64,highptr ;stz:skip lda $c1 ;START ADDRESS -> $ae ldx $ae ;END ADDRESS -> $ac sta $ae stx $ac lda $c2 ldx $af sta $af stx $ad jmp $f3d5 ;CONTINUE AS NORMAL** sAVE LOAD ADDRESS*saveaddr lda $ae sta $c3 lda $af sta $c4 jmp $f5d2