if (PicoAHW & PAHW_MCD)\r
PicoCDBufferInit();\r
\r
- if (currentConfig.EmuOpt & EOPT_PSYNC)\r
- plat_video_wait_vsync();\r
-\r
pemu_loop_prep();\r
\r
timestamp_fps = get_ticks();\r
\r
frames_done = frames_shown = pframes_done = 0;\r
\r
+ plat_video_wait_vsync();\r
+\r
/* loop with resync every 1 sec. */\r
while (engineState == PGS_Running)\r
{\r
if (diff < diff_lim)\r
{\r
// we are too fast\r
- if (currentConfig.EmuOpt & EOPT_PSYNC) {\r
- if (diff_lim - diff > target_frametime/2)\r
- plat_wait_till_us(timestamp_base + target_frametime/4);\r
+ plat_wait_till_us(timestamp_base + diff_lim - target_frametime / 4);\r
+ if (currentConfig.EmuOpt & EOPT_VSYNC)\r
plat_video_wait_vsync();\r
- } else\r
- plat_wait_till_us(timestamp_base + diff_lim);\r
}\r
}\r
\r
#define EOPT_EN_CD_LEDS (1<<10)
#define EOPT_CONFIRM_LOAD (1<<11)
#define EOPT_A_SN_GAMMA (1<<12)
-#define EOPT_PSYNC (1<<13)
+#define EOPT_VSYNC (1<<13)
#define EOPT_GIZ_SCANLN (1<<14)
#define EOPT_GIZ_DBLBUF (1<<15)
#define EOPT_VSYNC_MODE (1<<16)
{\r
static int gp2x_old_clock = -1, EmuOpt_old = 0, pal_old = 0;\r
static int gp2x_old_gamma = 100;\r
+ gp2x_soc_t soc;\r
+\r
+ soc = soc_detect();\r
\r
if ((EmuOpt_old ^ currentConfig.EmuOpt) & EOPT_RAM_TIMINGS) {\r
if (currentConfig.EmuOpt & EOPT_RAM_TIMINGS)\r
printf(" done\n");\r
}\r
\r
- if (gp2x_old_gamma != currentConfig.gamma || (EmuOpt_old&0x1000) != (currentConfig.EmuOpt&0x1000)) {\r
- set_lcd_gamma(currentConfig.gamma, !!(currentConfig.EmuOpt&0x1000));\r
+ if (gp2x_old_gamma != currentConfig.gamma || ((EmuOpt_old ^ currentConfig.EmuOpt) & EOPT_A_SN_GAMMA)) {\r
+ set_lcd_gamma(currentConfig.gamma, !!(currentConfig.EmuOpt & EOPT_A_SN_GAMMA));\r
gp2x_old_gamma = currentConfig.gamma;\r
printf("updated gamma to %i, A_SN's curve: %i\n", currentConfig.gamma, !!(currentConfig.EmuOpt&0x1000));\r
}\r
\r
- if (((EmuOpt_old ^ currentConfig.EmuOpt) & EOPT_PSYNC) || Pico.m.pal != pal_old) {\r
- if (currentConfig.EmuOpt & EOPT_PSYNC)\r
+ if (((EmuOpt_old ^ currentConfig.EmuOpt) & EOPT_VSYNC) || Pico.m.pal != pal_old) {\r
+ if ((currentConfig.EmuOpt & EOPT_VSYNC) || soc == SOCID_POLLUX)\r
set_lcd_custom_rate(Pico.m.pal);\r
- else\r
+ else if (EmuOpt_old & EOPT_VSYNC)\r
unset_lcd_custom_rate();\r
}\r
\r
mee_onoff ("Tearing Fix", MA_OPT_TEARING_FIX, currentConfig.EmuOpt, EOPT_WIZ_TEAR_FIX), \
mee_range_cust("Gamma correction", MA_OPT2_GAMMA, currentConfig.gamma, 1, 300, mgn_aopt_gamma), \
mee_onoff ("A_SN's gamma curve", MA_OPT2_A_SN_GAMMA, currentConfig.EmuOpt, EOPT_A_SN_GAMMA), \
- mee_onoff ("Perfect vsync", MA_OPT2_VSYNC, currentConfig.EmuOpt, EOPT_PSYNC),
+ mee_onoff ("Vsync", MA_OPT2_VSYNC, currentConfig.EmuOpt, EOPT_VSYNC),
#define MENU_GP2X_OPTIONS_ADV \
mee_onoff ("Use second CPU for sound", MA_OPT_ARM940_SOUND, PicoOpt, POPT_EXT_FM), \
static int last_pal_setting = 0;
+/* misc */
+static void pollux_set_fromenv(const char *env_var)
+{
+ const char *set_string;
+ set_string = getenv(env_var);
+ if (set_string)
+ pollux_set(memregs, set_string);
+ else
+ printf("env var %s not defined.\n", env_var);
+}
+
/* video stuff */
static void pollux_video_flip(int buf_count)
{
int code = 0, bytes = 2;
int rot_cmd[2] = { 0, 0 };
unsigned int r;
+ char buff[32];
int ret;
if (bpp == prev_bpp)
memregl[0x4000>>2] |= 1 << 3;
/* the above ioctl resets LCD timings, so set them here */
- set_lcd_custom_rate(last_pal_setting);
+ snprintf(buff, sizeof(buff), "POLLUX_LCD_TIMINGS_%s", last_pal_setting ? "PAL" : "NTSC");
+ pollux_set_fromenv(buff);
switch (abs(bpp))
{
cpuclk_was_changed = 1;
}
-/* misc */
-static void pollux_set_fromenv(const char *env_var)
-{
- const char *set_string;
- set_string = getenv(env_var);
- if (set_string)
- pollux_set(memregs, set_string);
- else
- printf("env var %s not defined.\n", env_var);
-}
-
/* RAM timings */
static void set_ram_timings_(void)
{
/* LCD refresh */
static void set_lcd_custom_rate_(int is_pal)
{
- char buff[32];
-
- snprintf(buff, sizeof(buff), "POLLUX_LCD_TIMINGS_%s", is_pal ? "PAL" : "NTSC");
- pollux_set_fromenv(buff);
+ /* just remember PAL/NTSC. We always set timings in _changemode_ll() */
last_pal_setting = is_pal;
}