]> git.sur5r.net Git - cc65/blobdiff - libsrc/pet/clrscr.s
Minor style fix.
[cc65] / libsrc / pet / clrscr.s
index 2cabcc0841f4baff216af36944d5e7e540fd30e5..fe50374574b5877a5d7dd136285c8fc9131c0a83 100644 (file)
@@ -4,47 +4,46 @@
 ; void clrscr (void);
 ;
 
-       .export         _clrscr
-       .import         plot
-               .importzp       ptr1
-       .import         xsize
+        .export         _clrscr
+        .import         plot
+        .importzp       ptr1
 
-       .include        "pet.inc"
+        .include        "pet.inc"
 
 _clrscr:
 
 ; Set the screen base address
 
-       lda     #$00
-       sta     ptr1
-       lda     #$80
-       sta     ptr1+1
+        lda     #$00
+        sta     ptr1
+        lda     #$80
+        sta     ptr1+1
 
 ; Determine, how many pages to fill
 
-       ldx     #4
-       lda     xsize
-       cmp     #40
-               beq     L1
-       ldx     #8
+        ldx     #4
+        lda     SCR_LINELEN     ; Check length of one line
+        cmp     #40+1
+        bcc     L1
+        ldx     #8
 
 ; Clear the screen
 
-L1:            lda     #$20            ; Screen code for blank
-       ldy     #$00
-L2:    sta     (ptr1),y
-       iny
-       bne     L2
-       inc     ptr1+1
-       dex
-       bne     L2
+L1:     lda     #$20            ; Screen code for blank
+        ldy     #$00
+L2:     sta     (ptr1),y
+        iny
+        bne     L2
+        inc     ptr1+1
+        dex
+        bne     L2
 
 ; Set the cursor to 0/0
 
-       lda     #0
-       sta     CURS_X
-       sta     CURS_Y
-       jmp     plot
+        lda     #0
+        sta     CURS_X
+        sta     CURS_Y
+        jmp     plot
 
-       rts
+        rts