diff options
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/libretro.c | 6 | ||||
-rw-r--r-- | frontend/main.c | 32 | ||||
-rw-r--r-- | frontend/menu.c | 16 | ||||
-rw-r--r-- | frontend/pandora/pcsx.pxml.templ | 4 | ||||
-rwxr-xr-x | frontend/pandora/pcsx.sh | 3 | ||||
-rw-r--r-- | frontend/plugin.c | 47 | ||||
-rw-r--r-- | frontend/plugin_lib.c | 37 |
7 files changed, 95 insertions, 50 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c index b636f49..38514b5 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1,5 +1,5 @@ /* - * (C) notaz, 2012 + * (C) notaz, 2012,2014,2015 * * This work is licensed under the terms of the GNU GPLv2 or later. * See the COPYING file in the top-level directory. @@ -283,7 +283,7 @@ void retro_get_system_info(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); info->library_name = "PCSX-ReARMed"; - info->library_version = "r20"; + info->library_version = "r21"; info->valid_extensions = "bin|cue|img|mdf|pbp|toc|cbn|m3u"; info->need_fullpath = true; } @@ -602,7 +602,7 @@ static void extract_directory(char *buf, const char *path, size_t size) } } -#ifdef __QNX__ +#if defined(__QNX__) || defined(_WIN32) /* Blackberry QNX doesn't have strcasestr */ /* diff --git a/frontend/main.c b/frontend/main.c index 426ef13..4c84803 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -8,12 +8,12 @@ #include <stdio.h> #include <string.h> #include <stdarg.h> -#include <dlfcn.h> -#include <sys/stat.h> -#include <sys/types.h> #include <unistd.h> #include <signal.h> #include <time.h> +#ifndef _WIN32 +#include <dlfcn.h> +#endif #include "main.h" #include "plugin.h" @@ -141,7 +141,8 @@ 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 */ + spu_config.iUseThread = 1; // no effect if only 1 core is detected +#if defined(__arm__) && !defined(__ARM_ARCH_7A__) /* XXX GPH hack */ spu_config.iUseReverb = 0; spu_config.iUseInterpolation = 0; spu_config.iTempo = 1; @@ -452,6 +453,10 @@ void emu_core_ask_exit(void) } #ifndef NO_FRONTEND + +#include <sys/stat.h> +#include <sys/types.h> + static void create_profile_dir(const char *directory) { char path[MAXPATHLEN]; @@ -766,7 +771,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 +973,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 +985,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 +1002,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 +1023,8 @@ void SysCloseLibrary(void *lib) { if (PLUGIN_DL_BASE <= plugid && plugid < PLUGIN_DL_BASE + ARRAY_SIZE(builtin_plugins)) return; +#ifndef _WIN32 dlclose(lib); +#endif } diff --git a/frontend/menu.c b/frontend/menu.c index a7012e6..0088a63 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -1,5 +1,5 @@ /* - * (C) Gražvydas "notaz" Ignotas, 2010-2014 + * (C) Gražvydas "notaz" Ignotas, 2010-2015 * * This work is licensed under the terms of any of these licenses * (at your option): @@ -75,6 +75,7 @@ typedef enum MA_OPT_SAVECFG, MA_OPT_SAVECFG_GAME, MA_OPT_CPU_CLOCKS, + MA_OPT_SPU_THREAD, MA_OPT_DISP_OPTS, MA_OPT_VARSCALER, MA_OPT_VARSCALER_C, @@ -444,6 +445,7 @@ static const struct { CE_INTVAL(spu_config.iXAPitch), CE_INTVAL(spu_config.iUseInterpolation), CE_INTVAL(spu_config.iTempo), + CE_INTVAL(spu_config.iUseThread), CE_INTVAL(config_save_counter), CE_INTVAL(in_evdev_allow_abs_only), CE_INTVAL(volume_boost), @@ -1604,6 +1606,11 @@ static menu_entry e_menu_options[] = mee_onoff ("Show FPS", 0, g_opts, OPT_SHOWFPS), mee_enum ("Region", 0, region, men_region), mee_range ("CPU clock", MA_OPT_CPU_CLOCKS, cpu_clock, 20, 5000), +#ifdef C64X_DSP + mee_onoff ("Use C64x DSP for sound", MA_OPT_SPU_THREAD, spu_config.iUseThread, 1), +#else + mee_onoff ("Threaded SPU", MA_OPT_SPU_THREAD, spu_config.iUseThread, 1), +#endif mee_handler_id("[Display]", MA_OPT_DISP_OPTS, menu_loop_gfx_options), mee_handler ("[BIOS/Plugins]", menu_loop_plugin_options), mee_handler ("[Advanced]", menu_loop_adv_options), @@ -1616,10 +1623,9 @@ static menu_entry e_menu_options[] = static int menu_loop_options(int id, int keys) { static int sel = 0; - int i; - i = me_id2offset(e_menu_options, MA_OPT_CPU_CLOCKS); - e_menu_options[i].enabled = cpu_clock_st > 0 ? 1 : 0; + me_enable(e_menu_options, MA_OPT_CPU_CLOCKS, cpu_clock_st > 0); + me_enable(e_menu_options, MA_OPT_SPU_THREAD, spu_config.iThreadAvail); me_enable(e_menu_options, MA_OPT_SAVECFG_GAME, ready_to_go && CdromId[0]); me_loop(e_menu_options, &sel); @@ -1928,7 +1934,7 @@ static const char credits_text[] = "PCSX4ALL plugin by PCSX4ALL team\n" " Chui, Franxis, Unai\n\n" "integration, optimization and\n" - " frontend (C) 2010-2014 notaz\n"; + " frontend (C) 2010-2015 notaz\n"; static int reset_game(void) { diff --git a/frontend/pandora/pcsx.pxml.templ b/frontend/pandora/pcsx.pxml.templ index 7ae3c6c..f748065 100644 --- a/frontend/pandora/pcsx.pxml.templ +++ b/frontend/pandora/pcsx.pxml.templ @@ -4,7 +4,7 @@ <titles> <title lang="en_US">PCSX ReARMed</title> </titles> - <version major="1" minor="9" release="92" build="%PR%"/> + <version major="1" minor="9" release="93" build="%PR%"/> <author name="PCSX team/notaz" website="http://notaz.gp2x.de/"/> </package> <application id="pcsx_rearmed.notaz.%PR%" appdata="pcsx_rearmed"> @@ -25,7 +25,7 @@ The emulator features MIPS->ARM recompiler by Ari64 and ARM NEON GPU by Exophase <author name="PCSX team/notaz" website="http://notaz.gp2x.de/"/> - <version major="1" minor="9" release="92" build="%PR%"/> + <version major="1" minor="9" release="93" build="%PR%"/> <licenses> <license name="GPLv2+" url="http://www.gnu.org/licenses/gpl-2.0.html" sourcecodeurl="http://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git"/> diff --git a/frontend/pandora/pcsx.sh b/frontend/pandora/pcsx.sh index a69ca31..710f641 100755 --- a/frontend/pandora/pcsx.sh +++ b/frontend/pandora/pcsx.sh @@ -10,6 +10,9 @@ nub1mode=`cat /proc/pandora/nub1/mode` # no big deal if this fails, only performance loss sudo -n /usr/pandora/scripts/op_hugetlb.sh 24 +# C64x DSP for SPU +sudo -n /usr/pandora/scripts/op_dsp_c64.sh + ./pcsx "$@" # restore stuff if pcsx crashes diff --git a/frontend/plugin.c b/frontend/plugin.c index cf3d575..d9eb04a 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -15,31 +15,38 @@ #include "../libpcsxcore/system.h" #include "../plugins/cdrcimg/cdrcimg.h" +#ifndef _WIN32 +#define CALLBACK +#else +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#endif + static int dummy_func() { return 0; } /* SPU */ -extern long SPUopen(void); -extern long SPUinit(void); -extern long SPUshutdown(void); -extern long SPUclose(void); -extern void SPUplaySample(unsigned char); -extern void SPUwriteRegister(unsigned long, unsigned short, unsigned int); -extern unsigned short SPUreadRegister(unsigned long); -extern void SPUwriteDMA(unsigned short); -extern unsigned short SPUreadDMA(void); -extern void SPUwriteDMAMem(unsigned short *, int, unsigned int); -extern void SPUreadDMAMem(unsigned short *, int, unsigned int); -extern void SPUplayADPCMchannel(void *); -extern void SPUregisterCallback(void (*cb)(void)); -extern void SPUregisterScheduleCb(void (*cb)(unsigned int)); -extern long SPUconfigure(void); -extern long SPUtest(void); -extern void SPUabout(void); -extern long SPUfreeze(unsigned int, void *, unsigned int); -extern void SPUasync(unsigned int, unsigned int); -extern int SPUplayCDDAchannel(short *, int); +extern long CALLBACK SPUopen(void); +extern long CALLBACK SPUinit(void); +extern long CALLBACK SPUshutdown(void); +extern long CALLBACK SPUclose(void); +extern void CALLBACK SPUplaySample(unsigned char); +extern void CALLBACK SPUwriteRegister(unsigned long, unsigned short, unsigned int); +extern unsigned short CALLBACK SPUreadRegister(unsigned long); +extern void CALLBACK SPUwriteDMA(unsigned short); +extern unsigned short CALLBACK SPUreadDMA(void); +extern void CALLBACK SPUwriteDMAMem(unsigned short *, int, unsigned int); +extern void CALLBACK SPUreadDMAMem(unsigned short *, int, unsigned int); +extern void CALLBACK SPUplayADPCMchannel(void *); +extern void CALLBACK SPUregisterCallback(void (*cb)(void)); +extern void CALLBACK SPUregisterScheduleCb(void (*cb)(unsigned int)); +extern long CALLBACK SPUconfigure(void); +extern long CALLBACK SPUtest(void); +extern void CALLBACK SPUabout(void); +extern long CALLBACK SPUfreeze(unsigned int, void *, unsigned int); +extern void CALLBACK SPUasync(unsigned int, unsigned int); +extern int CALLBACK SPUplayCDDAchannel(short *, int); /* PAD */ static long PADreadPort1(PadDataS *pad) diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index 163d4f1..56da763 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -44,7 +44,7 @@ void *tsdev; void *pl_vout_buf; int g_layer_x, g_layer_y, g_layer_w, g_layer_h; static int pl_vout_w, pl_vout_h, pl_vout_bpp; /* output display/layer */ -static int pl_vout_scale, pl_vout_yoffset; +static int pl_vout_scale_w, pl_vout_scale_h, pl_vout_yoffset; static int psx_w, psx_h, psx_bpp; static int vsync_cnt; static int is_pal, frame_interval, frame_interval1024; @@ -230,7 +230,7 @@ static void update_layer_size(int w, int h) } // XXX: this is platform specific really -static int resolution_ok(int w, int h) +static inline int resolution_ok(int w, int h) { return w <= 1024 && h <= 512; } @@ -261,20 +261,25 @@ static void pl_vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp) vout_h = 192; } - pl_vout_scale = 1; + pl_vout_scale_w = pl_vout_scale_h = 1; #ifdef __ARM_NEON__ if (soft_filter) { if (resolution_ok(w * 2, h * 2) && bpp == 16) { - vout_w *= 2; - vout_h *= 2; - pl_vout_scale = 2; + pl_vout_scale_w = 2; + pl_vout_scale_h = 2; } else { // filter unavailable hud_msg[0] = 0; } } + else if (scanlines != 0 && scanline_level != 100 && bpp == 16) { + if (h <= 256) + pl_vout_scale_h = 2; + } #endif + vout_w *= pl_vout_scale_w; + vout_h *= pl_vout_scale_h; update_layer_size(vout_w, vout_h); @@ -316,7 +321,7 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h) } // borders - doffs = (dstride - w * pl_vout_scale) / 2 & ~1; + doffs = (dstride - w * pl_vout_scale_w) / 2 & ~1; if (doffs > doffs_old) clear_counter = 2; @@ -361,12 +366,12 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h) } } #ifdef __ARM_NEON__ - else if (soft_filter == SOFT_FILTER_SCALE2X && pl_vout_scale == 2) + else if (soft_filter == SOFT_FILTER_SCALE2X && pl_vout_scale_w == 2) { neon_scale2x_16_16(src, (void *)dest, w, stride * 2, dstride * 2, h); } - else if (soft_filter == SOFT_FILTER_EAGLE2X && pl_vout_scale == 2) + else if (soft_filter == SOFT_FILTER_EAGLE2X && pl_vout_scale_w == 2) { neon_eagle2x_16_16(src, (void *)dest, w, stride * 2, dstride * 2, h); @@ -374,11 +379,13 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h) else if (scanlines != 0 && scanline_level != 100) { int l = scanline_level * 2048 / 100; + int stride_0 = pl_vout_scale_h >= 2 ? 0 : stride; + h1 *= pl_vout_scale_h; for (; h1 >= 2; h1 -= 2) { bgr555_to_rgb565(dest, src, w * 2); - dest += dstride * 2, src += stride; + dest += dstride * 2, src += stride_0; bgr555_to_rgb565_b(dest, src, w * 2, l); dest += dstride * 2, src += stride; @@ -394,7 +401,7 @@ static void pl_vout_flip(const void *vram, int stride, int bgr24, int w, int h) } out_hud: - print_hud(w * pl_vout_scale, h * pl_vout_scale, 0); + print_hud(w * pl_vout_scale_w, h * pl_vout_scale_h, 0); out: pcnt_end(PCNT_BLIT); @@ -457,7 +464,8 @@ static int dispmode_default(void) return 1; } -int dispmode_doubleres(void) +#ifdef __ARM_NEON__ +static int dispmode_doubleres(void) { if (!(pl_rearmed_cbs.gpu_caps & GPU_CAP_SUPPORTS_2X) || !resolution_ok(psx_w * 2, psx_h * 2) || psx_bpp != 16) @@ -469,7 +477,7 @@ int dispmode_doubleres(void) return 1; } -int dispmode_scale2x(void) +static int dispmode_scale2x(void) { if (!resolution_ok(psx_w * 2, psx_h * 2) || psx_bpp != 16) return 0; @@ -480,7 +488,7 @@ int dispmode_scale2x(void) return 1; } -int dispmode_eagle2x(void) +static int dispmode_eagle2x(void) { if (!resolution_ok(psx_w * 2, psx_h * 2) || psx_bpp != 16) return 0; @@ -490,6 +498,7 @@ int dispmode_eagle2x(void) snprintf(hud_msg, sizeof(hud_msg), "eagle2x"); return 1; } +#endif static int (*dispmode_switchers[])(void) = { dispmode_default, |