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