mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
Merge pull request #2194 from aliaspider/master
(CTR/3DS) shut down the LCD backlight when toggling the buttom display
This commit is contained in:
commit
98d76aeae9
@ -186,6 +186,7 @@ AccessControlInfo:
|
|||||||
- frd:u
|
- frd:u
|
||||||
- fs:USER
|
- fs:USER
|
||||||
- gsp::Gpu
|
- gsp::Gpu
|
||||||
|
- gsp::Lcd
|
||||||
- hid:USER
|
- hid:USER
|
||||||
- http:C
|
- http:C
|
||||||
- mic:u
|
- mic:u
|
||||||
|
@ -182,6 +182,8 @@ static void frontend_ctr_get_environment_settings(int *argc, char *argv[],
|
|||||||
|
|
||||||
static void frontend_ctr_deinit(void *data)
|
static void frontend_ctr_deinit(void *data)
|
||||||
{
|
{
|
||||||
|
extern PrintConsole* currentConsole;
|
||||||
|
Handle lcd_handle;
|
||||||
(void)data;
|
(void)data;
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
@ -193,8 +195,18 @@ static void frontend_ctr_deinit(void *data)
|
|||||||
global->log_file = NULL;
|
global->log_file = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if(gfxBottomFramebuffers[0] == (u8*)currentConsole->frameBuffer)
|
||||||
wait_for_input();
|
wait_for_input();
|
||||||
|
|
||||||
|
if(srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||||
|
{
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
cmdbuf[0] = 0x00110040;
|
||||||
|
cmdbuf[1] = 2;
|
||||||
|
svcSendSyncRequest(lcd_handle);
|
||||||
|
svcCloseHandle(lcd_handle);
|
||||||
|
}
|
||||||
|
|
||||||
csndExit();
|
csndExit();
|
||||||
gfxExit();
|
gfxExit();
|
||||||
|
|
||||||
|
@ -85,6 +85,7 @@ typedef struct ctr_video
|
|||||||
unsigned rotation;
|
unsigned rotation;
|
||||||
bool keep_aspect;
|
bool keep_aspect;
|
||||||
bool should_resize;
|
bool should_resize;
|
||||||
|
bool lcd_buttom_on;
|
||||||
|
|
||||||
void* empty_framebuffer;
|
void* empty_framebuffer;
|
||||||
} ctr_video_t;
|
} ctr_video_t;
|
||||||
@ -341,6 +342,7 @@ static void* ctr_init(const video_info_t* video,
|
|||||||
ctr->keep_aspect = true;
|
ctr->keep_aspect = true;
|
||||||
ctr->should_resize = true;
|
ctr->should_resize = true;
|
||||||
ctr->smooth = true;
|
ctr->smooth = true;
|
||||||
|
ctr->lcd_buttom_on = true;
|
||||||
|
|
||||||
ctr->empty_framebuffer = linearAlloc(320 * 240 * 2);
|
ctr->empty_framebuffer = linearAlloc(320 * 240 * 2);
|
||||||
memset(ctr->empty_framebuffer, 0, 320 * 240 * 2);
|
memset(ctr->empty_framebuffer, 0, 320 * 240 * 2);
|
||||||
@ -390,11 +392,23 @@ static bool ctr_frame(void* data, const void* frame,
|
|||||||
hidTouchRead(&state_tmp_touch);
|
hidTouchRead(&state_tmp_touch);
|
||||||
if((state_tmp & KEY_TOUCH) && (state_tmp_touch.py < 120))
|
if((state_tmp & KEY_TOUCH) && (state_tmp_touch.py < 120))
|
||||||
{
|
{
|
||||||
|
Handle lcd_handle;
|
||||||
extern PrintConsole* currentConsole;
|
extern PrintConsole* currentConsole;
|
||||||
if ((u8*)currentConsole->frameBuffer == gfxBottomFramebuffers[0])
|
|
||||||
gfxBottomFramebuffers[0] = (u8*)ctr->empty_framebuffer;
|
gfxBottomFramebuffers[0] = ctr->lcd_buttom_on ? (u8*)ctr->empty_framebuffer:
|
||||||
else
|
(u8*)currentConsole->frameBuffer;
|
||||||
gfxBottomFramebuffers[0] = (u8*)currentConsole->frameBuffer;
|
|
||||||
|
if(srvGetServiceHandle(&lcd_handle, "gsp::Lcd") >= 0)
|
||||||
|
{
|
||||||
|
printf("here !!\n");
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
svcWaitSynchronization(gspEvents[GSPEVENT_P3D], 20000000);
|
svcWaitSynchronization(gspEvents[GSPEVENT_P3D], 20000000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user