]> git.sur5r.net Git - cc65/blob - libsrc/c64/soft80_kplot.s
some renaming, preparing plot table names
[cc65] / libsrc / c64 / soft80_kplot.s
1
2 ;
3 ; Groepaz/Hitmen, 12.10.2015
4 ;
5 ; lowlevel kplot function for the soft80 implementation
6 ;
7
8         .export         soft80_kplot
9         .import         soft80_internal_cursorxlsb
10
11         .include        "c64.inc"
12         .include        "soft80.inc"
13
14 soft80_kplot:
15         bcs     @getpos
16
17         stx     CURS_Y
18         sty     CURS_X
19
20         ; calc pointer to bitmap
21         lda     soft80_bitmapylo,x
22         clc
23         adc     soft80_bitmapxlo,y
24         sta     SCREEN_PTR
25         lda     soft80_bitmapyhi,x
26         adc     soft80_bitmapxhi,y
27         sta     SCREEN_PTR+1
28
29         tya
30         and     #1
31         sta     soft80_internal_cursorxlsb
32
33         ; calc pointer to vram
34         tya
35         lsr     a
36
37         clc
38         adc     soft80_vramlo,x
39         sta     CRAM_PTR
40         lda     #0
41         adc     soft80_vramhi,x
42         sta     CRAM_PTR+1
43
44 @getpos:
45         ldx     CURS_Y
46         ldy     CURS_X
47         rts
48
49         ; FIXME: the following tables take up 260 bytes, perhaps move them
50         ;        to 0xdc00... area in ram under i/o
51
52         .rodata
53 soft80_bitmapxlo:
54         .repeat 80,col
55         .byte <((col/2)*8)
56         .endrepeat
57 soft80_bitmapxhi:
58         .repeat 80,col
59         .byte >((col/2)*8)
60         .endrepeat
61 soft80_vramlo:
62         .repeat 25,row
63         .byte <(soft80_vram+(row*40))
64         .endrepeat
65 soft80_vramhi:
66         .repeat 25,row
67         .byte >(soft80_vram+(row*40))
68         .endrepeat
69 soft80_bitmapylo:
70         .repeat 25,row
71         .byte <(soft80_bitmap+(row*40*8))
72         .endrepeat
73 soft80_bitmapyhi:
74         .repeat 25,row
75         .byte >(soft80_bitmap+(row*40*8))
76         .endrepeat
77
78 ;-------------------------------------------------------------------------------
79 ; force the init constructor to be imported
80
81         .import soft80_init
82 conio_init      = soft80_init