X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Femu.c;h=4098bd25dcdd923fa1fb495057b2fd83cb16feb4;hb=e8b6193660a3227fcd113a1eb82ed48727ca8195;hp=22da55c8e895c79cf19e7e38547f8853eb305c2b;hpb=ed4402a7dfd12dbbf34c547b438a671ae8114197;p=picodrive.git diff --git a/platform/common/emu.c b/platform/common/emu.c index 22da55c..4098bd2 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -10,7 +10,7 @@ #include #include #include -#ifndef NO_SYNC +#ifdef __GP2X__ #include #endif @@ -28,22 +28,28 @@ #include #include +#ifndef _WIN32 +#define PATH_SEP "/" +#define PATH_SEP_C '/' +#else +#define PATH_SEP "\\" +#define PATH_SEP_C '\\' +#endif #define STATUS_MSG_TIMEOUT 2000 void *g_screen_ptr; -#if !SCREEN_SIZE_FIXED -int g_screen_width = SCREEN_WIDTH; -int g_screen_height = SCREEN_HEIGHT; -#endif +int g_screen_width = 320; +int g_screen_height = 240; char *PicoConfigFile = "config.cfg"; currentConfig_t currentConfig, defaultConfig; int state_slot = 0; int config_slot = 0, config_slot_current = 0; int pico_pen_x = 320/2, pico_pen_y = 240/2; -int pico_inp_mode = 0; +int pico_inp_mode; +int flip_after_sync; int engineState = PGS_Menu; static short __attribute__((aligned(4))) sndBuffer[2*44100/50]; @@ -649,7 +655,7 @@ int emu_write_config(int is_game) lprintf("emu_write_config: %s ", cfg); ret = config_write(cfg); if (write_lrom) config_writelrom(cfg); -#ifndef NO_SYNC +#ifdef __GP2X__ sync(); #endif lprintf((ret == 0) ? "(ok)\n" : "(failed)\n"); @@ -859,7 +865,7 @@ int emu_save_load_game(int load, int sram) ret = fwrite(sram_data, 1, sram_size, sramFile); ret = (ret != sram_size) ? -1 : 0; fclose(sramFile); -#ifndef NO_SYNC +#ifdef __GP2X__ sync(); #endif } @@ -870,7 +876,7 @@ int emu_save_load_game(int load, int sram) { ret = PicoState(saveFname, !load); if (!ret) { -#ifndef NO_SYNC +#ifdef __GP2X__ if (!load) sync(); #endif emu_status_msg(load ? "STATE LOADED" : "STATE SAVED"); @@ -1198,7 +1204,7 @@ void emu_finish(void) char cfg[512]; make_config_cfg(cfg); config_writelrom(cfg); -#ifndef NO_SYNC +#ifdef __GP2X__ sync(); #endif } @@ -1426,7 +1432,8 @@ void emu_loop(void) PicoFrame(); pemu_finalize_frame(fpsbuff, notice_msg); - // plat_video_flip(); + if (!flip_after_sync) + plat_video_flip(); /* frame limiter */ if (!reset_timing && !(currentConfig.EmuOpt & (EOPT_NO_FRMLIMIT|EOPT_EXT_FRMLIMIT))) @@ -1444,9 +1451,8 @@ void emu_loop(void) } } - // XXX: for some plats it might be better to flip before vsync - // (due to shadow registers in display hw) - plat_video_flip(); + if (flip_after_sync) + plat_video_flip(); pframes_done++; frames_done++; frames_shown++;