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.
This commit is contained in:
chris committed 2026-10-18 08:57:01 +02:00
1 parent b7fef8abe6
commit f809b9b7ea
68 files changed
+625 -3

No files matched your search

+22
View File
@@ -36,6 +36,28 @@
!ifdef CONFIG_ARNITECH_BLADE {
; The Terminal Card, a Blade's screen and keyboard (arnitech's ADR 0031): its type in the Slot
; table, and its registers indexed by its Card window's low byte, as ARNI_FINDCARD gives it in X
!set TERMINAL_CARD_TYPE = $04
!addr TERMINAL_OUTPUT = $DE00 ; a PETSCII byte, printed as the screen editor prints it
!addr TERMINAL_LITERAL = $DE01 ; a byte drawn as its glyph, for quote and insert mode
!addr TERMINAL_STATUS = $DE02
!addr TERMINAL_KEY = $DE03 ; the next key; a read takes it, $00 if none
!addr TERMINAL_COMMAND = $DE04
!addr TERMINAL_LINE = $DE05 ; the taken line's next byte, RETURN at its end
!addr TERMINAL_COLUMN = $DE06
!addr TERMINAL_ROW = $DE07
!set TERMINAL_KEY_WAITING = %00000001 ; status bits
!set TERMINAL_STOP_HELD = %00000010
!set TERMINAL_INSERTED = %00001000 ; the last byte was an INS that opened a space
!set TERMINAL_TAKE_LINE = $01 ; commands
!set TERMINAL_RESET = $02
!set TERMINAL_INPUT_START = $03
; The 65816's native-mode vectors, which a Blade reads from the RAM under the KERNAL (ADR 0029)
!addr NATIVE_VECTORS = $FFE4 ; COP, BRK, ABORT, NMI, reserved, IRQ
+256
View File
@@ -0,0 +1,256 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * * #IGNORE
;
; The Terminal Card driver of the Blade Firmware (mc64blade only, arnitech's ADR 0030 and 0031)
;
; A Blade has no VIC-II and no keyboard: its screen and keyboard, devices 3 and 0, are the
; Terminal Card, which holds the 80x25 screen and the screen editor itself. CHROUT writes each
; byte to it, as a glyph while quote or insert mode is on; CHRIN echoes the keys typed and, on
; RETURN, reads back the logical line under the cursor; the IRQ moves its keys into the keyboard
; buffer and its RUN/STOP into STKEY. Quote and insert mode stay the KERNAL's, in QTSW and INSRT,
; as the Card cannot see them. With no Terminal Card, bytes printed go nowhere and no key comes.
;
!ifdef CONFIG_ARNITECH_BLADE {
;
; Finds the Terminal Card. Out: carry clear and X = its Card window's low byte, carry set if
; there is none. A is not kept, Y is.
;
terminal_find:
lda #TERMINAL_CARD_TYPE
jmp arnitech_find_card
;
; CHROUT for device 3. SCHAR holds the byte; CHROUT has saved X, Y, and P.
;
; Outside quote and insert mode the byte goes to Output. While either is on, every control code
; but RETURN, SHIFT+RETURN, and STOP goes to Literal, which draws it as a glyph; so does DEL
; while INSRT is not 0, which a DEL between quotes leaves to delete. RETURN, SHIFT+RETURN, and
; STOP end both modes. A glyph drawn counts INSRT down, a quote toggles QTSW, and an INS that
; opened a space (status bit 3) counts INSRT up.
;
chrout_terminal:
jsr terminal_find
bcs chrout_terminal_done ; no Terminal Card: the byte goes nowhere
lda SCHAR
and #$60
beq chrout_terminal_control ; $00-$1F and $80-$9F are control codes
lda SCHAR
sta TERMINAL_OUTPUT, x
; FALLTROUGH
chrout_terminal_glyph:
lda INSRT
beq @1
dec INSRT
@1:
lda SCHAR
cmp #$22
bne chrout_terminal_done
lda QTSW
eor #$80
sta QTSW
; FALLTROUGH
chrout_terminal_done:
jmp chrout_done_success
chrout_terminal_control:
lda SCHAR
cmp #KEY_RETURN
beq chrout_terminal_end_modes
cmp #KEY_SHIFT_RETURN
beq chrout_terminal_end_modes
cmp #KEY_STOP
beq chrout_terminal_end_modes
ldy INSRT
bne chrout_terminal_literal ; in the spaces INS opened, DEL too is a glyph
ldy QTSW
beq chrout_terminal_code
cmp #KEY_DEL
beq chrout_terminal_code ; between quotes DEL still deletes
; FALLTROUGH
chrout_terminal_literal:
sta TERMINAL_LITERAL, x
jmp chrout_terminal_glyph
chrout_terminal_code:
sta TERMINAL_OUTPUT, x
cmp #KEY_INS
bne chrout_terminal_done
lda TERMINAL_STATUS, x
and #TERMINAL_INSERTED
beq chrout_terminal_done
inc INSRT
bne chrout_terminal_done ; branch always
chrout_terminal_end_modes:
sta TERMINAL_OUTPUT, x
lda #$00
sta QTSW
sta INSRT
beq chrout_terminal_done ; branch always
;
; CHRIN for device 0, the keyboard. X and Y are kept.
;
; The first call marks where input starts on the Terminal, echoes each key typed through CHROUT,
; and on RETURN has the Card take the logical line under the cursor; it and the calls after
; return the line's bytes, then RETURN, which ends it.
;
chrin_terminal:
stx XSAV
+phy_trash_a
lda CRSW
bne chrin_terminal_next ; a line is being returned
jsr terminal_find
bcs chrin_terminal_wait
lda #TERMINAL_INPUT_START
sta TERMINAL_COMMAND, x
chrin_terminal_wait:
lda NDX
beq chrin_terminal_wait
jsr get_from_keyboard_buffer
cmp #KEY_RETURN
beq chrin_terminal_take
jsr JCHROUT ; the Terminal Card edits
jmp chrin_terminal_wait
chrin_terminal_take:
jsr terminal_find
bcs chrin_terminal_end ; the Card is gone: an empty line
lda #TERMINAL_TAKE_LINE
sta TERMINAL_COMMAND, x
inc CRSW
chrin_terminal_next:
jsr terminal_find
bcs chrin_terminal_end
lda TERMINAL_LINE, x
cmp #KEY_RETURN
bne chrin_terminal_return
; FALLTROUGH
chrin_terminal_end:
lda #$00
sta CRSW
sta QTSW
sta INSRT
lda #KEY_RETURN
; FALLTROUGH
chrin_terminal_return:
tax
+ply_trash_a
txa
ldx XSAV
clc
rts
;
; SCNKEY: moves the Terminal Card's keys into the keyboard buffer, while it has room; the rest
; wait in the Card.
;
SCNKEY:
jsr terminal_find
bcs @2
@1:
lda TERMINAL_STATUS, x
lsr ; bit 0, a key waiting, into carry
bcc @2
ldy NDX
cpy XMAX
bcs @2
lda TERMINAL_KEY, x
sta KEYD, y
inc NDX
bne @1 ; branch always
@2:
rts
;
; The part of UDTIM that reads the STOP key: STKEY is $7F while the Terminal Card's RUN/STOP is
; held, $FF otherwise. Y is kept.
;
udtim_terminal_stop:
jsr terminal_find
lda #$00 ; no Terminal Card, no RUN/STOP
bcs @1
lda TERMINAL_STATUS, x
@1:
and #TERMINAL_STOP_HELD
lsr
lsr ; held into carry
ror ; ... and into bit 7
eor #$FF
sta STKEY
rts
;
; SCREEN: the Terminal's 80 columns in X and 25 rows in Y.
;
SCREEN:
ldx #80
ldy #25
rts
;
; CINT's work on a Blade: the keyboard and the screen as the input and output devices (as
; vicii_init does on a C64), the keyboard buffer's size, a reset of the Terminal and of quote and
; insert mode, the native-mode vectors, and CIA1's timer A for the jiffy IRQ.
;
cint_terminal:
jsr clrchn_reset
ldx #10
stx XMAX
lda #$00
sta CRSW
sta QTSW
sta INSRT
jsr terminal_find
bcs @1
lda #TERMINAL_RESET
sta TERMINAL_COMMAND, x
@1:
jsr native_vectors_init
jmp setup_pal_ntsc
}
+5
View File
@@ -2,6 +2,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; This is a part CINT which initializes screen and keyboard
;
@@ -49,3 +52,5 @@ cint_screen_keyboard:
; Fallthrough/jump to screen clear routine (Computes Mapping the 64 p215)
jmp clear_screen
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -2,6 +2,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Part of the official Kernal routine, described in:
;
@@ -37,3 +40,5 @@ cint_legacy_end:
; Game 'Operacja Proboszcz' is one example.
jmp cint_screen_keyboard ; XXX try to fit the code here
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -5,6 +5,9 @@
;; #LAYOUT# X16 * #IGNORE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no VIC-II
!ifndef CONFIG_ARNITECH_BLADE {
;
; Well-known Kernal routine, described in:
;
@@ -28,3 +31,5 @@ vicii_init:
jmp vicii_init_registers
} ; ROM layout
} ; CONFIG_ARNITECH_BLADE
+4
View File
@@ -13,5 +13,9 @@
CINT:
!ifndef CONFIG_ARNITECH_BLADE {
jsr cint_legacy
jmp setup_pal_ntsc
} else {
jmp cint_terminal
}
+4
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# M65 KERNAL_1 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no VIC-II
!ifndef CONFIG_ARNITECH_BLADE {
;
; The VIC-II set-up of vicii_init (e5a0.vicii_init.s), moved out of $E5A0-$E5C8
; so that $E5B4 is free
@@ -50,3 +53,4 @@ vicii_init_registers:
jmp CLRCHN
}
} ; CONFIG_ARNITECH_BLADE
@@ -47,7 +47,9 @@ default_irq_handler_common:
} else {
!ifndef CONFIG_ARNITECH_BLADE {
jsr cursor_blink
}
jsr JSCNKEY
jsr JUDTIM ; update jiffy clock
}
+27
View File
@@ -26,12 +26,39 @@ 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
+4
View File
@@ -22,7 +22,11 @@ CHRIN:
lda DFLTN
; Try $00 - keyboard
!ifndef CONFIG_ARNITECH_BLADE {
+beq chrin_keyboard
} else {
+beq chrin_terminal
}
; XXX Try $03 - screen
; cmp #$03
+4
View File
@@ -30,7 +30,11 @@ CHROUT:
lda DFLTO
cmp #$03 ; screen
!ifndef CONFIG_ARNITECH_BLADE {
+beq chrout_screen
} else {
+beq chrout_terminal
}
!ifdef HAS_RS232 {
cmp #$02
+6 -1
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Well-known Kernal routine, described in:
;
@@ -96,4 +99,6 @@ scnkey_toggle_if_needed: ; entry for SCNKEY (TWW/CTR version)
sta VIC_YMCSB
@1:
rts
}
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -4,6 +4,9 @@
;; #LAYOUT# M65 KERNAL_C #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Keyboard matrix, based on
;
@@ -93,3 +96,5 @@ __kb_matrix_ctrl:
!byte $90,$06,$00,$05,$00,$00,$11,$00
!byte $00,$00,$00,$84,$00,$00,$00,$1B
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Extended keyboard matrix for Commodore 128 keyboards, based on
;
@@ -29,3 +32,5 @@ kb_matrix_128_bucky_filter:
!byte %00000000
!byte %10000001 ; ALT, NO_SCRL
}
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Matrix ids of keys which should be repeated regardless of RPTFLG
;
@@ -25,3 +28,5 @@ __kb_matrix_alwaysrepeat_end:
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Matrix for retrieving bucky key status on the C64 keyboard
;
@@ -63,3 +66,5 @@ kb_matrix_bucky_shflag: ; mask to be ORed to SHFLAG to mark key status
!byte KEY_FLAG_ALT
!byte KEY_FLAG_NO_SCRL
}
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Matrix for filtering out bucky keys while scanning the C64 keyboard
;
@@ -23,3 +26,5 @@ kb_matrix_bucky_filter:
!byte %00000000
!byte %00010000 ; SHIFT (right)
!byte %00100100 ; VENDOR + CONTROL
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Matrix for retrieving C64 joystick status and inject is as keyboard event
;
@@ -40,3 +43,5 @@ kb_matrix_joy_keytab_hi:
!byte >__kb_matrix_normal ; right
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -4,6 +4,9 @@
;; #LAYOUT# M65 KERNAL_C #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Helper table for determining keyboard matrix decoding table on the C64 keyboard
;
@@ -49,3 +52,5 @@ kb_matrix_lookup:
!word $0000 ; %1.110 VENDOR+CTRL
!word $0000 ; %1.111 SHIFT+VENDOR+CTRL
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Single row key codes for scanning the C64 keyboard
;
@@ -25,3 +28,5 @@ kb_matrix_row_keys:
!byte %11011111
!byte %10111111
!byte %01111111
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Helper values to quickly determine row offset from the start of keyboard matrix
;
@@ -20,3 +23,5 @@ kb_matrix_row_offsets:
!byte 5*8
!byte 6*8
!byte 7*8
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Helper routine - disconnects the keyboard from CIA1_PRB,
; leaves $FF in .X (behavior needed in some places)
@@ -18,3 +21,5 @@ keyboard_disconnect:
}
rts
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Official Kernal routine, described in:
;
@@ -431,3 +434,5 @@ scnkey_buffer_full:
sta KOUNT
rts
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Keyboard scanning routine extension for C128 keyboards
;
@@ -67,3 +70,5 @@ scnkey_128_no_keys:
jmp scnkey_no_keys ; pass controll to original routine
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, which has no keyboard matrix: its keys come from the Terminal Card (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
; Short helper jump-via-vector routine, to set the keyboard matrix
!ifndef HAS_OPCODES_65CE02 {
@@ -11,3 +14,5 @@ scnkey_via_keylog:
jmp (KEYLOG)
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Keyboard part of the CHRIN routine
;
@@ -167,3 +170,5 @@ chrkn_keyboard_not_enter:
jsr CHROUT
jsr pop_keyboard_buffer
+bra chrin_keyboard_read
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Keyboard part of the CHRIN routine - programmable keys support
; Output: if Carry clear, programmable key was handled
@@ -50,3 +53,5 @@ chrin_programmable_keys:
rts
} ; CONFIG_PROGRAMMABLE_KEYS
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #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 (character output)
;
@@ -99,3 +102,5 @@ chrout_screen_done:
jsr cursor_show_if_enabled
jmp chrout_done_success
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; CLR key handling within CHROUT
;
@@ -12,3 +15,5 @@ chrout_screen_CLR:
jsr clear_screen
jmp chrout_screen_calc_lptr_done
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #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
;
@@ -70,3 +73,5 @@ chrout_try_color_loop:
; Unknown code, or key not requiring any handling
jmp chrout_screen_done
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Cursor keys handling within CHROUT
;
@@ -61,3 +64,5 @@ chrout_screen_CRSR_LEFT:
lda #39
sta PNTR
bne chrout_screen_CRSR_done ; branch always
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #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, DEL key handling
;
@@ -120,3 +123,5 @@ chrout_screen_del_column_0:
; Finish with recalculating all the variables
bne chrout_screen_del_done
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; GFX/TXT mode switch handling within CHROUT
;
@@ -25,3 +28,5 @@ chrout_screen_TXT:
lda VIC_YMCSB
ora #$02 ; to lower case
bne chrout_screen_GFX_TXT_end ; branch always
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; HOME key handling within CHROUT
;
@@ -12,3 +15,5 @@ chrout_screen_HOME:
jsr cursor_home
jmp chrout_screen_calc_lptr_done
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #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, INS key handling
;
@@ -95,3 +98,5 @@ chrout_screen_ins_copy_loop:
; Return from loop
rts
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Jumptable for screen control codes support. To improve performance, should be sorted
; starting from the least probable routine.
@@ -111,3 +114,5 @@ chrout_screen_jumptable:
!word chrout_screen_RETURN
!word chrout_screen_RETURN
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #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 in quote mode
;
@@ -22,3 +25,5 @@ chrout_screen_quote:
adc #$BF ; C=1, so adding $BF + C = add $C0
@1:
jmp chrout_screen_literal
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; RETURN key handling within CHROUT
;
@@ -31,3 +34,5 @@ chrout_screen_RETURN:
jsr screen_calculate_PNT_USER
@1:
jmp screen_advance_to_next_line
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; RVS ON/OFF handling within CHROUT
;
@@ -21,3 +24,5 @@ chrout_screen_RVS_OFF:
sta RVS
jmp chrout_screen_done
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; SHIFT ON/OFF handling within CHROUT
;
@@ -21,3 +24,5 @@ chrout_screen_SHIFT_OFF:
sta MODE
jmp chrout_screen_done
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; STOP key handling within CHROUT
;
@@ -18,3 +21,5 @@ chrout_screen_STOP:
sta INSRT
jmp chrout_screen_done
}
} ; CONFIG_ARNITECH_BLADE
@@ -2,6 +2,9 @@
;; #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 - convert PETSCII to screen code
;
@@ -50,3 +53,5 @@ chrout_to_screen_code:
@done:
rts
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Variables used:
; - BLNSW (cursor blink switch)
@@ -101,3 +104,5 @@ cursor_timer_reset:
cursor_blink_end:
rts
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Variables used:
; - BLNSW (cursor blink switch)
@@ -15,3 +18,5 @@ cursor_enable:
sta BLNSW
rts
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Variables used:
; - BLNSW (cursor blink switch)
@@ -35,3 +38,5 @@ cursor_show:
cursor_show_done:
rts
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Init screen at reset
;
@@ -19,3 +22,5 @@ init_screen:
sta $0286
jmp clear_screen
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Clear screen and initialise line link table, described in:
;
@@ -39,3 +42,5 @@ clear_screen:
; Fall to cursor home routine
jmp cursor_home
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Home the cursor, described in:
;
@@ -17,3 +20,5 @@ cursor_home:
sta TBLX ; current row
; FALLTROUGH to the next routine
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Set pointer (PNT) to current screen line , described in:
;
@@ -23,3 +26,5 @@ screen_calculate_pointers:
jsr screen_calculate_PNT_USER
jmp screen_calculate_PNTR_LNMX
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Scroll the whole screen up by 1 logical line, described in:
;
@@ -130,3 +133,5 @@ screen_scroll_up_loop_done:
; Recalculate PNT and USER
jmp screen_calculate_PNT_USER
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Well-known routine, described in:
;
@@ -36,3 +39,5 @@ screen_clear_line:
; Done
rts
} ; CONFIG_ARNITECH_BLADE
@@ -1,6 +1,9 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Well-known Kernal routine, described in:
;
@@ -22,3 +25,5 @@ screen_calculate_USER:
sta USER+1
rts
} ; CONFIG_ARNITECH_BLADE
@@ -1,6 +1,9 @@
;; #LAYOUT# STD * #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Well-known Kernal table, described in:
;
@@ -15,3 +18,5 @@ screen_line_lo_bytes:
!for line, 0, 24 {
!byte <(line * 40)
}
} ; CONFIG_ARNITECH_BLADE
+6 -1
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Official Kernal routine, described in:
;
@@ -50,4 +53,6 @@ SCREEN:
pla
rts
}
}
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
screen_advance_to_next_line:
@@ -21,3 +24,5 @@ screen_advance_to_next_line:
sta PNTR
jmp chrout_screen_calc_lptr_done
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Set pointers PNT and USER to current screen line
;
@@ -60,3 +63,5 @@ screen_calculate_USER:
rts
}
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Sets PNTR in a proper range (0-39 or 40-79)
; Sets LNMX to 39 or 79
@@ -62,3 +65,5 @@ screen_calculate_lnmx_79:
lda #79
sta LNMX
rts
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
screen_check_space_ends_line:
@@ -12,3 +15,5 @@ screen_check_space_ends_line:
cmp #$20
rts
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Helper routine - check character in .A, toggles quote flag if needed
;
@@ -19,3 +22,5 @@ screen_check_toggle_quote:
lda #$22 ; restore previous .A valuee
@1:
rts
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Screen code to PETSCII conversion - see:
;
@@ -70,3 +73,5 @@ s2p_adc_C0:
adc #$C0 ; Carry already clear
rts
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Get PNTR value clipped to 0-39 range in .Y, sets flags to compare with 0, can trash .A
;
@@ -18,3 +21,5 @@ screen_get_clipped_PNTR:
@1:
cpy #$00
rts
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
screen_get_logical_line_end_ptr:
@@ -27,3 +30,5 @@ screen_get_logical_line_end_39:
ldy #39
rts
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
screen_grow_logical_line_done_scroll:
@@ -142,3 +145,5 @@ screen_grow_logical_line_copy_done:
inx
jsr screen_clear_line
jmp screen_calculate_PNTR_LNMX
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Helper routine to blank screen
;
@@ -31,3 +34,5 @@ screen_off:
rts
}
} ; CONFIG_ARNITECH_BLADE
+5
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
;
; Helper routine to show screen
;
@@ -22,3 +25,5 @@ screen_on:
rts
}
} ; CONFIG_ARNITECH_BLADE
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
screen_preserve_sal_eal:
@@ -33,3 +36,5 @@ screen_common_sal_eal:
+phy_trash_a
+phx_trash_a
rts
} ; CONFIG_ARNITECH_BLADE
+6 -1
View File
@@ -3,6 +3,9 @@
;; #LAYOUT# * KERNAL_0 #TAKE
;; #LAYOUT# * * #IGNORE
; Not on a Blade, whose Terminal Card holds the screen editor (src/kernal/arnitech)
!ifndef CONFIG_ARNITECH_BLADE {
screen_restore_sal_eal:
@@ -27,4 +30,6 @@ screen_restore_sal_eal:
sta SAL+0
jmp screen_common_sal_eal
} ; CONFIG_ARNITECH_BLADE
+4
View File
@@ -63,6 +63,10 @@ udtim_keyboard:
+STUB_IMPLEMENTATION
} else ifdef CONFIG_ARNITECH_BLADE {
jmp udtim_terminal_stop
} else {
; According to [CM64], page 27, the action we have to perform is to copy