]> git.sur5r.net Git - cc65/commitdiff
removed duplicate copy of charset and shift it at init time, saves 1k
authormrdudz <mrdudz@users.noreply.github.com>
Sun, 27 Sep 2015 17:34:43 +0000 (19:34 +0200)
committermrdudz <mrdudz@users.noreply.github.com>
Sun, 27 Sep 2015 17:34:43 +0000 (19:34 +0200)
libsrc/c64/soft80_charset.s
libsrc/c64/soft80_chline.s
libsrc/c64/soft80_conio.s
libsrc/c64/soft80_cvline.s

index 5a180e233137ed059ada8afa42b4a637afd6d708..999d199f00194b6079647249dfdf9cdd4699f0e7 100644 (file)
@@ -1,6 +1,4 @@
-; FIXME: generate charset at runtime
 
-soft80_lo_charset0:
 .byte $0f,$03,$0f,$00,$0f,$07,$05,$0e
 .byte $0f,$05,$0e,$0b,$0f,$0b,$0f,$0f
 .byte $0f,$0b,$0f,$0b,$07,$07,$0e,$00
@@ -18,7 +16,6 @@ soft80_lo_charset0:
 .byte $03,$0b,$03,$0b,$01,$05,$05,$05
 .byte $05,$05,$01,$0b,$07,$0b,$0f,$0a
 
-soft80_lo_charset1:
 .byte $0f,$03,$0f,$0f,$0f,$07,$05,$0e
 .byte $0f,$0a,$0e,$0b,$0f,$0b,$0f,$0f
 .byte $0f,$0b,$0f,$0b,$07,$07,$0e,$00
@@ -36,7 +33,6 @@ soft80_lo_charset1:
 .byte $05,$05,$05,$05,$0b,$05,$05,$05
 .byte $05,$05,$0d,$0b,$07,$0b,$0f,$0a
 
-soft80_lo_charset2:
 .byte $0f,$03,$0f,$0f,$0f,$07,$0a,$0e
 .byte $0f,$05,$0e,$0b,$0f,$0b,$0f,$0f
 .byte $0f,$0b,$0f,$0b,$07,$07,$0e,$0f
@@ -54,7 +50,6 @@ soft80_lo_charset2:
 .byte $05,$05,$05,$07,$0b,$05,$05,$05
 .byte $0b,$05,$0b,$0b,$0b,$0b,$0a,$05
 
-soft80_lo_charset3:
 .byte $09,$03,$0f,$0f,$0f,$07,$0a,$0e
 .byte $0f,$0a,$0e,$08,$0f,$08,$03,$0f
 .byte $08,$00,$00,$03,$07,$07,$0e,$0f
@@ -72,7 +67,6 @@ soft80_lo_charset3:
 .byte $03,$05,$03,$0b,$0b,$05,$05,$01
 .byte $0b,$0b,$0b,$00,$0b,$0b,$05,$05
 
-soft80_lo_charset4:
 .byte $09,$03,$00,$0f,$0f,$07,$05,$0e
 .byte $05,$05,$0e,$08,$0c,$08,$03,$0f
 .byte $08,$00,$00,$03,$07,$07,$0e,$0f
@@ -90,7 +84,6 @@ soft80_lo_charset4:
 .byte $07,$05,$03,$0d,$0b,$05,$05,$01
 .byte $0b,$0b,$0b,$00,$07,$0b,$05,$0a
 
-soft80_lo_charset5:
 .byte $0f,$03,$00,$0f,$0f,$07,$05,$0e
 .byte $05,$0a,$0e,$0b,$0c,$0f,$0b,$0f
 .byte $0b,$0f,$0b,$0b,$07,$07,$0e,$0f
@@ -108,7 +101,6 @@ soft80_lo_charset5:
 .byte $07,$0b,$05,$05,$0b,$05,$0b,$05
 .byte $05,$0b,$07,$0b,$07,$0b,$05,$0a
 
-soft80_lo_charset6:
 .byte $0f,$03,$00,$0f,$0f,$07,$0a,$0e
 .byte $0a,$05,$0e,$0b,$0c,$0f,$0b,$00
 .byte $0b,$0f,$0b,$0b,$07,$07,$0e,$0f
@@ -126,7 +118,6 @@ soft80_lo_charset6:
 .byte $07,$0d,$05,$0b,$0b,$0b,$0b,$05
 .byte $05,$0b,$01,$0b,$0b,$0b,$05,$05
 
-soft80_lo_charset7:
 .byte $0f,$03,$00,$0f,$00,$07,$0a,$0e
 .byte $0a,$0a,$0e,$0b,$0c,$0f,$0b,$00
 .byte $0b,$0f,$0b,$0b,$07,$07,$0e,$0f
@@ -144,147 +135,3 @@ soft80_lo_charset7:
 .byte $0f,$0f,$0f,$0f,$0f,$0f,$0f,$0f
 .byte $0f,$0f,$0f,$0b,$0b,$0b,$0f,$05
 
-soft80_hi_charset0:
-.byte $f0,$30,$f0,$00,$f0,$70,$50,$e0
-.byte $f0,$50,$e0,$b0,$f0,$b0,$f0,$f0
-.byte $f0,$b0,$f0,$b0,$70,$70,$e0,$00
-.byte $00,$f0,$e0,$f0,$c0,$b0,$30,$30
-.byte $f0,$b0,$50,$50,$b0,$50,$b0,$b0
-.byte $d0,$70,$f0,$f0,$f0,$f0,$f0,$d0
-.byte $b0,$b0,$b0,$b0,$50,$10,$b0,$10
-.byte $b0,$b0,$f0,$f0,$d0,$f0,$70,$b0
-.byte $b0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$90,$70,$30,$b0,$f0
-.byte $f0,$b0,$30,$b0,$30,$10,$10,$b0
-.byte $50,$10,$90,$50,$70,$50,$50,$b0
-.byte $30,$b0,$30,$b0,$10,$50,$50,$50
-.byte $50,$50,$10,$b0,$70,$b0,$f0,$a0
-
-soft80_hi_charset1:
-.byte $f0,$30,$f0,$f0,$f0,$70,$50,$e0
-.byte $f0,$a0,$e0,$b0,$f0,$b0,$f0,$f0
-.byte $f0,$b0,$f0,$b0,$70,$70,$e0,$00
-.byte $00,$f0,$e0,$f0,$c0,$b0,$30,$30
-.byte $f0,$b0,$50,$50,$90,$50,$50,$b0
-.byte $b0,$b0,$50,$b0,$f0,$f0,$f0,$d0
-.byte $50,$b0,$50,$50,$50,$70,$50,$50
-.byte $50,$50,$f0,$f0,$b0,$f0,$b0,$50
-.byte $50,$f0,$70,$f0,$d0,$f0,$90,$f0
-.byte $70,$b0,$d0,$70,$30,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$b0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$b0,$70,$b0,$b0,$b0
-.byte $f0,$b0,$50,$50,$50,$70,$70,$50
-.byte $50,$b0,$d0,$50,$70,$10,$10,$50
-.byte $50,$50,$50,$50,$b0,$50,$50,$50
-.byte $50,$50,$d0,$b0,$70,$b0,$f0,$a0
-
-soft80_hi_charset2:
-.byte $f0,$30,$f0,$f0,$f0,$70,$a0,$e0
-.byte $f0,$50,$e0,$b0,$f0,$b0,$f0,$f0
-.byte $f0,$b0,$f0,$b0,$70,$70,$e0,$f0
-.byte $00,$f0,$d0,$f0,$c0,$b0,$30,$30
-.byte $f0,$b0,$50,$00,$70,$d0,$b0,$70
-.byte $b0,$b0,$b0,$b0,$f0,$f0,$f0,$b0
-.byte $10,$30,$d0,$d0,$50,$30,$70,$d0
-.byte $50,$50,$b0,$b0,$b0,$80,$b0,$d0
-.byte $10,$b0,$70,$90,$d0,$b0,$b0,$90
-.byte $70,$f0,$f0,$70,$b0,$50,$30,$b0
-.byte $30,$90,$30,$90,$10,$50,$50,$50
-.byte $50,$50,$10,$b0,$b0,$b0,$50,$b0
-.byte $f0,$50,$50,$70,$50,$70,$70,$70
-.byte $50,$b0,$d0,$30,$70,$10,$10,$50
-.byte $50,$50,$50,$70,$b0,$50,$50,$50
-.byte $b0,$50,$b0,$b0,$b0,$b0,$a0,$50
-
-soft80_hi_charset3:
-.byte $90,$30,$f0,$f0,$f0,$70,$a0,$e0
-.byte $f0,$a0,$e0,$80,$f0,$80,$30,$f0
-.byte $80,$00,$00,$30,$70,$70,$e0,$f0
-.byte $f0,$f0,$50,$f0,$c0,$30,$30,$30
-.byte $f0,$b0,$f0,$50,$b0,$b0,$b0,$f0
-.byte $b0,$b0,$10,$10,$f0,$10,$f0,$b0
-.byte $50,$b0,$b0,$b0,$10,$d0,$30,$b0
-.byte $b0,$90,$f0,$f0,$70,$f0,$d0,$b0
-.byte $10,$d0,$30,$70,$90,$50,$10,$50
-.byte $30,$30,$d0,$50,$b0,$10,$50,$50
-.byte $50,$50,$50,$70,$b0,$50,$50,$50
-.byte $50,$50,$d0,$b0,$b0,$b0,$50,$00
-.byte $00,$10,$30,$70,$50,$30,$30,$10
-.byte $10,$b0,$d0,$30,$70,$50,$10,$50
-.byte $30,$50,$30,$b0,$b0,$50,$50,$10
-.byte $b0,$b0,$b0,$00,$b0,$b0,$50,$50
-
-soft80_hi_charset4:
-.byte $90,$30,$00,$f0,$f0,$70,$50,$e0
-.byte $50,$50,$e0,$80,$c0,$80,$30,$f0
-.byte $80,$00,$00,$30,$70,$70,$e0,$f0
-.byte $f0,$f0,$30,$30,$f0,$30,$f0,$c0
-.byte $f0,$f0,$f0,$00,$d0,$70,$40,$f0
-.byte $b0,$b0,$b0,$b0,$f0,$f0,$f0,$b0
-.byte $50,$b0,$70,$d0,$d0,$d0,$50,$b0
-.byte $50,$d0,$f0,$f0,$b0,$80,$b0,$b0
-.byte $70,$90,$50,$70,$50,$10,$b0,$50
-.byte $50,$b0,$d0,$30,$b0,$10,$50,$50
-.byte $50,$50,$70,$b0,$b0,$50,$50,$10
-.byte $b0,$50,$b0,$b0,$b0,$b0,$f0,$00
-.byte $00,$50,$50,$70,$50,$70,$70,$50
-.byte $50,$b0,$d0,$30,$70,$50,$10,$50
-.byte $70,$50,$30,$d0,$b0,$50,$50,$10
-.byte $b0,$b0,$b0,$00,$70,$b0,$50,$a0
-
-soft80_hi_charset5:
-.byte $f0,$30,$00,$f0,$f0,$70,$50,$e0
-.byte $50,$a0,$e0,$b0,$c0,$f0,$b0,$f0
-.byte $b0,$f0,$b0,$b0,$70,$70,$e0,$f0
-.byte $f0,$00,$30,$30,$f0,$f0,$f0,$c0
-.byte $f0,$f0,$f0,$50,$30,$50,$50,$f0
-.byte $b0,$b0,$50,$b0,$b0,$f0,$b0,$70
-.byte $50,$b0,$70,$50,$d0,$50,$50,$b0
-.byte $50,$50,$b0,$b0,$b0,$f0,$b0,$f0
-.byte $50,$50,$50,$70,$50,$70,$b0,$90
-.byte $50,$b0,$d0,$50,$b0,$50,$50,$50
-.byte $30,$90,$70,$d0,$b0,$50,$b0,$10
-.byte $50,$90,$70,$b0,$d0,$b0,$f0,$b0
-.byte $f0,$50,$50,$50,$50,$70,$70,$50
-.byte $50,$b0,$50,$50,$70,$50,$50,$50
-.byte $70,$b0,$50,$50,$b0,$50,$b0,$50
-.byte $50,$b0,$70,$b0,$70,$b0,$50,$a0
-
-soft80_hi_charset6:
-.byte $f0,$30,$00,$f0,$f0,$70,$a0,$e0
-.byte $a0,$50,$e0,$b0,$c0,$f0,$b0,$00
-.byte $b0,$f0,$b0,$b0,$70,$70,$e0,$f0
-.byte $f0,$00,$70,$30,$f0,$f0,$f0,$c0
-.byte $f0,$b0,$f0,$50,$b0,$50,$80,$f0
-.byte $d0,$70,$f0,$f0,$b0,$f0,$b0,$70
-.byte $b0,$10,$10,$b0,$d0,$b0,$b0,$b0
-.byte $b0,$b0,$f0,$b0,$d0,$f0,$70,$b0
-.byte $b0,$90,$30,$90,$90,$90,$b0,$d0
-.byte $50,$10,$d0,$50,$10,$50,$50,$b0
-.byte $70,$d0,$70,$30,$d0,$90,$b0,$50
-.byte $50,$d0,$10,$90,$d0,$30,$f0,$b0
-.byte $f0,$50,$30,$b0,$30,$10,$70,$b0
-.byte $50,$10,$b0,$50,$10,$50,$50,$b0
-.byte $70,$d0,$50,$b0,$b0,$b0,$b0,$50
-.byte $50,$b0,$10,$b0,$b0,$b0,$50,$50
-
-soft80_hi_charset7:
-.byte $f0,$30,$00,$f0,$00,$70,$a0,$e0
-.byte $a0,$a0,$e0,$b0,$c0,$f0,$b0,$00
-.byte $b0,$f0,$b0,$b0,$70,$70,$e0,$f0
-.byte $f0,$00,$f0,$30,$f0,$f0,$f0,$c0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$70,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$70,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$30
-.byte $f0,$f0,$30,$f0,$f0,$f0,$f0,$f0
-.byte $70,$d0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$30,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$f0,$f0,$f0,$f0,$f0
-.byte $f0,$f0,$f0,$b0,$b0,$b0,$f0,$50
-
index de6ab7637a9f5c6cf59ac0c48f3dae854d6acf42..ac9d123d380754b35b5bf43163fc133e31e1c279 100644 (file)
@@ -17,7 +17,7 @@ soft80_chline:
         cmp     #0                      ; Is the length zero?
         beq     L9                      ; Jump if done
         sta     tmp1
-L1:     lda     #96                     ; Horizontal line, screen code
+L1:     lda     #96                     ; Horizontal line, petscii code
         jsr     soft80_cputdirect       ; Direct output
         dec     tmp1
         bne     L1
index 199ac3584a9794988b468f336775cf15912d4aff..fd2d7fd4d59c0232114b049f3302d357428be772 100644 (file)
@@ -8,6 +8,8 @@
         .import         soft80_kclrscr
         .import         soft80_textcolor, soft80_bgcolor
 
+        .importzp       ptr1, ptr2, ptr3
+
         .include        "c64.inc"
         .include        "soft80.inc"
 
@@ -28,22 +30,36 @@ soft80_init:
         lda     #$34
         sta     $01
 
-        lda     #>soft80_lo_charset0
-        sta     @hi1+2
-        lda     #>$d000
-        sta     @hi2+2
+        lda     #>soft80_charset
+        sta     ptr1+1
+        lda     #<soft80_charset
+        sta     ptr1
+        lda     #>soft80_lo_charset
+        sta     ptr2+1
+        lda     #<soft80_lo_charset
+        sta     ptr2
+        lda     #>soft80_hi_charset
+        sta     ptr3+1
+        lda     #<soft80_hi_charset
+        sta     ptr3
 
-        ldy     #8
+        ldx     #4
 @l2:
-        ldx     #0
+        ldy     #0
 @l1:
-@hi1:   lda     soft80_lo_charset0,x
-@hi2:   sta     $d000,x
-        inx
+        lda     (ptr1),y
+        sta     (ptr2),y
+        asl     a
+        asl     a
+        asl     a
+        asl     a
+        sta     (ptr3),y
+        iny
         bne     @l1
-        inc     @hi1+2
-        inc     @hi2+2
-        dey
+        inc     ptr1+1
+        inc     ptr2+1
+        inc     ptr3+1
+        dex
         bne     @l2
 
         pla
@@ -68,7 +84,6 @@ soft80_shutdown:
         sta     VIC_VIDEO_ADR
         rts
 
-; FIXME: generate the charset at init time, and put it into RAM under I/O
-
+soft80_charset:
         .include "soft80_charset.s"
 
index a24d17c79869b2ca6da100e07a16c42d2f0fcaf6..847186a3bca6c29d67c34ebd83fdf81503066d03 100644 (file)
@@ -17,7 +17,7 @@ soft80_cvline:
         cmp     #0              ; Is the length zero?
         beq     L9              ; Jump if done
         sta     tmp1
-L1:     lda     #125            ; Vertical bar
+L1:     lda     #125            ; Vertical bar, petscii code
         jsr     soft80_putchar  ; Write, no cursor advance
         jsr     soft80_newline  ; Advance cursor to next line
         dec     tmp1