Added condes IRQ routines and a README file.

Made k_blncur a condes IRQ routine and moved it to cgetc.s.
Added mouse and joystick routines.


git-svn-id: svn://svn.cc65.org/cc65/trunk@951 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-09-19 10:01:52 +00:00
parent 2ffb744316
commit e12444824f
8 changed files with 681 additions and 108 deletions

View File

@@ -5,6 +5,7 @@
;
.export _cgetc
.condes k_blncur, 2
.import cursor
.include "zeropage.inc"
@@ -90,6 +91,61 @@ L4: lda KeyBuf+1,x ; Move up the remaining chars
@L9: sty CURS_FLAG ; Cursor on (Y = 0)
rts
.endproc
; ------------------------------------------------------------------------
; Blink the cursor in the interrupt. A blinking cursor is only available if
; we use the cgetc() function, so we will export this IRQ handler only in
; case the module is included into a program.
.proc k_blncur
lda CURS_FLAG ; Is the cursor on?
bne curend ; Jump if not
dec CURS_BLINK
bne curend
; Re-initialize the blink counter
lda #20 ; Initial value
sta CURS_BLINK
; Load Y with the cursor X coordinate
ldy CURS_X
; Check if the cursor state was on or off before
lda CURS_COLOR ; Load color behind cursor
lsr CURS_STATE ; Cursor currently displayed?
bcs curset ; Jump if yes
; Cursor was off before, switch it on
inc CURS_STATE ; Mark as displayed
lda (CRAM_PTR),y ; Get color behind cursor...
sta CURS_COLOR ; ...and remember it
lda CHARCOLOR ; Use character color
; Set the cursor with color in A
curset: sta (CRAM_PTR),y ; Store cursor color
lda ExecReg
sta IndReg ; Switch to our segment
lda (SCREEN_PTR),y
eor #$80 ; Toggle reverse flag
sta (SCREEN_PTR),y
; Switch back to the system bank
lda #$0F
sta IndReg
curend: rts
.endproc