From 7177799021109e9fb582c3a2832c390a679e66cc Mon Sep 17 00:00:00 2001 From: TuxSH Date: Fri, 29 Mar 2019 18:23:52 +0100 Subject: [PATCH] Rosalina: delete "auto screenfilter restore on wakeup" functionality. It was causing sleep mode wakeup issues and/or interfering with gsp in a bad way. --- sysmodules/rosalina/include/shell_open.h | 30 --------- sysmodules/rosalina/source/main.c | 3 - sysmodules/rosalina/source/shell_open.c | 77 ------------------------ 3 files changed, 110 deletions(-) delete mode 100644 sysmodules/rosalina/include/shell_open.h delete mode 100644 sysmodules/rosalina/source/shell_open.c diff --git a/sysmodules/rosalina/include/shell_open.h b/sysmodules/rosalina/include/shell_open.h deleted file mode 100644 index f7a6e7a..0000000 --- a/sysmodules/rosalina/include/shell_open.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -* This file is part of Luma3DS -* Copyright (C) 2016-2019 Aurora Wright, TuxSH, panicbit -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* Additional Terms 7.b and 7.c of GPLv3 apply to this file: -* * Requiring preservation of specified reasonable legal notices or -* author attributions in that material or in the Appropriate Legal -* Notices displayed by works containing it. -* * Prohibiting misrepresentation of the origin of that material, -* or requiring that modified versions of such material be marked in -* reasonable ways as different from the original version. -*/ - -#include - -MyThread *shellOpenCreateThread(void); -void shellOpenThreadMain(void); diff --git a/sysmodules/rosalina/source/main.c b/sysmodules/rosalina/source/main.c index 993b64d..32b6638 100644 --- a/sysmodules/rosalina/source/main.c +++ b/sysmodules/rosalina/source/main.c @@ -36,7 +36,6 @@ #include "menus/process_patches.h" #include "menus/miscellaneous.h" #include "menus/screen_filters.h" -#include "shell_open.h" static Result stealFsReg(void) { @@ -178,13 +177,11 @@ int main(void) svcBreak(USERBREAK_ASSERT); MyThread *menuThread = menuCreateThread(); - MyThread *shellOpenThread = shellOpenCreateThread(); if (R_FAILED(ServiceManager_Run(services, notifications, NULL))) svcBreak(USERBREAK_PANIC); MyThread_Join(menuThread, -1LL); - MyThread_Join(shellOpenThread, -1LL); return 0; } diff --git a/sysmodules/rosalina/source/shell_open.c b/sysmodules/rosalina/source/shell_open.c deleted file mode 100644 index f134ec4..0000000 --- a/sysmodules/rosalina/source/shell_open.c +++ /dev/null @@ -1,77 +0,0 @@ -/* -* This file is part of Luma3DS -* Copyright (C) 2016-2019 Aurora Wright, TuxSH, panicbit -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* Additional Terms 7.b and 7.c of GPLv3 apply to this file: -* * Requiring preservation of specified reasonable legal notices or -* author attributions in that material or in the Appropriate Legal -* Notices displayed by works containing it. -* * Prohibiting misrepresentation of the origin of that material, -* or requiring that modified versions of such material be marked in -* reasonable ways as different from the original version. -*/ - -#include "shell_open.h" -#include "menus/screen_filters.h" -#include "draw.h" - -#define INT_SHELL_OPEN 0x60 -#define STACK_SIZE 0x3000 - -static MyThread shellOpenThread; -static u8 ALIGN(8) shellOpenStack[STACK_SIZE]; -static Handle shellOpenEvent; - -extern Handle terminationRequestEvent; - -MyThread *shellOpenCreateThread(void) -{ - if (R_FAILED(MyThread_Create(&shellOpenThread, shellOpenThreadMain, shellOpenStack, STACK_SIZE, 0x3F, CORE_SYSTEM))) - svcBreak(USERBREAK_PANIC); - return &shellOpenThread; -} - -void shellOpenThreadMain(void) { - if (R_FAILED(svcCreateEvent(&shellOpenEvent, RESET_ONESHOT))) - svcBreak(USERBREAK_ASSERT); - - if (R_FAILED(svcBindInterrupt(INT_SHELL_OPEN, shellOpenEvent, 0, false))) - svcBreak(USERBREAK_ASSERT); - - Handle handles[2] = {terminationRequestEvent, shellOpenEvent}; - - while (true) { - s32 idx = -1; - - svcWaitSynchronizationN(&idx, handles, 2, false, U64_MAX); - - if (idx < 0) { - continue; - } - - if (handles[idx] == terminationRequestEvent) { - break; - } - - // Need to wait for the GPU to get initialized - svcSleepThread(16 * 1000 * 1000LL); - - screenFiltersSetTemperature(screenFiltersCurrentTemperature); - } - - svcUnbindInterrupt(INT_SHELL_OPEN, shellOpenEvent); - svcCloseHandle(shellOpenEvent); -}