diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -48,6 +48,7 @@ int get_key(WINDOW *scr) { int x, y; int c; int keycode = 0; + int tmp_flag = dbg_print_per_inst; curs_set(1); if ((key == NULL) || (key && key[key_idx] == '\0') || !kbd_rdy) { c = wgetch(scr); @@ -89,12 +90,17 @@ int get_key(WINDOW *scr) { wrefresh(regs); #endif break; + case KEY_F(3): + dbg_print_per_inst = !dbg_print_per_inst; } #if debug && !bench getyx(scr, y, x); wmove(scr, getmaxy(scr)-1, 0); wclrtoeol(scr); wprintw(scr, "keycode: %i", keycode); + if (tmp_flag != dbg_print_per_inst) { + wprintw(scr, ", Disassemble per instruction %s", (dbg_print_per_inst) ? "enabled" : "disabled"); + } wmove(scr, y, x); #endif } @@ -235,10 +241,16 @@ void reset_esc() { void handle_ctrlcode(int c) { int x, y; uint16_t scr_col = 0; + int tmp_flag = 0; #if debug - if (!subdbg) { - scr_col = (addr[TX_ADDR] != 0x0C && addr[TX_ADDR] != '\n' && scr_col < 160) ? (addr[1] << 1)-2 : 0; - wmove(scr, 28, scr_col); + if (subdbg) { + tmp_flag = (addr[TX_ADDR] != 0x0C && addr[TX_ADDR] != '\n' && scr_col < 160); + if (!tmp_flag) { + wmove(scr, 30, 0); + wclrtoeol(scr); + } + scr_col = (tmp_flag) ? (addr[1] << 1)-2 : 0; + wmove(scr, 30, scr_col); } #endif getyx(scr, y, x); @@ -261,11 +273,11 @@ void handle_ctrlcode(int c) { #if !debug wdelch(scr); #else - if (!subdbg) { + if (subdbg) { scr_col++; - wmove(scr, 28, scr_col--); + wmove(scr, 30, scr_col--); wdelch(scr); - wmove(scr, 28, scr_col); + wmove(scr, 30, scr_col); wdelch(scr); } #endif @@ -283,7 +295,7 @@ void handle_ctrlcode(int c) { /*wmove(scr, y, x);*/ waddch(scr, c); #else - if (!subdbg && scr_col < 160) { + if (subdbg && scr_col < 160) { if (c != ' ') { wprintw(scr, "%02X", c); } else { |