]> git.sur5r.net Git - cc65/blob - libsrc/cbm610/kplot.s
2a514185aab08c6d601bf20c341fed6ccf64132e
[cc65] / libsrc / cbm610 / kplot.s
1 ;
2 ; Ullrich von Bassewitz, 28.09.1998
3 ;
4 ; PLOT routine for the 610.
5 ;
6
7         .export         k_plot
8         .importzp       crtc
9
10         .include        "cbm610.inc"
11
12
13 .proc   k_plot
14
15         bcc     set
16         ldx     CURS_Y
17         ldy     CURS_X
18         rts
19
20 set:    stx     CURS_Y
21         sty     CURS_X
22         lda     LineLSBTab,x
23         sta     CharPtr
24         lda     LineMSBTab,x
25         sta     CharPtr+1
26
27         lda     IndReg
28         pha
29         lda     #$0F
30         sta     IndReg
31
32         ldy     #$00
33         clc
34         sei
35         sta     (crtc),y
36         lda     CharPtr
37         adc     CURS_X
38         iny
39         sta     (crtc),y
40         dey
41         lda     #$0E
42         sta     (crtc),y
43         iny
44         lda     (crtc),y
45         and     #$F8
46         sta     sedt1
47         lda     CharPtr+1
48         adc     #$00
49         and     #$07
50         ora     sedt1
51         sta     (crtc),y
52         cli
53
54         pla
55         sta     IndReg
56         rts
57 .endproc
58
59 ; -------------------------------------------------------------------------
60 ; Low bytes of the start address of the screen lines
61
62 .rodata
63
64 LineLSBTab:
65         .byte   $00,$50,$A0,$F0,$40,$90,$E0,$30
66         .byte   $80,$D0,$20,$70,$C0,$10,$60,$B0
67         .byte   $00,$50,$A0,$F0,$40,$90,$E0,$30
68         .byte   $80
69 ; -------------------------------------------------------------------------
70 ; High bytes of the start address of the screen lines
71
72 LineMSBTab:
73         .byte   $D0,$D0,$D0,$D0,$D1,$D1,$D1,$D2
74         .byte   $D2,$D2,$D3,$D3,$D3,$D4,$D4,$D4
75         .byte   $D5,$D5,$D5,$D5,$D6,$D6,$D6,$D7
76         .byte   $D7