1
0
mirror of https://github.com/cc65/cc65.git synced 2024-07-03 06:29:36 +00:00
cc65/libsrc/cbm610/crtc.s
cuz a7042ddbe4 Complete redesign of the CBM610 support.
Use wrappers to call the kernal in bank 15 instead of implementing kernal
functionality within the cc65 libs (eats performance but is much smaller and
simpler).
Improved startup/shutdown code allows a return to the system bank without
calling the BASIC cold start vector.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2793 b7a2c559-68d2-44c3-8de9-860c34a00d81
2003-12-20 23:13:26 +00:00

58 lines
599 B
ArmAsm

;
; Ullrich von Bassewitz, 28.09.1998
;
; Write to the CRTC.
;
.export write_crtc, read_crtc
.importzp crtc, ktmp
.include "cbm610.inc"
; Write a value to the CRTC. The index is in Y, the value in A
.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
.endproc
.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
.endproc