X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fcommon%2Femu.c;h=5f18dd0f9ad555320e20e0c79ba8b09e98b4299f;hb=ee2a3bdfa5a969ea9446b2d08748f16e29bbd4d5;hp=542abf5c7516a56e270e6eb1f3d41e38ac271111;hpb=0d9bf4fcda2bf375a1fabd4a42e244701b8a185f;p=picodrive.git diff --git a/platform/common/emu.c b/platform/common/emu.c index 542abf5..5f18dd0 100644 --- a/platform/common/emu.c +++ b/platform/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); }