summaryrefslogtreecommitdiff
path: root/emumon.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-08-08 10:28:36 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-08-08 10:28:36 -0400
commit1ec19679b3db209429b0897f6ccda6d09d018a70 (patch)
treeef17e28b388a04fadeb14982a5332eb647981d8b /emumon.c
parent39081609ec4f1f5d96e15e346eecd09ca2cc9f41 (diff)
Did a ton of stuff.
- Changed the file structure of the SuB Suite, so that all variable declarations, symbols, and constants are in a single file. - Moved the C library functionss into a separate file, and made them use stack frames. - Added support for using the emulator's assembler for realtime debugging, to enter it, get in to stepping mode by pressing Ctrl+s, press any other key, then press F1, The reason for having to press some other key before pressing F1 is because it only allows entering the assembler when the keyboard is not ready. - Added the ".res" directive to the emulator's assembler, the ".res" directive tells the assembler to reserve however many bytes specified by the operand. - Fixed some bugs in the emulator's assembler.
Diffstat (limited to 'emumon.c')
-rw-r--r--emumon.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/emumon.c b/emumon.c
new file mode 100644
index 0000000..a24a5c5
--- /dev/null
+++ b/emumon.c
@@ -0,0 +1,47 @@
+#include "sux.h"
+#include <assert.h>
+#include <ctype.h>
+#include <string.h>
+
+
+void init_win(WINDOW *w) {
+ init_screen();
+ box(w, 0, 0);
+ nodelay(w, 0);
+ crmode();
+ noecho();
+ nl();
+ keypad(w, 1);
+ curs_set(1);
+ werase(w);
+ scrollok(w, 1);
+ start_color();
+ use_default_colors();
+ init_pair(1, COLOR_WHITE, -1);
+ attron(COLOR_PAIR(1) | A_BOLD);
+ wmove(w, 0, 0);
+}
+
+int handle_char(int c) {
+
+}
+
+void emumon(WINDOW *w) {
+ init_win(w);
+ curs_set(0);
+ wprintw(w, "Welcome to the debug monitor for CISC 0.2.\n");
+ wprintw(w, "To get more info, type 'help'.\n");
+ int done = 0;
+ int row = 0;
+ int col = 0;
+ int insert = 1; /* Insert mode flag. */
+ while (!done) {
+ wmove(w, row, col);
+ wrefresh(w);
+ curs_set(1);
+ int c = wgetch(w);
+ curs_set(0);
+ handle_char(c);
+ }
+
+}