Finished CPU instructions and created ui window.
This commit is contained in:
17
lib/cpu.c
17
lib/cpu.c
@ -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;
|
||||
|
Reference in New Issue
Block a user