Files
open-roms/src/kernal/screen/chrout_screen_control.s
T
chris f809b9b7ea feat(arnitech): the Terminal Card is a Blade's screen and keyboard
With ARNITECH_BLADE the screen editor, the keyboard matrix scan, and the VIC-II
set-up are left out, and devices 3 and 0 are the Terminal Card the Arnitech
controller finds by its type, $04. CHROUT writes each byte to its Output, or
to its Literal while quote or insert mode is on, keeping QTSW and INSRT as the
screen editor does. CHRIN marks where input starts, echoes the keys typed, and
on RETURN has the Card take the logical line under the cursor and reads it
back. SCNKEY moves the Card's keys into the keyboard buffer up to XMAX, UDTIM
sets STKEY from its RUN/STOP, SCREEN answers 80x25, PLOT moves and reads its
cursor, and CINT resets it and puts the native-mode vectors in place. With no
Terminal Card, bytes printed go nowhere and no key comes.
2026-10-18 08:57:01 +02:00

78 lines
1.3 KiB
ArmAsm

;; #LAYOUT# STD * #TAKE
;; #LAYOUT# X16 * #IGNORE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; CHROUT routine - screen support, control codes
;
chrout_screen_control:
txa
chrout_try_jumptable:
ldx #(__chrout_screen_jumptable_codes_end - chrout_screen_jumptable_codes - 1)
chrout_try_jumptable_loop:
cpx #(__chrout_screen_jumptable_quote_guard - chrout_screen_jumptable_codes - 1)
bne chrout_try_jumptable_loop_noquote
; Is this insert/quote mode?
tay
lda QTSW
ora INSRT
beq @1
tya
jmp chrout_screen_quote
@1:
tya
; FALLTROUGH
chrout_try_jumptable_loop_noquote:
cmp chrout_screen_jumptable_codes, x
bne @2
; Found, perform a jump to subroutine
!ifndef HAS_OPCODES_65C02 {
lda chrout_screen_jumptable_hi, x
pha
lda chrout_screen_jumptable_lo, x
pha
rts
} else {
txa
asl
tax
jmp (chrout_screen_jumptable, x)
}
@2:
dex
bpl chrout_try_jumptable_loop
chrout_try_COLOR:
ldx #$0F
chrout_try_color_loop:
cmp colour_codes,x
bne @3
stx COLOR
jmp chrout_screen_done
@3:
dex
bpl chrout_try_color_loop
; Unknown code, or key not requiring any handling
jmp chrout_screen_done
} ; CONFIG_ARNITECH_BLADE