X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fmain.c;h=bdea1b5113eb4faf24033be5bfb2705563473c50;hp=426ef138a1aeeadfa4ae15922f0ac65d13d52cd2;hb=003cfc63c69b3e900de768317354dfb80bbf6a55;hpb=3aba41853f8dc014ff61e05e8a2c616d89f88715 diff --git a/frontend/main.c b/frontend/main.c index 426ef138..bdea1b51 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -8,12 +8,12 @@ #include #include #include -#include -#include -#include #include #include #include +#ifndef _WIN32 +#include +#endif #include "main.h" #include "plugin.h" @@ -141,7 +141,7 @@ void emu_set_default_config(void) spu_config.iXAPitch = 0; spu_config.iVolume = 768; spu_config.iTempo = 0; -#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX */ +#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */ spu_config.iUseReverb = 0; spu_config.iUseInterpolation = 0; spu_config.iTempo = 1; @@ -452,6 +452,10 @@ void emu_core_ask_exit(void) } #ifndef NO_FRONTEND + +#include +#include + static void create_profile_dir(const char *directory) { char path[MAXPATHLEN]; @@ -766,7 +770,7 @@ int emu_save_state(int slot) return ret; ret = SaveState(fname); -#ifndef __ARM_ARCH_7A__ /* XXX */ +#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */ sync(); #endif SysPrintf("* %s \"%s\" [%d]\n", @@ -968,7 +972,7 @@ static const int builtin_plugin_ids[] = { void *SysLoadLibrary(const char *lib) { const char *tmp = strrchr(lib, '/'); - void *ret; + void *ret = NULL; int i; SysPrintf("plugin: %s\n", lib); @@ -980,9 +984,14 @@ void *SysLoadLibrary(const char *lib) { return (void *)(long)(PLUGIN_DL_BASE + builtin_plugin_ids[i]); } +#ifndef _WIN32 ret = dlopen(lib, RTLD_NOW); if (ret == NULL) SysMessage("dlopen: %s", dlerror()); +#else + /* no external plugin support, abi is no longer + * compatible with psemu/pcsx anyway */ +#endif return ret; } @@ -992,11 +1001,19 @@ void *SysLoadSym(void *lib, const char *sym) { if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins)) return plugin_link(plugid - PLUGIN_DL_BASE, sym); +#ifndef _WIN32 return dlsym(lib, sym); +#else + return NULL; +#endif } const char *SysLibError() { +#ifndef _WIN32 return dlerror(); +#else + return "not supported"; +#endif } void SysCloseLibrary(void *lib) { @@ -1005,6 +1022,8 @@ void SysCloseLibrary(void *lib) { if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins)) return; +#ifndef _WIN32 dlclose(lib); +#endif }