diff --git a/config.def.h b/config.def.h index 579cfe4312..438798eb56 100644 --- a/config.def.h +++ b/config.def.h @@ -945,8 +945,10 @@ static const float message_bgcolor_opacity = 1.0f; #define DEFAULT_ALLOW_ROTATE true #if defined(_3DS) +/* 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 video_3ds_lcd_bottom = true; /* Sets video display mode (3D, 2D, etc.) */ static const unsigned video_3ds_display_mode = CTR_VIDEO_MODE_3D; #endif diff --git a/configuration.c b/configuration.c index 6bcae50599..b9422b2028 100644 --- a/configuration.c +++ b/configuration.c @@ -1977,6 +1977,7 @@ 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); #endif diff --git a/configuration.h b/configuration.h index 6ee240a491..519a4229bf 100644 --- a/configuration.h +++ b/configuration.h @@ -921,6 +921,9 @@ typedef struct settings bool ai_service_pause; bool gamemode_enable; +#ifdef _3DS + bool new3ds_speedup_enable; +#endif } bools; } settings_t; diff --git a/gfx/drivers/ctr_gfx.c b/gfx/drivers/ctr_gfx.c index 566e0c00d9..53cecc30ce 100644 --- a/gfx/drivers/ctr_gfx.c +++ b/gfx/drivers/ctr_gfx.c @@ -1033,6 +1033,7 @@ static void* ctr_init(const video_info_t* video, void* ctrinput = NULL; settings_t *settings = config_get_ptr(); bool lcd_bottom = settings->bools.video_3ds_lcd_bottom; + bool speedup_enable = settings->bools.new3ds_speedup_enable; ctr_video_t* ctr = (ctr_video_t*)linearAlloc(sizeof(ctr_video_t)); if (!ctr) @@ -1220,6 +1221,8 @@ static void* ctr_init(const video_info_t* video, gspSetEventCallback(GSPGPU_EVENT_VBlank0, (ThreadFunc)ctr_vsync_hook, ctr, false); + osSetSpeedupEnable(speedup_enable); + return ctr; } diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index eca517f388..eea870f293 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -4755,6 +4755,10 @@ MSG_HASH( "no_favorites" ) #if defined(_3DS) +MSG_HASH( + MENU_ENUM_LABEL_NEW3DS_SPEEDUP_ENABLE, + "new3ds_speedup_enable" + ) MSG_HASH( MENU_ENUM_LABEL_VIDEO_3DS_LCD_BOTTOM, "video_3ds_lcd_bottom" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index ce71734753..2ae08a80eb 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -13091,6 +13091,14 @@ MSG_HASH( ) #endif #if defined(_3DS) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_NEW3DS_SPEEDUP_ENABLE, + "Enable New3DS Clock / L2 Cache" + ) +MSG_HASH( + MENU_ENUM_SUBLABEL_NEW3DS_SPEEDUP_ENABLE, + "Enable New3DS clock speed (804MHz) and L2 cache." + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM, "3DS Bottom Screen" diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 93437a6e91..049b5fd11e 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -1072,6 +1072,7 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_gamemode_enable, MENU DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_brightness_control, MENU_ENUM_SUBLABEL_BRIGHTNESS_CONTROL) #if defined(_3DS) +DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_new3ds_speedup_enable, MENU_ENUM_SUBLABEL_NEW3DS_SPEEDUP_ENABLE) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_3ds_lcd_bottom, MENU_ENUM_SUBLABEL_VIDEO_3DS_LCD_BOTTOM) DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_3ds_display_mode, MENU_ENUM_SUBLABEL_VIDEO_3DS_DISPLAY_MODE) #endif @@ -4480,6 +4481,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_brightness_control); break; #if defined(_3DS) + case MENU_ENUM_LABEL_NEW3DS_SPEEDUP_ENABLE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_new3ds_speedup_enable); + break; case MENU_ENUM_LABEL_VIDEO_3DS_LCD_BOTTOM: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_3ds_lcd_bottom); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index facf9ddaad..d49f020f55 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -9097,6 +9097,17 @@ unsigned menu_displaylist_build_list( false) == 0) count++; } +#ifdef _3DS + u8 device_model = 0xFF; + CFGU_GetSystemModel(&device_model); + if ((device_model == 2) || (device_model == 4) || (device_model == 5)) + { + if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list, + MENU_ENUM_LABEL_NEW3DS_SPEEDUP_ENABLE, + PARSE_ONLY_BOOL, false) == 0) + count++; + } +#endif } break; case DISPLAYLIST_ONSCREEN_DISPLAY_SETTINGS_LIST: diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 6faad4d102..043441a9e1 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -8551,6 +8551,18 @@ static void timezone_change_handler(rarch_setting_t *setting) } #endif +#ifdef _3DS +static void new3ds_speedup_change_handler(rarch_setting_t *setting) +{ + settings_t *settings = config_get_ptr(); + + if (!setting) + return; + + osSetSpeedupEnable(*setting->value.target.boolean); +} +#endif + static bool setting_append_list_input_player_options( rarch_setting_t **list, rarch_setting_info_t *list_info, @@ -17773,6 +17785,22 @@ static bool setting_append_list( 1, true, true); } + CONFIG_BOOL( + list, list_info, + &settings->bools.new3ds_speedup_enable, + MENU_ENUM_LABEL_NEW3DS_SPEEDUP_ENABLE, + MENU_ENUM_LABEL_VALUE_NEW3DS_SPEEDUP_ENABLE, + new3ds_speedup_enable, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_CMD_APPLY_AUTO); + (*list)[list_info->index - 1].change_handler = new3ds_speedup_change_handler; + CONFIG_BOOL( list, list_info, &settings->bools.video_3ds_lcd_bottom, diff --git a/msg_hash.h b/msg_hash.h index 6072a04a40..60323efd1e 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1329,6 +1329,7 @@ enum msg_hash_enums MENU_LABEL(DESKTOP_MENU_ENABLE), MENU_LABEL(UI_MENUBAR_ENABLE), + MENU_LABEL(NEW3DS_SPEEDUP_ENABLE), MENU_LABEL(VIDEO_3DS_LCD_BOTTOM), MENU_LABEL(VIDEO_3DS_DISPLAY_MODE),