X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Fmain.c;h=144ce490a82780373f2a1d021172e86e71ab2614;hb=1f1128d05bddab7552b94a8963c050c75decc384;hp=4c84803e57a95bd4ce8f340dbd58ebf9aa6e8b13;hpb=63a4f6b6a3b0315590cd3009df2c92480ed2d98b;p=pcsx_rearmed.git diff --git a/frontend/main.c b/frontend/main.c index 4c84803e..144ce490 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -26,8 +26,17 @@ #include "../libpcsxcore/new_dynarec/new_dynarec.h" #include "../plugins/cdrcimg/cdrcimg.h" #include "../plugins/dfsound/spu_config.h" +#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" @@ -42,8 +51,8 @@ static void check_memcards(void); #endif // don't include debug.h - it breaks ARM build (R1 redefined) -void StartDebugger(); -void StopDebugger(); +static void StartDebugger() {} +static void StopDebugger() {} int ready_to_go, g_emu_want_quit, g_emu_resetting; unsigned long gpuDisp; @@ -121,7 +130,7 @@ void emu_set_default_config(void) { // try to set sane config on which most games work Config.Xa = Config.Cdda = Config.Sio = - Config.SpuIrq = Config.RCntFix = Config.VSyncWA = 0; + Config.icache_emulation = Config.SpuIrq = Config.RCntFix = Config.VSyncWA = 0; Config.PsxAuto = 1; pl_rearmed_cbs.gpu_neon.allow_interlace = 2; // auto @@ -129,6 +138,12 @@ void emu_set_default_config(void) pl_rearmed_cbs.gpu_neon.enhancement_no_main = 0; pl_rearmed_cbs.gpu_peops.iUseDither = 0; pl_rearmed_cbs.gpu_peops.dwActFixes = 1<<7; + pl_rearmed_cbs.gpu_senquack.ilace_force = 0; + pl_rearmed_cbs.gpu_senquack.pixel_skip = 0; + pl_rearmed_cbs.gpu_senquack.lighting = 1; + pl_rearmed_cbs.gpu_senquack.fast_lighting = 0; + pl_rearmed_cbs.gpu_senquack.blending = 1; + pl_rearmed_cbs.gpu_senquack.dithering = 0; pl_rearmed_cbs.gpu_unai.abe_hack = pl_rearmed_cbs.gpu_unai.no_light = pl_rearmed_cbs.gpu_unai.no_blend = 0; @@ -142,7 +157,7 @@ void emu_set_default_config(void) spu_config.iVolume = 768; spu_config.iTempo = 0; spu_config.iUseThread = 1; // no effect if only 1 core is detected -#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */ +#ifdef HAVE_PRE_ARMV7 /* XXX GPH hack */ spu_config.iUseReverb = 0; spu_config.iUseInterpolation = 0; spu_config.iTempo = 1; @@ -398,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? @@ -412,6 +445,8 @@ int emu_core_preinit(void) #endif emuLog = stdout; + log_wrong_cpu(); + SetIsoFile(NULL); memset(&Config, 0, sizeof(Config)); @@ -705,7 +740,7 @@ void SysRunGui() { printf("SysRunGui\n"); } -static void dummy_lace() +static void CALLBACK dummy_lace() { } @@ -771,7 +806,7 @@ int emu_save_state(int slot) return ret; ret = SaveState(fname); -#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */ +#ifdef HAVE_PRE_ARMV7 /* XXX GPH hack */ sync(); #endif SysPrintf("* %s \"%s\" [%d]\n", @@ -982,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 @@ -997,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); @@ -1018,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;