enable cursor, some fixes

This commit is contained in:
Kelvin Sherlock 2021-09-23 23:43:25 -04:00
parent 1b2ac595d7
commit 73722a2c02
3 changed files with 77 additions and 9 deletions

22
apple2gs.equ.S Normal file
View File

@ -0,0 +1,22 @@
SET80VID equ $c00d
SETALTCHAR equ $c00f
TXTSET equ $c051
KEYMOD equ $c025
KEYSTROBE equ $c010
KBD equ $c000
VGCINT equ $c023
SCANINT equ $c032
* modem port / printer port
SCCBREG equ $c038
SCCAREG equ $c039
SCCBDATA equ $c03a
SCCADATA equ $c03b
* interrupt vectors. JMP ABSLONG.
IRQ1SEC equ $e10054
IRQQTR equ $e10038
IRQVBL equ $e10030
IRQSND equ $e1002c

View File

@ -6,21 +6,16 @@
mx %11
use vt.equ
use apple2gs.equ
use debug
ext scroll_down
ext recalc_cursor,recalc_cursor_x,recalc_cursor_y
ext write_modem,read_modem,init_modem,keypress
ext disable_cursor,enable_cursor
ext disable_cursor,enable_cursor,cursor_vector
ext erase_screen
ext init_tabs
SET80VID equ $c00d
SETALTCHAR equ $c00f
TXTSET equ $c051
VGCINT equ $c023
SCANINT equ $c032
main debug main
clc
@ -71,6 +66,19 @@ init
lda #" " ; 16-bit
sta erase_char
lda #$0080
sta cursor_state
sei
lda cursor_vector
stal IRQ1SEC
lda cursor_vector+2
stal IRQ1SEC+2
cli
lda #0 ; clear high byte
sep #$30
lda #"_"

View File

@ -5,6 +5,7 @@
xc
xc
use vt.equ
use apple2gs.equ
mx %11
@ -76,8 +77,10 @@ enable_cursor ent
bvc :80
* option for inverted cursor?
lda cursor_char
ldy cursor_offset
lda [cursor_base],y
sta cursor_saved_char
lda cursor_char
sta [cursor_base],y
:80 lda #$80
@ -86,6 +89,41 @@ enable_cursor ent
:rts plp
rts
cursor_vector ent
jml cursor_int
cursor_int
* cursor interrupt - blink the cursor.
mx %11
ldy cursor_offset
lda cursor_state
bmi :rts
eor #$40
sta cursor_state
beq :off
:on
lda [cursor_base],y
sta cursor_saved_char
lda cursor_char
sta [cursor_base],y
bra :rts
:off
lda cursor_saved_char
sta [cursor_base],y
:rts stz SCANINT ; reset 1-sec interrupt
clc
rtl
recalc_cursor ent
* recalculate the cursor pointer after x/y changed
* assumes cursor is off so no saving/restoring the cursor char.
@ -190,7 +228,7 @@ draw_char ent
:normal ora #$80
:draw
* sta cursor_saved_char
* with DECAWM, x = 79, will CR LF (with scroll) before drawing character.