]> git.sur5r.net Git - cc65/commitdiff
include bitmap and vram row tables directly rather than generating them (saves space)
authormrdudz <mrdudz@users.noreply.github.com>
Sun, 27 Sep 2015 16:49:30 +0000 (18:49 +0200)
committermrdudz <mrdudz@users.noreply.github.com>
Sun, 27 Sep 2015 16:49:30 +0000 (18:49 +0200)
libsrc/c64/soft80_conio.s
libsrc/c64/soft80_kplot.s

index eb05e4e8bd76de16b926445f26d3d85e0151edf0..199ac3584a9794988b468f336775cf15912d4aff 100644 (file)
@@ -5,7 +5,7 @@
         .constructor    soft80_init, 24
         .destructor     soft80_shutdown
 
         .constructor    soft80_init, 24
         .destructor     soft80_shutdown
 
-        .import         soft80_kclrscr, soft80_plotinit
+        .import         soft80_kclrscr
         .import         soft80_textcolor, soft80_bgcolor
 
         .include        "c64.inc"
         .import         soft80_textcolor, soft80_bgcolor
 
         .include        "c64.inc"
@@ -50,8 +50,6 @@ soft80_init:
         sta     $01
         cli
 
         sta     $01
         cli
 
-        jsr     soft80_plotinit
-
         lda     646                     ; use current textcolor
         jsr     soft80_textcolor
 
         lda     646                     ; use current textcolor
         jsr     soft80_textcolor
 
index c6c6b94cc15c56ff8723d720662dcbdf8b61a88b..a813fd679268b9991eb89c5e9f3b564d39d83f68 100644 (file)
@@ -1,6 +1,5 @@
 
         .export         soft80_kplot
 
         .export         soft80_kplot
-        .export         soft80_plotinit
 
         .include        "c64.inc"
         .include        "soft80.inc"
 
         .include        "c64.inc"
         .include        "soft80.inc"
@@ -32,70 +31,30 @@ soft80_kplot:
         ldy     CURS_X
         rts
 
         ldy     CURS_X
         rts
 
-        ; FIXME: perhaps just include the respective tables directly?
-soft80_plotinit:
-        ; create screen-rows base tables (bitmap)
-        lda     #<soft80_bitmap
-        sta     SCREEN_PTR
-        lda     #>soft80_bitmap
-        sta     SCREEN_PTR+1
-
-        ldx     #$00
-l1:
-        lda     SCREEN_PTR
-        sta     _bitmaplo,x
-        clc
-        adc     #<(40*8)
-        sta     SCREEN_PTR
-        lda     SCREEN_PTR+1
-        sta     _bitmaphi,x
-        adc     #>(40*8)
-        sta     SCREEN_PTR+1
-        inx
-        cpx     #25
-        bne     l1
-
-        ; create screen-rows base tables (colorram)
-
-        lda     #<soft80_vram
-        sta     CRAM_PTR
-        lda     #>soft80_vram
-        sta     CRAM_PTR+1
-
-        ldx     #$00
-l1b:
-        lda     CRAM_PTR
-        sta     _vramlo,x
-        clc
-        adc     #<(40)
-        sta     CRAM_PTR
-        lda     CRAM_PTR+1
-        sta     _vramhi,x
-        adc     #>(40)
-        sta     CRAM_PTR+1
-        inx
-        cpx     #25
-        bne     l1b
-
-        rts
-
+        .rodata
 _bitmapxlo:
 _bitmapxlo:
-        .repeat 80,col1
-        .byte <((col1/2)*8)
+        .repeat 80,col
+        .byte <((col/2)*8)
         .endrepeat
 
 _bitmapxhi:
         .repeat 80,col
         .byte >((col/2)*8)
         .endrepeat
         .endrepeat
 
 _bitmapxhi:
         .repeat 80,col
         .byte >((col/2)*8)
         .endrepeat
-
-        .bss
 _vramlo:
 _vramlo:
-        .res 25
+        .repeat 25,row
+        .byte <(soft80_vram+(row*40))
+        .endrepeat
 _vramhi:
 _vramhi:
-        .res 25
+        .repeat 25,row
+        .byte >(soft80_vram+(row*40))
+        .endrepeat
 _bitmaplo:
 _bitmaplo:
-        .res 25
+        .repeat 25,row
+        .byte <(soft80_bitmap+(row*40*8))
+        .endrepeat
 _bitmaphi:
 _bitmaphi:
-        .res 25
+        .repeat 25,row
+        .byte >(soft80_bitmap+(row*40*8))
+        .endrepeat