X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Fmain.c;h=3440e3886cf64ec312e5951e771d0a942c8e194f;hb=d5aeda23720ba9374312f8d387f299024fedb7e6;hp=671068d3df93a247d5a5499707212fc469d9096f;hpb=029e681c394691e626aab685eacad0610b6048ad;p=pcsx_rearmed.git diff --git a/frontend/main.c b/frontend/main.c index 671068d3..3440e388 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -29,6 +29,14 @@ #include "arm_features.h" #include "revision.h" +#if defined(__has_builtin) +#define DO_CPU_CHECKS __has_builtin(__builtin_cpu_init) +#elif defined(__x86_64__) || defined(__i386__) +#define DO_CPU_CHECKS 1 +#else +#define DO_CPU_CHECKS 0 +#endif + #ifndef NO_FRONTEND #include "libpicofe/input.h" #include "libpicofe/plat.h" @@ -121,9 +129,10 @@ static void set_default_paths(void) void emu_set_default_config(void) { // try to set sane config on which most games work - Config.Xa = Config.Cdda = Config.Sio = - Config.icache_emulation = Config.SpuIrq = Config.RCntFix = Config.VSyncWA = 0; + Config.Xa = Config.Cdda = 0; + Config.icache_emulation = 0; Config.PsxAuto = 1; + Config.cycle_multiplier = CYCLE_MULT_DEFAULT; pl_rearmed_cbs.gpu_neon.allow_interlace = 2; // auto pl_rearmed_cbs.gpu_neon.enhancement_enable = @@ -155,7 +164,6 @@ void emu_set_default_config(void) spu_config.iTempo = 1; #endif new_dynarec_hacks = 0; - cycle_multiplier = 200; in_type1 = PSE_PAD_TYPE_STANDARD; in_type2 = PSE_PAD_TYPE_STANDARD; @@ -405,6 +413,24 @@ void emu_on_new_cd(int show_hud_msg) } } +static void log_wrong_cpu(void) +{ +#if DO_CPU_CHECKS + __builtin_cpu_init(); + #define CHECK_CPU(name) if (!__builtin_cpu_supports(name)) \ + SysPrintf("ERROR: compiled for " name ", which is unsupported by the CPU\n") +#ifdef __SSE2__ + CHECK_CPU("sse2"); +#endif +#ifdef __SSSE3__ + CHECK_CPU("ssse3"); +#endif +#ifdef __SSE4_1__ + CHECK_CPU("sse4.1"); +#endif +#endif // DO_CPU_CHECKS +} + int emu_core_preinit(void) { // what is the name of the config file? @@ -419,6 +445,8 @@ int emu_core_preinit(void) #endif emuLog = stdout; + log_wrong_cpu(); + SetIsoFile(NULL); memset(&Config, 0, sizeof(Config)); @@ -989,7 +1017,7 @@ void *SysLoadLibrary(const char *lib) { tmp++; for (i = 0; i < ARRAY_SIZE(builtin_plugins); i++) if (strcmp(tmp, builtin_plugins[i]) == 0) - return (void *)(long)(PLUGIN_DL_BASE + builtin_plugin_ids[i]); + return (void *)(uintptr_t)(PLUGIN_DL_BASE + builtin_plugin_ids[i]); } #ifndef _WIN32 @@ -1004,7 +1032,7 @@ void *SysLoadLibrary(const char *lib) { } void *SysLoadSym(void *lib, const char *sym) { - unsigned int plugid = (unsigned int)(long)lib; + unsigned int plugid = (unsigned int)(uintptr_t)lib; if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins)) return plugin_link(plugid - PLUGIN_DL_BASE, sym); @@ -1025,7 +1053,7 @@ const char *SysLibError() { } void SysCloseLibrary(void *lib) { - unsigned int plugid = (unsigned int)(long)lib; + unsigned int plugid = (unsigned int)(uintptr_t)lib; if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins)) return;