]> git.sur5r.net Git - cc65/blob - libsrc/cbm610/crtc.s
info about c1541 in docs, lowered highest available address to $6000 due to
[cc65] / libsrc / cbm610 / crtc.s
1 ;
2 ; Ullrich von Bassewitz, 28.09.1998
3 ;
4 ; Write to the CRTC.
5 ;
6
7         .export         write_crtc, read_crtc
8         .importzp       crtc
9
10         .include        "cbm610.inc"
11         .include        "zeropage.inc"
12
13
14 ; Write a value to the CRTC. The index is in Y, the value in A
15
16 .proc   write_crtc
17         sta     sedt1
18         lda     IndReg
19         pha
20         lda     #$0F
21         sta     IndReg
22         tya
23         ldy     #$00
24         sei
25         sta     (crtc),y
26         iny
27         lda     sedt1
28         sta     (crtc),y
29         cli
30         pla
31         sta     IndReg
32         lda     sedt1
33         rts
34 .endproc
35
36
37 .proc   read_crtc
38         sty     sedt1
39         lda     IndReg
40         pha
41         lda     #$0F
42         sta     IndReg
43         lda     sedt1
44         ldy     #$00
45         sei
46         sta     (crtc),y
47         iny
48         lda     (crtc),y
49         cli
50         tay
51         pla
52         sta     IndReg
53         tya
54         ldy     sedt1
55         rts
56 .endproc
57
58