file based save states, and improved file structure

This commit is contained in:
2025-05-23 16:37:55 -06:00
parent b86d550812
commit 821c20eba8
6 changed files with 75 additions and 7 deletions

View File

@ -25,12 +25,10 @@ SDL_Renderer *sdlDebugRenderer;
SDL_Texture *sdlDebugTexture;
SDL_Surface *debugScreen;
TTF_Font *sans;
save_state *state;
static int scale = 4;
void ui_init(){
state = malloc(sizeof(*state));
SDL_Init(SDL_INIT_VIDEO);
printf("SDL INIT\n");
TTF_Init();
@ -344,13 +342,13 @@ void ui_on_key(bool down, u32 key_code) {
}
if(key_code == SDLK_s && down == true) {
emu_stop();
state_save(state);
state_save_file(0);
emu_start();
}
if(key_code == SDLK_l && down == true) {
emu_stop();
emu_reset();
state_load(state);
state_load_file(0);
emu_start();
}
switch(key_code){