mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Fix writing one byte beyond screen buffer.
This commit is contained in:
parent
f16516047a
commit
73c4566ca7
@ -9,26 +9,26 @@
|
|||||||
.importzp ptr1
|
.importzp ptr1
|
||||||
.import setcursor
|
.import setcursor
|
||||||
|
|
||||||
|
SCRSIZE = 960 ; 40x24: size of default atari screen
|
||||||
|
|
||||||
_clrscr:lda SAVMSC ; screen memory
|
_clrscr:lda SAVMSC ; screen memory
|
||||||
sta ptr1
|
sta ptr1
|
||||||
lda SAVMSC+1
|
lda SAVMSC+1
|
||||||
clc
|
clc
|
||||||
adc #>(40*24)
|
adc #>(SCRSIZE-1)
|
||||||
sta ptr1+1
|
sta ptr1+1
|
||||||
lda #0 ; screen code of space char
|
lda #0 ; screen code of space char
|
||||||
sta OLDCHR
|
sta OLDCHR
|
||||||
ldy #<(40*24) ; 40x24: size of default atari screen
|
ldy #<(SCRSIZE-1)
|
||||||
ldx #>(40*24)
|
ldx #>(SCRSIZE-1)
|
||||||
_clr1: sta (ptr1),y
|
_clr1: sta (ptr1),y
|
||||||
dey
|
dey
|
||||||
bne _clr1
|
bne _clr1
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
dex
|
dex
|
||||||
bmi done
|
bmi done
|
||||||
ldy ptr1+1
|
dec ptr1+1
|
||||||
dey
|
dey
|
||||||
sty ptr1+1
|
|
||||||
ldy #255
|
|
||||||
jmp _clr1
|
jmp _clr1
|
||||||
|
|
||||||
done: sta COLCRS
|
done: sta COLCRS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user