From 25e52b2c51afd3609aa2a0e218036d27520af510 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 30 Sep 2016 13:58:12 +0300 Subject: drc: fix a mistake from w^x change Fixes: d148d265 --- libpcsxcore/new_dynarec/new_dynarec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 1618b0f..cd63d2b 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -7072,7 +7072,7 @@ void new_dynarec_init() #else #ifndef NO_WRITE_EXEC // not all systems allow execute in data segment by default - if (mprotect(out, 1<='0') && (buf[cursor]<='9')) || ((buf[cursor]>='a') && (buf[cursor]<='f')) || ((buf[cursor]>='A') && (buf[cursor]<='F')) //hack to prevent retroarch freezing when reseting in the menu but not while running with the hot key @@ -1502,11 +1506,6 @@ static void update_variables(bool in_flight) } } -static int min(int a, int b) -{ - return a < b ? a : b; -} - void retro_run(void) { int i; @@ -1537,10 +1536,10 @@ void retro_run(void) if (in_type[i] == PSE_PAD_TYPE_ANALOGPAD) { - in_analog_left[i][0] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); - in_analog_left[i][1] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); - in_analog_right[i][0] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); - in_analog_right[i][1] = min((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); + in_analog_left[i][0] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); + in_analog_left[i][1] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); + in_analog_right[i][0] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 255) + 128, 255); + in_analog_right[i][1] = MIN((input_state_cb(i, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 255) + 128, 255); } } -- cgit v1.2.3 From 57e122a6f41bd235c8b6526fbc6ef1a595bf268f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 16 Apr 2017 19:58:54 +0200 Subject: (Android) Add APP_PLATFORM := android-9 to Application.mk --- jni/Application.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/jni/Application.mk b/jni/Application.mk index f05229c..3e882e7 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -1 +1,2 @@ APP_ABI := armeabi armeabi-v7a +APP_PLATFORM := android-9 -- cgit v1.2.3 From f330c38cdb00a4443caecd5e9e522cc774f4f2d3 Mon Sep 17 00:00:00 2001 From: Bryan Barnes Date: Mon, 24 Apr 2017 19:51:57 -0400 Subject: More clear HLE BIOS error message --- frontend/libretro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/libretro.c b/frontend/libretro.c index 7fd20b1..98c0dee 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1680,7 +1680,7 @@ void retro_init(void) SysPrintf("no BIOS files found.\n"); struct retro_message msg = { - "no BIOS found, expect bugs!", + "No BIOS file found - add for better compatibility", 180 }; environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, (void*)&msg); -- cgit v1.2.3 From 423963025ea0fada17796490b2a0211831baba2d Mon Sep 17 00:00:00 2001 From: Mathieu Bridon Date: Tue, 25 Apr 2017 18:47:19 +0200 Subject: Remove the git submodules The paths were removed in 76e889bcfaf9776b071627e7e8c9bff0465f539c. --- .gitmodules | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index f93599e..0000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "libpicofe"] - path = frontend/libpicofe - url = git://notaz.gp2x.de/~notaz/libpicofe.git -[submodule "warm"] - path = frontend/warm - url = git://notaz.gp2x.de/~notaz/warm.git -- cgit v1.2.3 From d2cb52e5247d52cbc2d1c6f299ee4b21a85d462b Mon Sep 17 00:00:00 2001 From: LEGOAnimal22 Date: Wed, 26 Apr 2017 16:52:47 -0600 Subject: Search for the newest version of the BIOS first --- frontend/libretro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/libretro.c b/frontend/libretro.c index 98c0dee..35e37a0 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1613,7 +1613,7 @@ static void check_system_specs(void) void retro_init(void) { - const char *bios[] = { "scph1001", "scph5501", "scph7001" }; + const char *bios[] = { "SCPH101", "SCPH7001", "SCPH5501", "SCPH1001" }; const char *dir; char path[256]; int i, ret; -- cgit v1.2.3 From 0e4ad31902f206e2c6945632bb1f558eae941ff1 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 3 May 2017 02:52:15 +0300 Subject: use pc-relative offsets for PIC too --- include/arm_features.h | 4 ++++ libpcsxcore/new_dynarec/linkage_arm.S | 12 ++++++------ plugins/dfsound/arm_utils.S | 10 +++++----- plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S | 21 ++++++--------------- 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/include/arm_features.h b/include/arm_features.h index f35e0b7..7c82ff3 100644 --- a/include/arm_features.h +++ b/include/arm_features.h @@ -73,4 +73,8 @@ #endif +#if defined(__MACH__) || defined(__PIC__) +#define TEXRELS_FORBIDDEN +#endif + #endif /* __ARM_FEATURES_H__ */ diff --git a/libpcsxcore/new_dynarec/linkage_arm.S b/libpcsxcore/new_dynarec/linkage_arm.S index 147b0df..d32dc0b 100644 --- a/libpcsxcore/new_dynarec/linkage_arm.S +++ b/libpcsxcore/new_dynarec/linkage_arm.S @@ -93,7 +93,7 @@ DRC_VAR(restore_candidate, 512) DRC_VAR(FCR0, 4) DRC_VAR(FCR31, 4) -#ifdef __MACH__ +#ifdef TEXRELS_FORBIDDEN .data .align 2 ptr_jump_in: @@ -117,21 +117,21 @@ ptr_hash_table: #endif .macro load_varadr reg var -#if defined(HAVE_ARMV7) && !defined(__PIC__) - movw \reg, #:lower16:\var - movt \reg, #:upper16:\var -#elif defined(HAVE_ARMV7) && defined(__MACH__) +#if defined(HAVE_ARMV7) && defined(TEXRELS_FORBIDDEN) movw \reg, #:lower16:(\var-(1678f+8)) movt \reg, #:upper16:(\var-(1678f+8)) 1678: add \reg, pc +#elif defined(HAVE_ARMV7) && !defined(__PIC__) + movw \reg, #:lower16:\var + movt \reg, #:upper16:\var #else ldr \reg, =\var #endif .endm .macro load_varadr_ext reg var -#if defined(HAVE_ARMV7) && defined(__MACH__) && defined(__PIC__) +#if defined(HAVE_ARMV7) && defined(TEXRELS_FORBIDDEN) movw \reg, #:lower16:(ptr_\var-(1678f+8)) movt \reg, #:upper16:(ptr_\var-(1678f+8)) 1678: diff --git a/plugins/dfsound/arm_utils.S b/plugins/dfsound/arm_utils.S index eaeca51..8ac7c30 100644 --- a/plugins/dfsound/arm_utils.S +++ b/plugins/dfsound/arm_utils.S @@ -10,7 +10,7 @@ #include "arm_features.h" -#ifdef __MACH__ +#ifdef TEXRELS_FORBIDDEN .data .align 2 ptr_ChanBuf: .word ESYM(ChanBuf) @@ -20,14 +20,14 @@ ptr_ChanBuf: .word ESYM(ChanBuf) .align 2 .macro load_varadr reg var -#if defined(HAVE_ARMV7) && !defined(__PIC__) - movw \reg, #:lower16:ESYM(\var) - movt \reg, #:upper16:ESYM(\var) -#elif defined(HAVE_ARMV7) && defined(__MACH__) +#if defined(HAVE_ARMV7) && defined(TEXRELS_FORBIDDEN) movw \reg, #:lower16:(ptr_\var-(1678f+8)) movt \reg, #:upper16:(ptr_\var-(1678f+8)) 1678: ldr \reg, [pc, \reg] +#elif defined(HAVE_ARMV7) && !defined(__PIC__) + movw \reg, #:lower16:ESYM(\var) + movt \reg, #:upper16:ESYM(\var) #else ldr \reg, =ESYM(\var) #endif diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S index 110c868..7c820d2 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S +++ b/plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S @@ -194,26 +194,18 @@ .align 4 -#ifndef __MACH__ +#include "arm_features.h" -#define function(name) \ - .global name; \ - .type name, %function; \ - name: \ +#define function(name) FUNCTION(name): + +#ifndef TEXRELS_FORBIDDEN #define JT_OP_REL(table_label, index_reg, temp) #define JT_OP(x...) x #define JTE(start, target) target -#define EXTRA_UNSAVED_REGS - #else -#define function(name) \ - .globl _##name; \ - name: \ - _##name: \ - #define JT_OP_REL(table_label, index_reg, temp) \ adr temp, table_label; \ ldr temp, [temp, index_reg, lsl #2]; \ @@ -222,13 +214,12 @@ #define JT_OP(x...) #define JTE(start, target) (target - start) -// r7 is preserved, but add it for EABI alignment.. -#define EXTRA_UNSAVED_REGS r7, r9, +#endif +#ifdef __MACH__ #define flush_render_block_buffer _flush_render_block_buffer #define setup_sprite_untextured_simple _setup_sprite_untextured_simple #define update_texture_8bpp_cache _update_texture_8bpp_cache - #endif @ r0: psx_gpu -- cgit v1.2.3 From 5c1cbedc034c59caba3955c663868c74e9631731 Mon Sep 17 00:00:00 2001 From: pjft Date: Sat, 6 May 2017 21:51:55 +0100 Subject: Adding enable/disable dithering core option with support for Neon GPU --- frontend/libretro.c | 22 ++++++++++++++++++++++ frontend/plugin_lib.h | 1 + plugins/gpu_neon/psx_gpu/psx_gpu.h | 1 + plugins/gpu_neon/psx_gpu_if.c | 14 ++++++++++++++ plugins/gpulib/gpu.c | 1 + plugins/gpulib/gpu.h | 1 + 6 files changed, 40 insertions(+) diff --git a/frontend/libretro.c b/frontend/libretro.c index c078494..3013a7f 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -456,6 +456,7 @@ void retro_set_environment(retro_environment_t cb) { "pcsx_rearmed_multitap1", "Multitap 1; auto|disabled|enabled" }, { "pcsx_rearmed_multitap2", "Multitap 2; auto|disabled|enabled" }, { "pcsx_rearmed_vibration", "Enable Vibration; enabled|disabled" }, + { "pcsx_rearmed_dithering", "Enable Dithering; enabled|disabled" }, #ifndef DRC_DISABLE { "pcsx_rearmed_drc", "Dynamic recompiler; enabled|disabled" }, #endif @@ -1376,6 +1377,27 @@ static void update_variables(bool in_flight) in_enable_vibration = 1; } + var.value = NULL; + var.key = "pcsx_rearmed_dithering"; + + if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value) + { + if (strcmp(var.value, "disabled") == 0) { + pl_rearmed_cbs.gpu_peops.iUseDither = 0; + pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 0; +#ifdef __ARM_NEON__ + pl_rearmed_cbs.gpu_neon.allow_dithering = 0; +#endif + } + else if (strcmp(var.value, "enabled") == 0) { + pl_rearmed_cbs.gpu_peops.iUseDither = 1; + pl_rearmed_cbs.gpu_peopsgl.bDrawDither = 1; +#ifdef __ARM_NEON__ + pl_rearmed_cbs.gpu_neon.allow_dithering = 1; +#endif + } + } + #ifdef __ARM_NEON__ var.value = "NULL"; var.key = "pcsx_rearmed_neon_interlace_enable"; diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h index 83b2774..92e62e9 100644 --- a/frontend/plugin_lib.h +++ b/frontend/plugin_lib.h @@ -71,6 +71,7 @@ struct rearmed_cbs { int allow_interlace; // 0 off, 1 on, 2 guess int enhancement_enable; int enhancement_no_main; + int allow_dithering; } gpu_neon; struct { int iUseDither; diff --git a/plugins/gpu_neon/psx_gpu/psx_gpu.h b/plugins/gpu_neon/psx_gpu/psx_gpu.h index 1eaa99a..1fa6b98 100644 --- a/plugins/gpu_neon/psx_gpu/psx_gpu.h +++ b/plugins/gpu_neon/psx_gpu/psx_gpu.h @@ -207,6 +207,7 @@ typedef struct u8 texture_4bpp_cache[32][256 * 256]; u8 texture_8bpp_even_cache[16][256 * 256]; u8 texture_8bpp_odd_cache[16][256 * 256]; + int use_dithering; } psx_gpu_struct; typedef struct __attribute__((aligned(16))) diff --git a/plugins/gpu_neon/psx_gpu_if.c b/plugins/gpu_neon/psx_gpu_if.c index ad01761..788e3b4 100644 --- a/plugins/gpu_neon/psx_gpu_if.c +++ b/plugins/gpu_neon/psx_gpu_if.c @@ -184,4 +184,18 @@ void renderer_set_config(const struct rearmed_cbs *cbs) map_enhancement_buffer(); if (cbs->pl_set_gpu_caps) cbs->pl_set_gpu_caps(GPU_CAP_SUPPORTS_2X); + + egpu.use_dithering = cbs->gpu_neon.allow_dithering; + if(!egpu.use_dithering) { + egpu.dither_table[0] = dither_table_row(0, 0, 0, 0); + egpu.dither_table[1] = dither_table_row(0, 0, 0, 0); + egpu.dither_table[2] = dither_table_row(0, 0, 0, 0); + egpu.dither_table[3] = dither_table_row(0, 0, 0, 0); + } else { + egpu.dither_table[0] = dither_table_row(-4, 0, -3, 1); + egpu.dither_table[1] = dither_table_row(2, -2, 3, -1); + egpu.dither_table[2] = dither_table_row(-3, 1, -4, 0); + egpu.dither_table[3] = dither_table_row(3, -1, 2, -2); + } + } diff --git a/plugins/gpulib/gpu.c b/plugins/gpulib/gpu.c index 125bd89..9fc5f43 100644 --- a/plugins/gpulib/gpu.c +++ b/plugins/gpulib/gpu.c @@ -726,6 +726,7 @@ void GPUrearmedCallbacks(const struct rearmed_cbs *cbs) gpu.state.allow_interlace = cbs->gpu_neon.allow_interlace; gpu.state.enhancement_enable = cbs->gpu_neon.enhancement_enable; + gpu.useDithering = cbs->gpu_neon.allow_dithering; gpu.mmap = cbs->mmap; gpu.munmap = cbs->munmap; diff --git a/plugins/gpulib/gpu.h b/plugins/gpulib/gpu.h index d11f991..7e1d18b 100644 --- a/plugins/gpulib/gpu.h +++ b/plugins/gpulib/gpu.h @@ -88,6 +88,7 @@ struct psx_gpu { uint32_t last_flip_frame; uint32_t pending_fill[3]; } frameskip; + int useDithering:1; /* 0 - off , 1 - on */ uint16_t *(*get_enhancement_bufer) (int *x, int *y, int *w, int *h, int *vram_h); void *(*mmap)(unsigned int size); -- cgit v1.2.3 From d019fef12f559a8cc5db4df8d975e9ab92f52582 Mon Sep 17 00:00:00 2001 From: Bryan Barnes Date: Sun, 7 May 2017 18:46:33 -0400 Subject: Update libretro.c --- frontend/libretro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/libretro.c b/frontend/libretro.c index 090e10b..4527f86 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1702,7 +1702,7 @@ void retro_init(void) SysPrintf("no BIOS files found.\n"); struct retro_message msg = { - "No BIOS file found - add for better compatibility", + "No PlayStation BIOS file found - add for better compatibility", 180 }; environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, (void*)&msg); -- cgit v1.2.3 From 9508b4c7f493564126d72e828e1d4971a69995f9 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 28 Aug 2017 22:35:18 -0400 Subject: Use dynamic base address for 3ds too Fixes #125 --- Makefile.libretro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.libretro b/Makefile.libretro index 88a48f4..e28955b 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -155,7 +155,7 @@ else ifeq ($(platform), ctr) # CFLAGS += -DPCSX # BUILTIN_GPU = unai USE_DYNAREC = 1 - DRC_CACHE_BASE = 1 + DRC_CACHE_BASE = 0 ARCH = arm HAVE_NEON = 0 -- cgit v1.2.3