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

@ -2,13 +2,6 @@
#include <string.h>
#include <interrupts.h>
typedef struct {
bool button_sel;
bool dir_sel;
gamepad_state controller;
gamepad_state prev;
} gamepad_context;
static gamepad_context ctx = {0};
void gamepad_init();
@ -79,4 +72,12 @@ u8 gamepad_get_output() {
}
return output;
}
void gamepad_save_state(ctlr_state* state){
state->ctx = ctx;
}
void gamepad_load_state(const ctlr_state* state){
ctx = state->ctx;
}