From 580a7040ba53367c15ca682d4ea90c31fdcca45f Mon Sep 17 00:00:00 2001 From: alekseiplusplus Date: Fri, 1 Dec 2023 00:47:05 +1100 Subject: large progress approaching functionality --- src/video/ncurses.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'src/video/ncurses.c') diff --git a/src/video/ncurses.c b/src/video/ncurses.c index c3357c2..e4a7613 100644 --- a/src/video/ncurses.c +++ b/src/video/ncurses.c @@ -18,33 +18,34 @@ WINDOW *AppleWindow; byte UserInput() { int c = getch(); - byte C; + byte r; switch(c) { // Convert special characters case KEY_BACKSPACE: - C = 0xDF; + r = 0xDF; case KEY_ENTER: - C = 0x8D; + r = 0x8D; case KEY_EXIT: //TODO: Figure out if this is Esc or not. - C = 0x9B; + r = 0x9B; // Convert regular characters default: if (c < 0x20 || c >= 0x60) return -1; if (c >= 0x40) - C = c - 0x40; + r = c - 0x40; else - C = c; + r = c; break; } - SetMemory(KBD, C); + SetMemory(KBD, r); + - TerminalInput(c); + TerminalInput(r); return c; @@ -68,6 +69,15 @@ void PrintInfo() getFlag(flag_Z) ? 'Z':'.' , getFlag(flag_C) ? 'C':'.' ); + mvprintw(2, 65, "Stack"); + int count = 3; + for (int i = 0x1ff; i > 0x1cf; i--) { + if (i == (0x1ff-S)) // Indicate the stack pointer! + attron(A_REVERSE); + mvprintw(count, 65, "%x : %x", i, GetMemory(i)); + attroff(A_REVERSE); + count++; + } refresh(); } -- cgit v1.2.3