From e9618dd6a0aa40d2cdff823c4f1420261e2bd791 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Tue, 4 Oct 2016 19:40:36 +0100 Subject: [PATCH 1/3] (3DS) opendir with an empty string isn't returning NULL as it should. --- libretro-common/file/retro_dirent.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index 86f24cb9e4..54c77b6a24 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -44,6 +44,9 @@ struct RDIR *retro_opendir(const char *name) rdir->directory = FindFirstFile(path_buf, &rdir->entry); #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); +#elif defined(_3DS) + rdir->directory = (name && *name)? opendir(name) : NULL; + rdir->entry = NULL; #elif defined(__CELLOS_LV2__) rdir->error = cellFsOpendir(name, &rdir->directory); #else From ad3ca8d04f6957ba94c3786d57b64a1d6b948ce5 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Tue, 4 Oct 2016 19:42:25 +0100 Subject: [PATCH 2/3] (3DS) explicitly disable libretro_db and zarch in the non-griffin build --- Makefile.ctr | 4 ++++ ctr/ctr_debug.h | 1 + 2 files changed, 5 insertions(+) diff --git a/Makefile.ctr b/Makefile.ctr index c6511d8282..0be7768b7e 100644 --- a/Makefile.ctr +++ b/Makefile.ctr @@ -56,6 +56,10 @@ else HAVE_ZLIB = 1 HAVE_7ZIP = 1 HAVE_BUILTINZLIB = 1 + HAVE_LIBRETRODB = 0 + HAVE_ZARCH = 0 + HAVE_MATERIALUI = 1 + HAVE_XMB = 1 include Makefile.common BLACKLIST := diff --git a/ctr/ctr_debug.h b/ctr/ctr_debug.h index f852e563af..27d0d6c045 100644 --- a/ctr/ctr_debug.h +++ b/ctr/ctr_debug.h @@ -2,6 +2,7 @@ #define _CTR_DEBUG_H__ #include +#include <3ds/types.h> #ifdef __cplusplus extern "C" { From d87adcd2262ebca6b43afe32e8277c249158af32 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Tue, 4 Oct 2016 20:38:00 +0100 Subject: [PATCH 3/3] (3DS) fix texture combiner stages in 32bit mode. --- gfx/drivers/ctr_gfx.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index d9e6cfe5a7..681c568b73 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -631,29 +631,29 @@ static bool ctr_frame(void* data, const void* frame, ctr_check_3D_slider(ctr); - /* ARGB --> RGBA */ +// /* ARGB --> RGBA */ if (ctr->rgb32) { GPU_SetTexEnv(0, GPU_TEVSOURCES(GPU_TEXTURE0, GPU_CONSTANT, 0), - GPU_TEVSOURCES(GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR, 0), + GPU_CONSTANT, GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_G, 0, 0), - GPU_TEVOPERANDS(0, 0, 0), - GPU_MODULATE, GPU_MODULATE, - 0x0000FF); + 0, + GPU_MODULATE, GPU_REPLACE, + 0xFF0000FF); GPU_SetTexEnv(1, GPU_TEVSOURCES(GPU_TEXTURE0, GPU_CONSTANT, GPU_PREVIOUS), - GPU_TEVSOURCES(GPU_PREVIOUS, GPU_PREVIOUS, 0), + GPU_PREVIOUS, GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_B, 0, 0), - GPU_TEVOPERANDS(0, 0, 0), - GPU_MULTIPLY_ADD, GPU_MODULATE, + 0, + GPU_MULTIPLY_ADD, GPU_REPLACE, 0x00FF00); GPU_SetTexEnv(2, GPU_TEVSOURCES(GPU_TEXTURE0, GPU_CONSTANT, GPU_PREVIOUS), - GPU_TEVSOURCES(GPU_PREVIOUS, GPU_PREVIOUS, 0), + GPU_PREVIOUS, GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_ALPHA, 0, 0), - GPU_TEVOPERANDS(0, 0, 0), - GPU_MULTIPLY_ADD, GPU_MODULATE, + 0, + GPU_MULTIPLY_ADD, GPU_REPLACE, 0xFF0000); }