]> git.sur5r.net Git - cc65/commitdiff
pattern number is preserved so cclear and clrscr will not mess with drawing
authorizydorst <izydorst@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 17 Apr 2003 11:51:43 +0000 (11:51 +0000)
committerizydorst <izydorst@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 17 Apr 2003 11:51:43 +0000 (11:51 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@2065 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/geos/conio/cclear.s
libsrc/geos/conio/clrscr.s

index 216f120ffebc077f26fd984eb8e0be8d69d5b7f7..a40404eb7bfd6682601fb770d231edf9e7bfe288 100644 (file)
@@ -40,8 +40,12 @@ _cclear:
        ldx     #r4
        ldy     #3
        jsr     DShiftLeft
-       lda     #0              ; pattern
+       lda     curPattern      ; store current pattern
+       pha
+       lda     #0              ; set pattern to clear
        jsr     SetPattern
        jsr     Rectangle
+       pla
+       jsr     SetPattern      ; restore pattern
        jsr     fixcursor
 L9:    rts
index ed8b6b0804437b81dde4f8e30a12ec46dd4495f1..b1bdc17ad9b98c3a50a798b352da9edd272ea20d 100644 (file)
@@ -18,7 +18,9 @@
 _clrscr:
            lda #ST_WR_FORE | ST_WR_BACK
            sta dispBufferOn
-           lda #0
+           lda curPattern              ; save current pattern
+           pha
+           lda #0                      ; set pattern to clear
            jsr SetPattern
            ldx #0
            stx r3L
@@ -39,4 +41,6 @@ L40:      lda #>319                   ; 40 columns
            ldx #<319
 L99:       sta r4H
            stx r4L
-           jmp Rectangle
+           jsr Rectangle
+           pla
+           jmp SetPattern              ; restore pattern