X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=maemo%2Fmain.c;h=f797c1221f602fc705a09abae470768e8cc65e3e;hp=267fb55fd27f7d85e012dcd50d1fa58468cc4a3a;hb=cdb31c9557f464b452ce6dc78b58b7e73cd423d8;hpb=e0c692d9417fdea51a1deebda1048d1a91f1270f;ds=sidebyside diff --git a/maemo/main.c b/maemo/main.c index 267fb55f..f797c122 100644 --- a/maemo/main.c +++ b/maemo/main.c @@ -7,17 +7,13 @@ #include #include -#include -#include -#include -#include +#include #include -#include #include "main.h" #include "plugin.h" #include "../libpcsxcore/misc.h" -#include "../plugins/cdrcimg/cdrcimg.h" +#include "../libpcsxcore/new_dynarec/new_dynarec.h" // from softgpu plugin extern int iUseDither; @@ -34,11 +30,14 @@ extern int iXAPitch; extern int iSPUIRQWait; extern int iUseTimer; +enum sched_action emu_action; +void do_emu_action(void); + static void ChangeWorkingDirectory(char *exe) { - s8 exepath[1024]; - s8* s; - sprintf(exepath, "%s", exe); + char exepath[1024]; + char *s; + snprintf(exepath, sizeof(exepath), "%s", exe); s = strrchr(exepath, '/'); if (s != NULL) { *s = '\0'; @@ -53,7 +52,6 @@ int maemo_main(int argc, char **argv) char path[MAXPATHLEN]; const char *cdfile = NULL; int loadst = 0; - void *tmp; int i; strcpy(Config.BiosDir, "/home/user/MyDocs"); @@ -175,11 +173,8 @@ int maemo_main(int argc, char **argv) // If a state has been specified, then load that if (loadst) { - char state_filename[MAXPATHLEN]; - int ret = get_state_filename(state_filename, sizeof(state_filename), loadst - 1); - if (ret == 0) - ret = LoadState(state_filename); - printf("%s state %s\n", ret ? "failed to load" : "loaded", state_filename); + int ret = emu_load_state(loadst - 1); + printf("%s state %d\n", ret ? "failed to load" : "loaded", loadst); } if (ready_to_go) @@ -190,7 +185,15 @@ int maemo_main(int argc, char **argv) return 0; } - psxCpu->Execute(); + while (1) + { + stop = 0; + emu_action = SACTION_NONE; + + psxCpu->Execute(); + if (emu_action != SACTION_NONE) + do_emu_action(); + } return 0; }