aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index b8bbe93..244b715 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,19 +1,36 @@
#include <cpu.h>
#include <mem.h>
#include <log.h>
+#include <gui.h>
+
+static struct cpu_interface cpu = {
+ .reg_names = gui_reg_names,
+ .reg_update = gui_reg_update,
+ .instr_done = gui_instr_done,
+};
+
+static struct gui_interface gui = {
+ .step_next = cpu_next,
+ .step_prev = cpu_prev,
+};
int main(int argc, char *argv[])
{
- (void)argc;
- (void)argv;
-
if (argc != 2) {
logln("invalid arguments");
return 1;
}
+ cpu_register_interface(&cpu);
cpu_exec(argv[1]);
- mem_free_all();
+ /* while (cpu_next() == OK) */
+ /* ; */
+
+ gui_register_interface(&gui);
+ gui_init();
+
+ cpu_destroy();
+ mem_destroy();
return 0;
}