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