file based save states, and improved file structure
This commit is contained in:
6
lib/ui.c
6
lib/ui.c
@ -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){
|
||||
|
Reference in New Issue
Block a user