3ds: 3ds port sources. First set of two

This commit adds changes to the original rockbox sources.

Note: the port files, functions, folders, etc., will be referred
to as 'ctru' to avoid using the Nintendo name elsewhere.

Change-Id: I0e2d3d4d2a75bd45ea67dc3452eb8d5487cf1f5a
This commit is contained in:
Mauricio Garrido 2025-09-29 16:06:04 -06:00 committed by Solomon Peachy
parent 511a38763b
commit a4de1195cd
25 changed files with 227 additions and 23 deletions

View file

@ -224,7 +224,7 @@ struct sound_settings_info
#elif defined(HAVE_ES9218)
#include "es9218.h"
#elif ((CONFIG_PLATFORM & (PLATFORM_ANDROID | PLATFORM_MAEMO \
| PLATFORM_PANDORA | PLATFORM_SDL )) | defined(RG_NANO))
| PLATFORM_PANDORA | PLATFORM_SDL | PLATFORM_CTRU)) | defined(RG_NANO))
#include "hosted_codec.h"
#elif defined(DX50)
#include "codec-dx50.h"

View file

@ -85,6 +85,7 @@
#define RK27XX 2700
#define X1000 1000
#define STM32H743 32743
#define N10480H 10480
/* platforms
* bit fields to allow PLATFORM_HOSTED to be OR'ed e.g. with a
@ -98,6 +99,7 @@
#define PLATFORM_MAEMO5 (1<<5)
#define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5)
#define PLATFORM_PANDORA (1<<6)
#define PLATFORM_CTRU (1<<7)
/* CONFIG_KEYPAD */
#define IRIVER_H100_PAD 4
@ -167,6 +169,7 @@
#define ECHO_R1_PAD 75
#define SURFANS_F28_PAD 76
#define RG_NANO_PAD 77
#define CTRU_PAD 78
/* CONFIG_REMOTE_KEYPAD */
#define H100_REMOTE 1
@ -623,6 +626,8 @@ Lyre prototype 1 */
#include "config/surfansf28.h"
#elif defined(RG_NANO)
#include "config/rgnano.h"
#elif defined(CTRU)
#include "config/ctru.h"
#else
#error "unknown hardware platform!"
#endif
@ -650,7 +655,7 @@ Lyre prototype 1 */
# define CONFIG_BUFLIB_BACKEND BUFLIB_BACKEND_MEMPOOL
#endif
#ifdef APPLICATION
#if defined(APPLICATION)
#ifndef CONFIG_CPU
#define CONFIG_CPU 0
#endif
@ -1033,7 +1038,8 @@ Lyre prototype 1 */
#if defined(ASSEMBLER_THREADS) \
|| defined(HAVE_WIN32_FIBER_THREADS) \
|| defined(HAVE_SIGALTSTACK_THREADS)
|| defined(HAVE_SIGALTSTACK_THREADS) \
|| defined(CTRU)
#define HAVE_PRIORITY_SCHEDULING
#endif
@ -1104,7 +1110,7 @@ Lyre prototype 1 */
* Older versions of GCC emit assembly in divided syntax with no option
* to enable unified syntax.
*/
#if (__GNUC__ < 8) && defined(CPU_ARM_CLASSIC)
#if (__GNUC__ < 8) && defined(CPU_ARM_CLASSIC) || defined(CTRU)
#define BEGIN_ARM_ASM_SYNTAX_UNIFIED ".syntax unified\n"
#define END_ARM_ASM_SYNTAX_UNIFIED ".syntax divided\n"
#else

View file

@ -35,6 +35,10 @@ extern void ldebugf(const char* file, int line, const char *fmt, ...)
|| (defined(APPLICATION) && defined(DEBUG))
#define DEBUGF debugf
#define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__)
#elif (CONFIG_PLATFORM & PLATFORM_CTRU)
/* let's use second display for debug output */
#define DEBUGF debugf
#define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__)
#elif defined(DEBUG) /* DEBUG on native targets */
#ifdef HAVE_GDB_API

View file

@ -21,8 +21,9 @@
#ifndef HOSTED_CODEC_H
#define HOSTED_CODEC_H
#if defined(HAVE_SDL_AUDIO) \
&& !(CONFIG_PLATFORM & PLATFORM_MAEMO5)
#if (defined(HAVE_SDL_AUDIO) \
&& !(CONFIG_PLATFORM & PLATFORM_MAEMO5)) \
|| (CONFIG_PLATFORM & PLATFORM_CTRU)
AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -80, 0, 0)
#else
#define AUDIOHW_CAPS (MONO_VOL_CAP)

View file

@ -41,7 +41,7 @@
/* NOTE: target-specific hosted HOME_DIR resides in filesystem-app.c */
#if !defined(APPLICATION) || defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || \
defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || \
defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX)
defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(CTRU)
#define HOME_DIR "/"
@ -87,7 +87,7 @@
#if defined(APPLICATION) && \
!(defined(SAMSUNG_YPR0) || defined(SAMSUNG_YPR1) || \
defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX))
defined(DX50) || defined(DX90) || defined(SONY_NWZ_LINUX) || defined(HIBY_LINUX) || defined(FIIO_M3K_LINUX) || defined(CTRU))
#define PLUGIN_DATA_DIR ROCKBOX_DIR "/rocks.data"
#define PLUGIN_GAMES_DATA_DIR PLUGIN_DATA_DIR