Full savestating to memory
This commit is contained in:
@ -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;
|
||||
}
|
Reference in New Issue
Block a user