2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 28.09.1998
|
|
|
|
;
|
|
|
|
; Write to the CRTC.
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export write_crtc, read_crtc
|
|
|
|
.importzp crtc, ktmp
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "cbm610.inc"
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
; Write a value to the CRTC. The index is in Y, the value in A
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc write_crtc
|
|
|
|
sta ktmp
|
|
|
|
lda IndReg
|
|
|
|
pha
|
|
|
|
lda #$0F
|
|
|
|
sta IndReg
|
|
|
|
tya
|
|
|
|
ldy #$00
|
|
|
|
sei
|
|
|
|
sta (crtc),y
|
|
|
|
iny
|
|
|
|
lda ktmp
|
|
|
|
sta (crtc),y
|
|
|
|
cli
|
|
|
|
pla
|
|
|
|
sta IndReg
|
|
|
|
lda ktmp
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
.endproc
|
|
|
|
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc read_crtc
|
|
|
|
sty ktmp
|
|
|
|
lda IndReg
|
|
|
|
pha
|
|
|
|
lda #$0F
|
|
|
|
sta IndReg
|
|
|
|
lda ktmp
|
|
|
|
ldy #$00
|
|
|
|
sei
|
|
|
|
sta (crtc),y
|
|
|
|
iny
|
|
|
|
lda (crtc),y
|
|
|
|
cli
|
|
|
|
tay
|
|
|
|
pla
|
|
|
|
sta IndReg
|
|
|
|
tya
|
|
|
|
ldy ktmp
|
|
|
|
rts
|
2000-05-28 13:40:48 +00:00
|
|
|
.endproc
|
|
|
|
|
|
|
|
|