Files
open-roms/src/kernal/iostack/e50a.plot.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

65 lines
1.2 KiB
ArmAsm

;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
;
; Official Kernal routine, described in:
;
; - [RG64] C64 Programmers Reference Guide - page 290
; - [CM64] Computes Mapping the Commodore 64 - page 215
;
; CPU registers that has to be preserved (see [RG64]): none
;
PLOT:
bcs plot_get
; Note: the 'set' part has to start from $E50C, as this is a known address
; - https://www.lemon64.com/forum/viewtopic.php?t=3296&amp%3Bstart=15
; - https://sys64738.org/2019/05/c64-bedtime-coding-eng-printing-08/
; - 'Duotris' game calls $E50C during startup screen initialization
plot_set:
sty PNTR
stx TBLX
!ifndef CONFIG_ARNITECH_BLADE {
jsr screen_calculate_pointers
} else {
; On a Blade the cursor is the Terminal Card's, which clamps it to the 80x25 screen;
; PNTR and TBLX keep the last place set or read, which is all there is without a Card
jsr terminal_find
bcs plot_get_kept
lda PNTR
sta TERMINAL_COLUMN, x
lda TBLX
sta TERMINAL_ROW, x
}
; FALLTROUGH to save one byte on RTS
plot_get:
!ifdef CONFIG_ARNITECH_BLADE {
jsr terminal_find
bcs plot_get_kept
lda TERMINAL_COLUMN, x
sta PNTR
lda TERMINAL_ROW, x
sta TBLX
plot_get_kept:
}
ldy PNTR
ldx TBLX
rts