From: Christian Groessler Date: Thu, 20 Jun 2013 23:53:13 +0000 (+0200) Subject: Fix writing one byte beyond screen buffer. X-Git-Tag: V2.15~223^2~86 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=73c4566ca7ef4f5d441c234a543e1ec99e3a136b;p=cc65 Fix writing one byte beyond screen buffer. --- diff --git a/libsrc/atari/clrscr.s b/libsrc/atari/clrscr.s index 58fb63137..483cd047e 100644 --- a/libsrc/atari/clrscr.s +++ b/libsrc/atari/clrscr.s @@ -9,26 +9,26 @@ .importzp ptr1 .import setcursor +SCRSIZE = 960 ; 40x24: size of default atari screen + _clrscr:lda SAVMSC ; screen memory sta ptr1 lda SAVMSC+1 clc - adc #>(40*24) + adc #>(SCRSIZE-1) sta ptr1+1 lda #0 ; screen code of space char sta OLDCHR - ldy #<(40*24) ; 40x24: size of default atari screen - ldx #>(40*24) + ldy #<(SCRSIZE-1) + ldx #>(SCRSIZE-1) _clr1: sta (ptr1),y dey bne _clr1 sta (ptr1),y dex bmi done - ldy ptr1+1 + dec ptr1+1 dey - sty ptr1+1 - ldy #255 jmp _clr1 done: sta COLCRS