From 01c8e7399cc940d2d5d0540593e16724948bd6e3 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 8 May 2021 14:58:44 -0400 Subject: 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. --- programs/sub-suite/subeditor.s | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'programs/sub-suite/subeditor.s') 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. -- cgit v1.2.3-13-gbd6f