summaryrefslogtreecommitdiff
path: root/programs/sub-suite/subeditor.s
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-05-08 14:58:44 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-05-08 14:58:44 -0400
commit01c8e7399cc940d2d5d0540593e16724948bd6e3 (patch)
treef5d5fd71ecea70ab9276d9005896980105e5c53d /programs/sub-suite/subeditor.s
parentd284bfb53d27831c1bfa1b39a265eab748217cea (diff)
Replace get_ctrlidx with get_index in print_char.
This helps reduce code duplication, and makes it easier to both read, and add new handlers.
Diffstat (limited to 'programs/sub-suite/subeditor.s')
-rw-r--r--programs/sub-suite/subeditor.s8
1 files changed, 5 insertions, 3 deletions
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.