summaryrefslogtreecommitdiff
path: root/programs/sub-suite
diff options
context:
space:
mode:
Diffstat (limited to 'programs/sub-suite')
-rw-r--r--programs/sub-suite/declare.s5
-rw-r--r--programs/sub-suite/subeditor.s8
2 files changed, 9 insertions, 4 deletions
diff --git a/programs/sub-suite/declare.s b/programs/sub-suite/declare.s
index 36a4f15..f61b3a2 100644
--- a/programs/sub-suite/declare.s
+++ b/programs/sub-suite/declare.s
@@ -881,13 +881,13 @@ ct_rtb:
; Jump table for print_char's control codes.
ct_jtb:
- .word printc ; Everything else (print it).
.word nl ; Newline.
.word bs ; Backspace.
.word clr_scr ; Ctrl+L.
.word en_step ; Ctrl+S.
.word dis_step ; Ctrl+R.
.word esc ; Escape.
+ .word printc ; Everything else (print it).
; Jump table for parsing pre-tokens.
swtab:
@@ -932,3 +932,6 @@ dtab:
; Compare, and return table for isdelm2.
dtab2:
.byte "),.+<|>-=;\n"
+; Control code table for print_char.
+ctrl_codes:
+ .byte "\n\b\x0C\x13\x12\e"
diff --git a/programs/sub-suite/subeditor.s b/programs/sub-suite/subeditor.s
index 800d565..4723b60 100644
--- a/programs/sub-suite/subeditor.s
+++ b/programs/sub-suite/subeditor.s
@@ -403,15 +403,17 @@ print_char:
phb.q ; Preserve B.
phx.q ; Preserve X.
phe.q ; Preserve E.
+ xor s, s ; Reset S.
sta rega ; Preserve the character.
ldb #2 ; Make sure that set_ptr sets the third pointer.
lda.q buffer ; Set the third pointer to the start of the screen buffer.
jsr set_ptr ;
deb ; Set B to one.
tba ; Reset A.
-; inc step ;
- lda rega ; Get the character back.
- jsr get_ctrlidx ; Get the control code jump table index.
+ lea d, ctrl_codes; Get the pointer to the control codes table.
+ mov s, rega ; Get the character back.
+ lea f, 0 ; Set the mode of get_index to increment mode.
+ jsr get_index ; Get the control code handler index.
lea ct_jtb ; Get the pointer to the jump table.
mov.w e, (e+2*a); Get the address of the control code handler.
deb ; Reset B.