(CTR/3DS) don't turn off the LCD for 2DS models.

This commit is contained in:
aliaspider 2015-10-03 19:37:01 +01:00
parent 7798be9f6e
commit 71efe15bce
2 changed files with 8 additions and 2 deletions

View File

@ -192,6 +192,7 @@ static void frontend_ctr_deinit(void *data)
{
extern PrintConsole* currentConsole;
Handle lcd_handle;
u8 not_2DS;
(void)data;
#ifndef IS_SALAMANDER
global_t *global = global_get_ptr();
@ -206,7 +207,8 @@ static void frontend_ctr_deinit(void *data)
if(gfxBottomFramebuffers[0] == (u8*)currentConsole->frameBuffer)
wait_for_input();
if(srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
CFGU_GetModelNintendo2DS(&not_2DS);
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
{
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = 0x00110040;
@ -215,6 +217,7 @@ static void frontend_ctr_deinit(void *data)
svcCloseHandle(lcd_handle);
}
exitCfgu();
csndExit();
gfxExit();
@ -255,6 +258,7 @@ static void frontend_ctr_init(void *data)
#endif
gfxInit(GSP_BGR8_OES,GSP_RGB565_OES,false);
csndInit();
initCfgu();
gfxSet3D(false);
consoleInit(GFX_BOTTOM, NULL);
#endif

View File

@ -393,12 +393,14 @@ static bool ctr_frame(void* data, const void* frame,
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;
if(srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
CFGU_GetModelNintendo2DS(&not_2DS);
if(not_2DS && srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
{
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = ctr->lcd_buttom_on? 0x00120040: 0x00110040;