Skip to content

Commit

Permalink
(3DS) Additional features
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHuu committed Sep 17, 2022
1 parent 83ce6f4 commit f2155f5
Show file tree
Hide file tree
Showing 51 changed files with 4,982 additions and 816 deletions.
9 changes: 9 additions & 0 deletions Makefile.ctr
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ OBJ += ctr/exec-3dsx/exec_cia.o \
ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.o \
ctr/exec-3dsx/mini-hb-menu/loaders/hax2.o

OBJ += ctr/ctr-bottom/ctr_bottom.o \
ctr/ctr-bottom/ctr_bottom_kbd.o \
ctr/ctr-bottom/ctr_bottom_states.o

ifeq ($(APP_BIG_TEXT_SECTION), 1)
APP_USE_SVCHAX = 1
LDFLAGS += -Wl,--defsym,__ctr_patch_services=__service_ptr
Expand All @@ -64,6 +68,11 @@ ifeq ($(GRIFFIN_BUILD), 1)
DEFINES += -DHAVE_GFX_WIDGETS
DEFINES += -DHAVE_OVERLAY
DEFINES += -DHAVE_CORE_INFO_CACHE
DEFINES += -DHAVE_NETWORKGAMEPAD
DEFINES += -DHAVE_BOTTOM_SCREEN
DEFINES += -DHAVE_CHD
DEFINES += -DHAVE_QTM
DEFINES += -DHAVE_GYRO
#DEFINES += -DHAVE_SOCKET_LEGACY
#-DHAVE_SSL -DHAVE_BUILTINMBEDTLS -DMBEDTLS_SSL_DEBUG_ALL
#ssl is currently incompatible with griffin due to use of the "static" flag on repeating functions that will conflict when included in one file
Expand Down
24 changes: 20 additions & 4 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
/* Required for 3DS display mode setting */
#if defined(_3DS)
#include "gfx/common/ctr_common.h"
#include "input/common/ctr_common.h"
#endif

/* Required for OpenDingux IPU filter + refresh
Expand Down Expand Up @@ -977,12 +978,27 @@ static const float message_bgcolor_opacity = 1.0f;
#define DEFAULT_ALLOW_ROTATE true

#ifdef _3DS
/* Enable bottom LCD (backlight) */
static const bool video_3ds_lcd_bottom = true;
static const bool video_3ds_console_bottom = false;
static const bool video_3ds_debug_bottom = false;
static const bool ctr_save_to_ram = true;
static const bool input_ctr_sensors_enabled = false;
static const bool input_ctr_sensors_cursor = false;
static const bool input_ctr_lightgun_abs = true;

/* Enable New3DS clock and L2 cache */
static const bool new3ds_speedup_enable = true;
/* Enable bottom LCD screen */
static const bool video_3ds_lcd_bottom = true;
static const bool new3ds_speedup_enable = true;

/* Sets video display mode (3D, 2D, etc.) */
static const unsigned video_3ds_display_mode = CTR_VIDEO_MODE_3D;
static const unsigned video_3ds_display_mode = CTR_VIDEO_MODE_3D;
static const unsigned ctr_bottom_display_mode = CTR_BOTTOM_MODE_CONTROL;
static const unsigned video_ctr_render_target = CTR_VIDEO_TARGET_TOP;
static const unsigned input_ctr_mouse_mode = CTR_INPUT_MOUSE_TOUCH;

static const unsigned video_ctr_dual_deadzone = 0;
static const int video_ctr_dual_offset_x = 0;
static const int video_ctr_dual_offset_y = 0;

#define DEFAULT_BOTTOM_FONT_ENABLE true
#define DEFAULT_BOTTOM_FONT_COLOR 255
Expand Down
20 changes: 16 additions & 4 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -2000,9 +2000,15 @@ static struct config_bool_setting *populate_settings_bool(
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false);

#ifdef _3DS
SETTING_BOOL("new3ds_speedup_enable", &settings->bools.new3ds_speedup_enable, true, new3ds_speedup_enable, false);
SETTING_BOOL("video_3ds_lcd_bottom", &settings->bools.video_3ds_lcd_bottom, true, video_3ds_lcd_bottom, false);
SETTING_BOOL("bottom_font_enable", &settings->bools.bottom_font_enable, true, DEFAULT_BOTTOM_FONT_ENABLE, false);
SETTING_BOOL("new3ds_speedup_enable", &settings->bools.new3ds_speedup_enable, true, new3ds_speedup_enable, false);
SETTING_BOOL("ctr_save_to_ram", &settings->bools.ctr_save_to_ram, true, ctr_save_to_ram, false);
SETTING_BOOL("video_3ds_lcd_bottom", &settings->bools.video_3ds_lcd_bottom, true, video_3ds_lcd_bottom, false);
SETTING_BOOL("video_3ds_console_bottom", &settings->bools.video_3ds_console_bottom, true, video_3ds_console_bottom, false);
SETTING_BOOL("video_3ds_debug_bottom", &settings->bools.video_3ds_debug_bottom, true, video_3ds_debug_bottom, false);
SETTING_BOOL("input_ctr_sensors_enabled", &settings->bools.input_ctr_sensors_enabled, true, input_ctr_sensors_enabled, false);
SETTING_BOOL("input_ctr_sensors_cursor", &settings->bools.input_ctr_sensors_cursor, true, input_ctr_sensors_cursor, false);
SETTING_BOOL("input_ctr_lightgun_abs", &settings->bools.input_ctr_lightgun_abs, true, input_ctr_lightgun_abs, false);
SETTING_BOOL("bottom_font_enable", &settings->bools.bottom_font_enable, true, DEFAULT_BOTTOM_FONT_ENABLE, false);
#endif

#ifdef WIIU
Expand Down Expand Up @@ -2327,7 +2333,11 @@ static struct config_uint_setting *populate_settings_uint(
SETTING_UINT("libnx_overclock", &settings->uints.libnx_overclock, true, SWITCH_DEFAULT_CPU_PROFILE, false);
#endif
#ifdef _3DS
SETTING_UINT("video_3ds_display_mode", &settings->uints.video_3ds_display_mode, true, video_3ds_display_mode, false);
SETTING_UINT("video_3ds_display_mode", &settings->uints.video_3ds_display_mode , true, video_3ds_display_mode , false);
SETTING_UINT("ctr_bottom_display_mode", &settings->uints.ctr_bottom_display_mode, true, ctr_bottom_display_mode, false);
SETTING_UINT("video_ctr_render_target", &settings->uints.video_ctr_render_target, true, video_ctr_render_target, false);
SETTING_UINT("video_ctr_dual_deadzone", &settings->uints.video_ctr_dual_deadzone, true, video_ctr_dual_deadzone, false);
SETTING_UINT("input_ctr_mouse_mode", &settings->uints.input_ctr_mouse_mode, true, input_ctr_mouse_mode, false);
#endif
#if defined(DINGUX)
SETTING_UINT("video_dingux_ipu_filter_type", &settings->uints.video_dingux_ipu_filter_type, true, DEFAULT_DINGUX_IPU_FILTER_TYPE, false);
Expand Down Expand Up @@ -2421,6 +2431,8 @@ static struct config_int_setting *populate_settings_int(
#endif
SETTING_INT("content_favorites_size", &settings->ints.content_favorites_size, true, default_content_favorites_size, false);
#ifdef _3DS
SETTING_INT("video_ctr_dual_offset_x", &settings->ints.video_ctr_dual_offset_x, true, 0, false);
SETTING_INT("video_ctr_dual_offset_y", &settings->ints.video_ctr_dual_offset_y, true, 0, false);
SETTING_INT("bottom_font_color_red", &settings->ints.bottom_font_color_red, true, DEFAULT_BOTTOM_FONT_COLOR, false);
SETTING_INT("bottom_font_color_green", &settings->ints.bottom_font_color_green, true, DEFAULT_BOTTOM_FONT_COLOR, false);
SETTING_INT("bottom_font_color_blue", &settings->ints.bottom_font_color_blue, true, DEFAULT_BOTTOM_FONT_COLOR, false);
Expand Down
15 changes: 15 additions & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ typedef struct settings
#endif
int content_favorites_size;
#ifdef _3DS
int video_ctr_dual_offset_x;
int video_ctr_dual_offset_y;
int bottom_font_color_red;
int bottom_font_color_green;
int bottom_font_color_blue;
Expand Down Expand Up @@ -228,7 +230,14 @@ typedef struct settings
unsigned video_stream_quality;
unsigned video_record_scale_factor;
unsigned video_stream_scale_factor;
#ifdef _3DS
unsigned ctr_bottom_display_mode;
unsigned video_3ds_display_mode;
unsigned video_ctr_render_target;
unsigned video_ctr_dual_deadzone;

unsigned input_ctr_mouse_mode;
#endif
unsigned video_dingux_ipu_filter_type;
unsigned video_dingux_refresh_rate;
unsigned video_dingux_rs90_softfilter_type;
Expand Down Expand Up @@ -564,7 +573,13 @@ typedef struct settings
bool video_memory_show;
bool video_msg_bgcolor_enable;
#ifdef _3DS
bool ctr_save_to_ram;
bool video_3ds_lcd_bottom;
bool video_3ds_console_bottom;
bool video_3ds_debug_bottom;
bool input_ctr_sensors_enabled;
bool input_ctr_sensors_cursor;
bool input_ctr_lightgun_abs;
#endif
bool video_wiiu_prefer_drc;
bool video_notch_write_over_enable;
Expand Down
Binary file added ctr/ctr-bottom/_assets/ctr/ctr_bottom_idle.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/ctr_bottom_mouse.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/ctr_bottom_todo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/kbd_lower.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/kbd_number.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/kbd_symbol.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/kbd_upper.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_alt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_caps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_ctrl.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_enter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_fkey.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_key.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_shift.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_space.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ctr/ctr-bottom/_assets/ctr/kbd/key_tab.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f2155f5

Please sign in to comment.