Added basic GUI, debugger and register view
diff --git a/main.c b/main.c
index 888168c..b4b05e7 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,6 @@
#include "cpu.h"
#include "dbg.h"
+#include "gui.h"
#include <bits/getopt_core.h>
#include <ctype.h>
@@ -13,7 +14,8 @@
runflag = false,
helpflag = false,
debugflag = false,
- should_read = false;
+ should_read = false,
+ guiflag = false;
int disasm_len = 0;
@@ -21,7 +23,7 @@
char c;
- while ((c = getopt(argc, argv, "Ddrhi:n:")) != -1)
+ while ((c = getopt(argc, argv, "Ddrhgi:n:")) != -1)
{
switch (c)
{
@@ -37,6 +39,10 @@
debugflag = true;
should_read = true;
break;
+ case 'g':
+ guiflag = true;
+ should_read = true;
+ break;
case 'i':
input = fopen(optarg, "r");
break;
@@ -76,7 +82,11 @@
printf("%s -h for help\n", argv[0]);
}
- if (disflag)
+ if (guiflag)
+ {
+ gui(&cpu);
+ }
+ else if (disflag)
{
disas(&cpu);
}