Full savestating to memory

This commit is contained in:
2025-05-23 15:49:26 -06:00
parent e9d5b359d0
commit b86d550812
23 changed files with 378 additions and 56 deletions

View File

@ -5,6 +5,7 @@
#include <interrupts.h>
#include <dbg.h>
#include <timer.h>
#include <memory.h>
cpu_context ctx = {0};
#define CPU_DEBUG 0
@ -123,4 +124,12 @@ void cpu_request_interrupt(interrupt_type t) {
cpu_context *cpu_get_context() {
return &ctx;
}
void cpu_save_state(cpu_state* state) {
state->ctx = ctx;
}
void cpu_load_state(const cpu_state* state) {
ctx = state->ctx;
}