Finished CPU instructions and created ui window.

This commit is contained in:
2025-01-31 14:39:38 -07:00
parent 83c5a7cbe6
commit 9a6dc67c3e
12 changed files with 265 additions and 33 deletions

View File

@ -2,6 +2,7 @@
#include <bus.h>
#include <common.h>
#include <emu.h>
#include <interrupts.h>
cpu_context ctx = {0};
@ -44,6 +45,22 @@ bool cpu_step() {
exit(-7);
}
execute();
} else {
//is halted
emu_cycles(1);
if(ctx.int_flags) {
ctx.halted = false;
}
}
if(ctx.int_master_enabled) {
cpu_handle_interrupts(&ctx);
ctx.enabling_ime = false;
}
if(ctx.enabling_ime) {
ctx.int_master_enabled = true;
}
return true;