X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fgp2x%2Fgp2x.c;h=ab000454b17c46c50620121d43dcc6b10d5b1b8e;hb=642070a99a18726024c5b214263221a0340e6987;hp=58bf931da1883911566fc6d34f03d8996465bfb0;hpb=e6ee752982da44a60a9a6b5916d7642ba2dd8b9e;p=fceu.git diff --git a/drivers/gp2x/gp2x.c b/drivers/gp2x/gp2x.c index 58bf931..ab00045 100644 --- a/drivers/gp2x/gp2x.c +++ b/drivers/gp2x/gp2x.c @@ -19,6 +19,8 @@ int GP2X_PORT_REV = #include "rev.h" ; +extern uint8 PAL; + int CLImain(int argc, char *argv[]); DSETTINGS Settings; @@ -36,7 +38,8 @@ CFGSTRUCT DriverConfig[]={ AC(Settings.mmuhack), AC(Settings.ramtimings), AC(Settings.gamma), - // TODO + AC(Settings.perfect_vsync), + AC(Settings.accurate_mode), ENDCFGSTRUCT }; @@ -91,6 +94,7 @@ static void SetDefaults(void) Settings.sound_rate = 22050; Settings.turbo_rate_add = (8*2 << 24) / 60 + 1; // 8Hz turbofire Settings.gamma = 100; + Settings.sstate_confirm = 1; // default controls, RLDU SEBA Settings.KeyBinds[ 0] = 0x010; // GP2X_UP Settings.KeyBinds[ 4] = 0x020; // GP2X_DOWN @@ -102,6 +106,9 @@ static void SetDefaults(void) Settings.KeyBinds[15] = 0x200; // GP2X_Y Settings.KeyBinds[ 8] = 0x008; // GP2X_START Settings.KeyBinds[ 9] = 0x004; // GP2X_SELECT + Settings.KeyBinds[10] = 0x80000000; // GP2X_L + Settings.KeyBinds[11] = 0x40000000; // GP2X_R + Settings.KeyBinds[27] = 0xc0000000; // GP2X_PUSH } void DoDriverArgs(void) @@ -140,8 +147,8 @@ int main(int argc, char *argv[]) ret = CLImain(argc,argv); - // unscale the screen, in case this is bad. - gp2x_video_RGB_setscaling(0, 320, 240); + // unscale the screen, in case it is bad. + gp2x_video_RGB_setscaling(320, 240); if (mmuhack_status > 0) mmuunhack(); @@ -171,9 +178,9 @@ void gp2x_opt_setup(void) } } -void gp2x_cpuclock_gamma_update(void) +void gp2x_opt_update(void) { - static int prev_cpuclock = 200, prev_gamma = 100; + static int prev_cpuclock = 200, prev_gamma = 100, prev_vsync = 0, prev_pal = 0; if (Settings.cpuclock != 0 && Settings.cpuclock != prev_cpuclock) { set_FCLK(Settings.cpuclock); @@ -185,6 +192,20 @@ void gp2x_cpuclock_gamma_update(void) set_gamma(Settings.gamma); prev_gamma = Settings.gamma; } + + if (Settings.perfect_vsync != prev_vsync || (Settings.perfect_vsync && prev_pal != PAL)) + { + if (Settings.perfect_vsync) + { + set_LCD_custom_rate(PAL ? LCDR_100_02 : LCDR_120_20); + prev_pal = PAL; + } + else + { + unset_LCD_custom_rate(); + } + prev_vsync = Settings.perfect_vsync; + } }