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