X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=common%2Femu.c;h=5f18dd0f9ad555320e20e0c79ba8b09e98b4299f;hb=fa8d133192876a802fbac43c0a0bfe4f5f85b682;hp=542abf5c7516a56e270e6eb1f3d41e38ac271111;hpb=fa5e045bdc817112c1abf19e65e2d3481d51c48a;p=libpicofe.git diff --git a/common/emu.c b/common/emu.c index 542abf5..5f18dd0 100644 --- a/common/emu.c +++ b/common/emu.c @@ -5,7 +5,6 @@ #include #include -#include // tolower #ifndef NO_SYNC #include #endif @@ -47,12 +46,13 @@ unsigned char *movie_data = NULL; static int movie_size = 0; -// utilities +/* don't use tolower() for easy old glibc binary compatibility */ static void strlwr_(char *string) { char *p; for (p = string; *p; p++) - *p = (char)tolower(*p); + if ('A' <= *p && *p <= 'Z') + *p += 'a' - 'A'; } static int try_rfn_cut(char *fname) @@ -621,17 +621,21 @@ int emu_ReadConfig(int game, int no_defaults) } } + plat_validate_config(); + // some sanity checks - if (currentConfig.CPUclock < 10 || currentConfig.CPUclock > 4096) currentConfig.CPUclock = 200; #ifdef PSP + /* TODO: mv to plat_validate_config() */ + if (currentConfig.CPUclock < 10 || currentConfig.CPUclock > 4096) currentConfig.CPUclock = 200; if (currentConfig.gamma < -4 || currentConfig.gamma > 16) currentConfig.gamma = 0; if (currentConfig.gamma2 < 0 || currentConfig.gamma2 > 2) currentConfig.gamma2 = 0; -#else - if (currentConfig.gamma < 10 || currentConfig.gamma > 300) currentConfig.gamma = 100; #endif - if (currentConfig.volume < 0 || currentConfig.volume > 99) currentConfig.volume = 50; + if (currentConfig.volume < 0 || currentConfig.volume > 99) + currentConfig.volume = 50; + + if (ret == 0) + config_slot_current = config_slot; - if (ret == 0) config_slot_current = config_slot; return (ret == 0); }