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

@ -1,10 +1,5 @@
#include <ram.h>
typedef struct {
u8 wram[0x2000];
u8 hram[0x80];
} ram_context;
static ram_context ctx;
u8 wram_read(u16 address) {
@ -27,4 +22,12 @@ u8 hram_read(u16 address){
void hram_write(u16 address, u8 value){
address -= 0xFF80;
ctx.hram[address] = value;
}
void ram_save_state(ram_state* state) {
state->ctx = ctx;
}
void ram_load_state(const ram_state* state) {
ctx = state->ctx;
}