screen editor now supports tabulators
This commit is contained in:
1 parent
01024278f4
commit
bdcebb554f
11 files changed
+84
-19
No files matched your search
@@ -175,7 +175,13 @@ Needs 25 bytes more space in KERNAL segment for the code. In addition, each conf
|
||||
|
||||
If enabled, STOP key terminates insert/quote mode (like on BlackBox cartridge).
|
||||
|
||||
Feature needs 10 bytes in KERNAL segment. If unsure - enable.
|
||||
Feature needs 12 bytes in KERNAL segment. If unsure - enable.
|
||||
|
||||
### `CONFIG_EDIT_TABULATORS`
|
||||
|
||||
If enabled, allows use of TAB (or CTRL+>) and SHIFT+TAB (or CTRL+<) to switch between predefined tabulator positions.
|
||||
|
||||
Feature needs 35-45 bytes in KERNAL segment. If unsure - enable.
|
||||
|
||||
## Software features
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
// Screen editor
|
||||
|
||||
#define CONFIG_EDIT_STOPQUOTE
|
||||
#define CONFIG_EDIT_TABULATORS
|
||||
|
||||
|
||||
// Software features
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
// Screen editor
|
||||
|
||||
#define CONFIG_EDIT_STOPQUOTE
|
||||
#define CONFIG_EDIT_TABULATORS
|
||||
|
||||
|
||||
// Software features
|
||||
|
||||
@@ -100,6 +100,7 @@
|
||||
// Screen editor
|
||||
|
||||
#define CONFIG_EDIT_STOPQUOTE
|
||||
#define CONFIG_EDIT_TABULATORS
|
||||
|
||||
|
||||
// Software features
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
// Screen editor
|
||||
|
||||
#define CONFIG_EDIT_STOPQUOTE
|
||||
#define CONFIG_EDIT_TABULATORS
|
||||
|
||||
|
||||
// Software features
|
||||
|
||||
@@ -27,23 +27,22 @@
|
||||
|
||||
// Note - the following PETSCII codes are currently unassigned, can be used for further extensions:
|
||||
//
|
||||
// $01, $04, $06, $0A, $0B, $0C, $0F, $18, $82
|
||||
// $01, $02, $04, $06, $0A, $0B, $0C, $0F, $18, $82
|
||||
|
||||
|
||||
.const KEY_NA = $00 // to indicate that no key is presed
|
||||
|
||||
|
||||
// PETSCII codes for our extended screen editor XXX implement these
|
||||
// PETSCII codes for our extended screen editor
|
||||
|
||||
.const KEY_BOTTOM = $02 // CTRL+B - Open ROMs unofficial, DolphinDOS compatible
|
||||
.const KEY_TAB_FW = $8F // CTRL+>, TAB - Open ROMs unofficial, original TAB conflicts with C64 PETSCII
|
||||
.const KEY_TAB_BW = $80 // CTRL+<, SHIFT+TAB - Open ROMs unofficial, original TAB conflicts with C64 PETSCII
|
||||
|
||||
|
||||
// PETSCII codes for certain C128 and C65 functionalities XXX implement these
|
||||
// PETSCII codes for certain C128 and C65 functionalities
|
||||
|
||||
#if CONFIG_KEYBOARD_C128 || CONFIG_KEYBOARD_C65
|
||||
.const KEY_BELL = $07 // no key, originally CTRL+G
|
||||
.const KEY_BELL = $07 // no key, originally CTRL+G // XXX implement BELL
|
||||
.const KEY_ESC = $1B
|
||||
#endif
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ __kb_matrix_ctrl:
|
||||
.byte $9C,$12,$04,$1E,$03,$06,$14,$18
|
||||
.byte $1F,$19,$07,$9E,$02,$08,$15,$16
|
||||
.byte $12,$09,$0A,$92,$0D,$0B,$0F,$0E
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.byte $00,$10,$0C,$00,KEY_TAB_FW,$1B,$00,KEY_TAB_BW
|
||||
#else
|
||||
.byte $00,$10,$0C,$00,$00,$1B,$00,$00
|
||||
#endif
|
||||
.byte $1C,$00,$1D,$00,$00,$1F,$1E,$00
|
||||
.byte $90,$06,$00,$05,$00,$00,$11,$00
|
||||
@@ -337,18 +337,6 @@ scnkey_output_65_no_shift:
|
||||
!:
|
||||
lda (KEYTAB), y // retrieve key code from standard matrix
|
||||
|
||||
// XXX this will be needed for extended screen editor and C128 keyboard
|
||||
|
||||
// cmp KEY_TAB_FW // special handling for SHIFT+TAB
|
||||
// bne scnkey_got_petscii // XXX or to scnkey_handle_caps_lock
|
||||
// lda SHFLAG // special handling for SHIFT+TAB
|
||||
// and #KEY_FLAG_SHIFT
|
||||
// bne !+
|
||||
// lda KEY_TAB_FW
|
||||
// bne scnkey_got_petscii // branch alWAYS
|
||||
// !:
|
||||
// lda KEY_TAB_BW // bne scnkey_got_petscii if CAPS LOCK is handled
|
||||
|
||||
#endif // CONFIG_KEYBOARD_C128 or CONFIG_KEYBOARD_C65
|
||||
|
||||
#if CONFIG_KEYBOARD_C128_CAPS_LOCK || CONFIG_KEYBOARD_C65_CAPS_LOCK
|
||||
@@ -391,6 +379,22 @@ scnkey_handle_caps_lock:
|
||||
|
||||
scnkey_got_petscii:
|
||||
|
||||
#if CONFIG_KEYBOARD_C128 && CONFIG_EDIT_TABULATORS
|
||||
|
||||
// Special handling for SHIFT+TAB; it is easier than creating new matrix
|
||||
|
||||
tax
|
||||
cmp #KEY_TAB_FW
|
||||
bne !+
|
||||
lda SHFLAG
|
||||
and #KEY_FLAG_SHIFT
|
||||
beq !+
|
||||
ldx #KEY_TAB_BW
|
||||
!:
|
||||
txa
|
||||
|
||||
#endif // CONFIG_KEYBOARD_C128 and CONFIG_EDIT_TABULATORS
|
||||
|
||||
beq scnkey_no_keys // branch if we have no PETSCII code for this key
|
||||
ldy NDX
|
||||
sta KEYD, y
|
||||
|
||||
@@ -12,6 +12,7 @@ chrout_screen_CRSR_UP:
|
||||
sta PNTR
|
||||
jmp chrout_screen_calc_lptr_done
|
||||
|
||||
|
||||
chrout_screen_CRSR_DOWN:
|
||||
|
||||
lda PNTR
|
||||
@@ -25,15 +26,17 @@ chrout_screen_CRSR_DOWN:
|
||||
jsr screen_scroll_up_if_on_last_line
|
||||
jmp chrout_screen_calc_lptr_done
|
||||
|
||||
|
||||
chrout_screen_CRSR_LEFT:
|
||||
|
||||
lda TBLX
|
||||
ora PNTR
|
||||
beq !+ // recalculating pointer is not really necessary, but this is a very rare case nevertheless
|
||||
beq !+ // top-left corner, recalculating pointer is not necessary, but this is a very rare case nevertheless
|
||||
dec PNTR
|
||||
!:
|
||||
jmp chrout_screen_calc_lptr_done
|
||||
|
||||
|
||||
chrout_screen_CRSR_RIGHT:
|
||||
|
||||
inc PNTR
|
||||
|
||||
@@ -24,6 +24,10 @@ __chrout_screen_jumptable_quote_guard:
|
||||
|
||||
#if CONFIG_EDIT_STOPQUOTE
|
||||
.byte KEY_STOP
|
||||
#endif
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.byte KEY_TAB_BW
|
||||
.byte KEY_TAB_FW
|
||||
#endif
|
||||
.byte KEY_INS
|
||||
.byte KEY_DEL
|
||||
@@ -48,6 +52,10 @@ chrout_screen_jumptable_lo:
|
||||
.byte <(chrout_screen_CRSR_UP - 1)
|
||||
#if CONFIG_EDIT_STOPQUOTE
|
||||
.byte <(chrout_screen_STOP - 1)
|
||||
#endif
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.byte <(chrout_screen_TAB_BW - 1)
|
||||
.byte <(chrout_screen_TAB_FW - 1)
|
||||
#endif
|
||||
.byte <(chrout_screen_INS - 1)
|
||||
.byte <(chrout_screen_DEL - 1)
|
||||
@@ -69,6 +77,10 @@ chrout_screen_jumptable_hi:
|
||||
.byte >(chrout_screen_CRSR_UP - 1)
|
||||
#if CONFIG_EDIT_STOPQUOTE
|
||||
.byte >(chrout_screen_STOP - 1)
|
||||
#endif
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
.byte >(chrout_screen_TAB_BW - 1)
|
||||
.byte >(chrout_screen_TAB_FW - 1)
|
||||
#endif
|
||||
.byte >(chrout_screen_INS - 1)
|
||||
.byte >(chrout_screen_DEL - 1)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
//
|
||||
// Tabulation keys handling within CHROUT
|
||||
//
|
||||
|
||||
|
||||
#if CONFIG_EDIT_TABULATORS
|
||||
|
||||
|
||||
chrout_screen_TAB_FW:
|
||||
|
||||
lda PNTR
|
||||
ora #%00000111
|
||||
sta PNTR
|
||||
inc PNTR
|
||||
jmp chrout_screen_calc_lptr_done
|
||||
|
||||
|
||||
chrout_screen_TAB_BW:
|
||||
|
||||
lda TBLX
|
||||
ora PNTR
|
||||
beq !+ // top-left corner, recalculating pointer is not necessary, but this is a very rare case nevertheless
|
||||
|
||||
dec PNTR
|
||||
lda PNTR
|
||||
and #%11111000
|
||||
sta PNTR
|
||||
!:
|
||||
jmp chrout_screen_calc_lptr_done
|
||||
|
||||
|
||||
#endif // CONFIG_EDIT_TABULATORS
|
||||
Reference in new issue
Block a user