diff options
| author | Louis Burda <quent.burda@gmail.com> | 2023-07-26 18:38:11 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2023-07-26 18:38:11 +0200 |
| commit | 130db985e5594204897ad28d7463e7e9b5ef94c7 (patch) | |
| tree | b5c825de9374b82713b642ab423ad4e18b7fd00b /tis100-curses.c | |
| parent | d9dd10cd6a69f6da102814ebefe1d7ad2a32a020 (diff) | |
| download | tis100-130db985e5594204897ad28d7463e7e9b5ef94c7.tar.gz tis100-130db985e5594204897ad28d7463e7e9b5ef94c7.zip | |
Restrict assembly input to fit game spec
Diffstat (limited to 'tis100-curses.c')
| -rw-r--r-- | tis100-curses.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tis100-curses.c b/tis100-curses.c index 157b102..09cb74c 100644 --- a/tis100-curses.c +++ b/tis100-curses.c @@ -18,8 +18,8 @@ #define KEY_ESC 0x1b #define KEY_CTRL(c) ((c) & ~0x60) -#define TPU_INPUT_ROWS 14 -#define TPU_INPUT_COLS 20 +#define TPU_INPUT_ROWS 15 +#define TPU_INPUT_COLS 19 #define TPU_INFO_W 6 #define TPU_INFO_H 4 #define TPU_CNT 6 @@ -213,12 +213,14 @@ tui_draw_tpu(struct tpu *tpu) tui_draw_box(x, y, w, h, attr, WACS_D_TTEE, WACS_D_URCORNER, WACS_D_LTEE, WACS_D_RTEE); tui_draw_text(x + 2, y + 1, A_BOLD, "ACC"); - tui_draw_text(x + 2, y + 2, 0, "%03i", tpu->acc); + tui_draw_text(x + 1, y + 2, 0, + tpu->acc >= 0 ? " %03i" : "-%03i", tpu->acc); tui_draw_box(x, (y += TPU_INFO_H - 1), w, h, attr, WACS_D_LTEE, WACS_D_RTEE, WACS_D_LTEE, WACS_D_RTEE); tui_draw_text(x + 2, y + 1, A_BOLD, "BAK"); - tui_draw_text(x + 2, y + 2, 0, "%03i", tpu->bak); + tui_draw_text(x + 1, y + 2, 0, + tpu->bak >= 0 ? " %03i" : "-%03i", tpu->bak); tui_draw_box(x, (y += TPU_INFO_H - 1), w, h, attr, WACS_D_LTEE, WACS_D_RTEE, WACS_D_LTEE, WACS_D_RTEE); @@ -240,7 +242,7 @@ tui_draw_tpu(struct tpu *tpu) tui_draw_text(x + 2, y + 2, 0, "%s", mode_repr[tpu->status]); tui_draw_box(x, (y += TPU_INFO_H - 1), w, h, attr, - WACS_D_LTEE, WACS_D_RTEE, WACS_D_BTEE, WACS_D_LRCORNER); + WACS_D_LTEE, WACS_D_RTEE, WACS_D_BTEE, WACS_D_RTEE); tui_draw_text(x + 2, y + 1, A_BOLD, "IDL"); if (tpu->steps > 0) idle = (int) ((double) tpu->idle_steps * 100 / (double) tpu->steps); @@ -248,6 +250,9 @@ tui_draw_tpu(struct tpu *tpu) idle = 100; tui_draw_text(x + 2, y + 2, 0, "%03i", idle); + tui_draw_box(x, (y += TPU_INFO_H - 1), w, 2, attr, + WACS_D_LTEE, WACS_D_RTEE, WACS_D_BTEE, WACS_D_LRCORNER); + if (tpu->ports[DIR_LEFT].attached) { port = &tpu->ports[DIR_LEFT]; if (port->in >= 0) |
