function keys, RUN and HELP are now programmable at compile time
This commit is contained in:
1 parent
15362c29b4
commit
d0ac49b2b6
22 files changed
+320
-22
No files matched your search
+38
-5
@@ -91,10 +91,10 @@ read_from_keyboard:
|
||||
cmp #$0D
|
||||
bne not_enter
|
||||
|
||||
chrin_enter:
|
||||
|
||||
jsr cursor_disable
|
||||
|
||||
jsr pop_keyboard_buffer
|
||||
|
||||
jsr cursor_hide_if_visible
|
||||
|
||||
// It was enter.
|
||||
@@ -140,12 +140,45 @@ empty_line:
|
||||
|
||||
not_enter:
|
||||
|
||||
// Print character
|
||||
lda KEYD
|
||||
// XXX add support for SHIFT + RUN/STOP ($84) and function keys (should be configurable)
|
||||
jsr CHROUT
|
||||
|
||||
#if CONFIG_PROGRAMMABLE_KEYS
|
||||
|
||||
ldx #(__programmable_keys_codes_end - programmable_keys_codes - 1)
|
||||
|
||||
chrin_programmable_loop:
|
||||
|
||||
cmp programmable_keys_codes, x
|
||||
beq chrin_programmable_key
|
||||
dex
|
||||
bpl chrin_programmable_loop
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
#endif // CONFIG_PROGRAMMABLE_KEYS
|
||||
|
||||
chrin_print_character:
|
||||
|
||||
jsr CHROUT
|
||||
jsr pop_keyboard_buffer
|
||||
|
||||
// Keep looking for input from keyboard until carriage return
|
||||
jmp chrin_repeat
|
||||
|
||||
#if CONFIG_PROGRAMMABLE_KEYS
|
||||
|
||||
chrin_programmable_key:
|
||||
|
||||
// .X contains index of the key code, we need offset to key string instead
|
||||
lda programmable_keys_offsets, x
|
||||
tax
|
||||
|
||||
// Print all the characters assigned to key
|
||||
!:
|
||||
lda programmable_keys_strings, x
|
||||
beq chrin_enter
|
||||
jsr CHROUT // our implementation preserves .X too
|
||||
inx
|
||||
bne !- // jumps always
|
||||
|
||||
#endif // CONFIG_PROGRAMMABLE_KEYS
|
||||
Reference in new issue
Block a user