2017-01-08 03:35:35 +00:00
|
|
|
;-------------------------------
|
|
|
|
; modify subroutine
|
|
|
|
; in: A = starting address (high byte)
|
|
|
|
; X = starting address (low byte)
|
|
|
|
; Y = string length
|
|
|
|
; stack = string to set
|
|
|
|
; out $BASEPAGE buffer changed
|
|
|
|
; $gPatchCount++
|
|
|
|
; $modsrc zero page clobbered
|
|
|
|
; $moddest zero page clobbered
|
|
|
|
; stack set to return to
|
|
|
|
; code after string
|
|
|
|
; all registers clobbered
|
2017-12-26 23:28:56 +00:00
|
|
|
; oVerflow bit clear
|
|
|
|
; all other flags clobbered
|
2017-01-08 03:35:35 +00:00
|
|
|
;-------------------------------
|
2017-01-24 00:57:43 +00:00
|
|
|
!zone {
|
2017-01-08 03:35:35 +00:00
|
|
|
modify
|
|
|
|
sta gDisplayBytes
|
|
|
|
clc
|
|
|
|
adc #BASEPAGE
|
|
|
|
sta moddest+1
|
|
|
|
stx moddest
|
|
|
|
stx gDisplayBytes+1
|
|
|
|
pla
|
|
|
|
sta modsrc
|
|
|
|
pla
|
|
|
|
sta modsrc+1
|
|
|
|
tax
|
|
|
|
tya
|
|
|
|
clc
|
|
|
|
adc modsrc
|
2017-01-24 00:57:43 +00:00
|
|
|
bcc .noinc
|
2017-01-08 03:35:35 +00:00
|
|
|
inx
|
2017-01-24 00:57:43 +00:00
|
|
|
.noinc
|
2017-01-08 03:35:35 +00:00
|
|
|
sta tmp
|
|
|
|
txa
|
|
|
|
pha
|
|
|
|
lda tmp
|
|
|
|
pha
|
|
|
|
sty modtmp
|
|
|
|
bit gMode
|
2017-01-24 00:57:43 +00:00
|
|
|
bpl .exitnomod ; verify mode -> no modify
|
|
|
|
bvc .exitnomod ; demuffin mode -> no modify
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_modify
|
|
|
|
jsr PrintByID
|
|
|
|
ldy #0
|
2017-01-24 00:57:43 +00:00
|
|
|
.dest
|
2017-01-08 03:35:35 +00:00
|
|
|
lda (moddest),y
|
|
|
|
jsr PrintByte
|
|
|
|
iny
|
|
|
|
cpy modtmp
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .dest
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #s_modifyto
|
|
|
|
jsr PrintByID
|
|
|
|
ldy #0
|
2017-01-24 00:57:43 +00:00
|
|
|
.src
|
2017-01-08 03:35:35 +00:00
|
|
|
iny
|
|
|
|
lda (modsrc),y
|
|
|
|
jsr PrintByte
|
|
|
|
cpy modtmp
|
2017-01-24 00:57:43 +00:00
|
|
|
bne .src
|
2017-01-08 03:35:35 +00:00
|
|
|
lda #$8D
|
|
|
|
jsr PrintA
|
2017-11-09 05:47:12 +00:00
|
|
|
bvc +
|
2017-01-24 00:57:43 +00:00
|
|
|
.mod
|
2017-01-08 03:35:35 +00:00
|
|
|
sta (moddest),y
|
2017-11-09 05:47:12 +00:00
|
|
|
+ lda (modsrc),y
|
|
|
|
dey
|
|
|
|
bpl .mod
|
2017-01-24 00:57:43 +00:00
|
|
|
.exit
|
2017-01-08 03:35:35 +00:00
|
|
|
inc gPatchCount
|
2017-01-24 00:57:43 +00:00
|
|
|
.exitnomod
|
2017-12-26 23:28:56 +00:00
|
|
|
clv
|
2017-01-08 03:35:35 +00:00
|
|
|
rts
|
2017-01-24 00:57:43 +00:00
|
|
|
}
|