mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
(3DS) Add 'bottom screen' enable to User Interface menu
This commit is contained in:
parent
c190ceb9f8
commit
ca13805937
@ -478,6 +478,11 @@ static const float crt_refresh_rate = 60/1.001;
|
||||
* Used for setups where one manually rotates the monitor. */
|
||||
static const bool allow_rotate = true;
|
||||
|
||||
#ifdef _3DS
|
||||
/* Enable bottom LCD screen */
|
||||
static const bool video_3ds_lcd_bottom = true;
|
||||
#endif
|
||||
|
||||
/* AUDIO */
|
||||
|
||||
/* Will enable audio or not. */
|
||||
|
@ -1517,6 +1517,10 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
|
||||
SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false);
|
||||
|
||||
#ifdef _3DS
|
||||
SETTING_BOOL("video_3ds_lcd_bottom", &settings->bools.video_3ds_lcd_bottom, true, video_3ds_lcd_bottom, false);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
|
@ -104,6 +104,7 @@ typedef struct settings
|
||||
bool video_statistics_show;
|
||||
bool video_framecount_show;
|
||||
bool video_msg_bgcolor_enable;
|
||||
bool video_3ds_lcd_bottom;
|
||||
|
||||
/* Audio */
|
||||
bool audio_enable;
|
||||
|
@ -47,6 +47,12 @@
|
||||
#include "../../tasks/tasks_internal.h"
|
||||
#endif
|
||||
|
||||
/* An annoyance...
|
||||
* Have to keep track of bottom screen enable state
|
||||
* externally, otherwise cannot detect current state
|
||||
* when reinitialising... */
|
||||
static bool ctr_bottom_screen_enabled = true;
|
||||
|
||||
static INLINE void ctr_check_3D_slider(ctr_video_t* ctr)
|
||||
{
|
||||
float slider_val = *(float*)0x1FF81080;
|
||||
@ -263,7 +269,7 @@ static void ctr_lcd_aptHook(APT_HookType hook, void* param)
|
||||
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
cmdbuf[0] = ((hook == APTHOOK_ONSUSPEND) || ctr->lcd_buttom_on)? 0x00110040: 0x00120040;
|
||||
cmdbuf[0] = ((hook == APTHOOK_ONSUSPEND) || ctr_bottom_screen_enabled)? 0x00110040: 0x00120040;
|
||||
cmdbuf[1] = 2;
|
||||
svcSendSyncRequest(lcd_handle);
|
||||
svcCloseHandle(lcd_handle);
|
||||
@ -283,11 +289,38 @@ static bool ctr_tasks_finder(retro_task_t *task,void *userdata)
|
||||
task_finder_data_t ctr_tasks_finder_data = {ctr_tasks_finder, NULL};
|
||||
#endif
|
||||
|
||||
static void ctr_set_bottom_screen_enable(void* data, bool enabled)
|
||||
{
|
||||
Handle lcd_handle;
|
||||
u8 not_2DS;
|
||||
extern PrintConsole* currentConsole;
|
||||
ctr_video_t *ctr = (ctr_video_t*)data;
|
||||
|
||||
if (!ctr)
|
||||
return;
|
||||
|
||||
gfxBottomFramebuffers[0] = enabled ? (u8*)currentConsole->frameBuffer:
|
||||
(u8*)ctr->empty_framebuffer;
|
||||
|
||||
CFGU_GetModelNintendo2DS(¬_2DS);
|
||||
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
cmdbuf[0] = enabled? 0x00110040: 0x00120040;
|
||||
cmdbuf[1] = 2;
|
||||
svcSendSyncRequest(lcd_handle);
|
||||
svcCloseHandle(lcd_handle);
|
||||
}
|
||||
|
||||
ctr_bottom_screen_enabled = enabled;
|
||||
}
|
||||
|
||||
static void* ctr_init(const video_info_t* video,
|
||||
const input_driver_t** input, void** input_data)
|
||||
{
|
||||
float refresh_rate;
|
||||
void* ctrinput = NULL;
|
||||
settings_t *settings = config_get_ptr();
|
||||
ctr_video_t* ctr = (ctr_video_t*)linearAlloc(sizeof(ctr_video_t));
|
||||
|
||||
if (!ctr)
|
||||
@ -415,7 +448,6 @@ static void* ctr_init(const video_info_t* video,
|
||||
|
||||
if (input && input_data)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
ctrinput = input_ctr.init(settings->arrays.input_joypad_driver);
|
||||
*input = ctrinput ? &input_ctr : NULL;
|
||||
*input_data = ctrinput;
|
||||
@ -425,7 +457,7 @@ static void* ctr_init(const video_info_t* video,
|
||||
ctr->should_resize = true;
|
||||
ctr->smooth = video->smooth;
|
||||
ctr->vsync = video->vsync;
|
||||
ctr->lcd_buttom_on = true;
|
||||
ctr->lcd_buttom_on = true; /* Unused */
|
||||
ctr->current_buffer_top = 0;
|
||||
|
||||
ctr->empty_framebuffer = linearAlloc(320 * 240 * 2);
|
||||
@ -444,6 +476,11 @@ static void* ctr_init(const video_info_t* video,
|
||||
ctr->menu_texture_frame_enable = false;
|
||||
ctr->menu_texture_enable = false;
|
||||
|
||||
/* Set bottom screen enable state, if required */
|
||||
if (settings->bools.video_3ds_lcd_bottom != ctr_bottom_screen_enabled) {
|
||||
ctr_set_bottom_screen_enable(ctr, settings->bools.video_3ds_lcd_bottom);
|
||||
}
|
||||
|
||||
gspSetEventCallback(GSPGPU_EVENT_VBlank0, (ThreadFunc)ctr_vsync_hook, ctr, false);
|
||||
|
||||
return ctr;
|
||||
@ -494,24 +531,7 @@ static bool ctr_frame(void* data, const void* frame,
|
||||
hidTouchRead(&state_tmp_touch);
|
||||
if((state_tmp & KEY_TOUCH) && (state_tmp_touch.py < 120))
|
||||
{
|
||||
Handle lcd_handle;
|
||||
u8 not_2DS;
|
||||
extern PrintConsole* currentConsole;
|
||||
|
||||
gfxBottomFramebuffers[0] = ctr->lcd_buttom_on ? (u8*)ctr->empty_framebuffer:
|
||||
(u8*)currentConsole->frameBuffer;
|
||||
|
||||
CFGU_GetModelNintendo2DS(¬_2DS);
|
||||
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
cmdbuf[0] = ctr->lcd_buttom_on? 0x00120040: 0x00110040;
|
||||
cmdbuf[1] = 2;
|
||||
svcSendSyncRequest(lcd_handle);
|
||||
svcCloseHandle(lcd_handle);
|
||||
}
|
||||
|
||||
ctr->lcd_buttom_on = !ctr->lcd_buttom_on;
|
||||
ctr_set_bottom_screen_enable(ctr, !ctr_bottom_screen_enabled);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1772,6 +1772,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"裁剪过扫描部分(需重启)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"禁用桌面元素")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS底部屏幕")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"视频驱动")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1590,6 +1590,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Crop Overscan (Reload)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"禁用桌面元素")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS底部屏幕")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"視訊驅動")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1663,6 +1663,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Bildränder (Overscan) zuschneiden (Neustart erforderlich)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Deaktiviere Desktop-Gestaltung")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS-Bildschirm unten")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Videotreiber")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -3066,6 +3066,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Disable Desktop Composition"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Κάτω οθόνη 3DS"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Οδηγός Βίντεο"
|
||||
|
@ -1492,6 +1492,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Crop Overscan (Reload)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Disable Desktop Composition")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS Fundo Ekrano")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Video Driver")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -3028,6 +3028,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Desactivar composición de escritorio"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Pantalla inferior 3DS"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Controlador de video"
|
||||
|
@ -1607,6 +1607,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Tronquer l'overscan (Reload)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Désactiver le compositeur de bureau")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Écran inférieur 3DS")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Pilote vidéo")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1637,6 +1637,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Crop Overscan (Ricarica)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Disattiva composizione del Desktop")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS Bottom Screen")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Driver Video")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1811,6 +1811,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"オーバースキャンをクロップ(再起動が必要)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"デスクトップコンポジションを無効")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DSボトム画面")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"ビデオのドライバ")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1587,6 +1587,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"오버스캔 잘라내기(재시작)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"데스크탑 구성요소 사용안함")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS 하단 화면")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"비디오 드라이버")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1737,3 +1737,5 @@ MSG_HASH(MENU_ENUM_LABEL_NO_IMAGES_AVAILABLE,
|
||||
"no_images")
|
||||
MSG_HASH(MENU_ENUM_LABEL_NO_FAVORITES_AVAILABLE,
|
||||
"no_favorites")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VIDEO_3DS_LCD_BOTTOM,
|
||||
"video_3ds_lcd_bottom")
|
||||
|
@ -1502,6 +1502,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Overscan Afsnijden (Herladen Vereist)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Desktop Compositie Deactiveren")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS onderste scherm")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Video Driver")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1741,6 +1741,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Przytnij Overscan (Przeładuj)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Wyłącz kompozycję pulpitu")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Dolny ekran 3DS")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Sterownik wideo")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -3098,6 +3098,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Desativar Composição da Área de Trabalho"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Tela Inferior 3DS"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Driver de Vídeo"
|
||||
|
@ -1579,6 +1579,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Cortar sobreexploração (recarregar)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Desativar composição do ambiente de trabalho")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Tela Inferior 3DS")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Controlador de vídeo")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -1616,6 +1616,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Обрезка обрезки (перезагрузка)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Отключить компоновку рабочего стола")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Нижний экран 3DS")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Видеодрайвер")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -3098,6 +3098,10 @@ MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Disable Desktop Composition"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"3DS Bottom Screen"
|
||||
)
|
||||
MSG_HASH(
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Video Driver"
|
||||
|
@ -1605,6 +1605,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN,
|
||||
"Crop Overscan (Reload)")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION,
|
||||
"Disable Desktop Composition")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
"Màn hình dưới 3DS")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER,
|
||||
"Video Driver")
|
||||
MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER,
|
||||
|
@ -6098,6 +6098,11 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_UI_COMPANION_TOGGLE,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
#endif
|
||||
#ifdef _3DS
|
||||
menu_displaylist_parse_settings_enum(menu, info,
|
||||
MENU_ENUM_LABEL_VIDEO_3DS_LCD_BOTTOM,
|
||||
PARSE_ONLY_BOOL, false);
|
||||
#endif
|
||||
info->need_refresh = true;
|
||||
info->need_push = true;
|
||||
|
@ -8684,6 +8684,24 @@ static bool setting_append_list(
|
||||
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
|
||||
#endif
|
||||
|
||||
#ifdef _3DS
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
&settings->bools.video_3ds_lcd_bottom,
|
||||
MENU_ENUM_LABEL_VIDEO_3DS_LCD_BOTTOM,
|
||||
MENU_ENUM_LABEL_VALUE_VIDEO_3DS_LCD_BOTTOM,
|
||||
video_3ds_lcd_bottom,
|
||||
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);
|
||||
menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_REINIT_FROM_TOGGLE);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
CONFIG_BOOL(
|
||||
list, list_info,
|
||||
|
@ -874,6 +874,7 @@ enum msg_hash_enums
|
||||
MENU_LABEL(UI_COMPANION_TOGGLE),
|
||||
MENU_LABEL(DESKTOP_MENU_ENABLE),
|
||||
MENU_LABEL(UI_MENUBAR_ENABLE),
|
||||
MENU_LABEL(VIDEO_3DS_LCD_BOTTOM),
|
||||
|
||||
MENU_ENUM_LABEL_FILE_CONFIG,
|
||||
MENU_ENUM_LABEL_FILE_BROWSER_COMPRESSED_ARCHIVE,
|
||||
|
Loading…
x
Reference in New Issue
Block a user