X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=drivers%2Fgp2x%2Fgp2x.c;h=92103c0cc7c658b9051ccf8c65082fa05a268749;hp=a4834b3a1a307d07e831f3d8fe17d73c68e4b8a4;hb=7b356ee3dc5d7e54d9dc06c413f84380d1044441;hpb=15d2d2584cc71389f06b969d7cd836332add97c6 diff --git a/drivers/gp2x/gp2x.c b/drivers/gp2x/gp2x.c index a4834b3..92103c0 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; @@ -144,8 +146,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(); @@ -175,9 +177,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); @@ -189,6 +191,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; + } }