Fix rare race condition issue causing white screens
This commit is contained in:
parent
497e1904d5
commit
a03988b05d
@ -261,6 +261,7 @@ int main(void)
|
||||
|
||||
Draw_Init();
|
||||
Cheat_SeedRng(svcGetSystemTick());
|
||||
ScreenFiltersMenu_LoadConfig();
|
||||
|
||||
MyThread *menuThread = menuCreateThread();
|
||||
MyThread *taskRunnerThread = taskRunnerCreateThread();
|
||||
|
@ -270,7 +270,6 @@ void menuThreadMain(void)
|
||||
while (!isServiceUsable("ac:u") || !isServiceUsable("hid:USER") || !isServiceUsable("gsp::Gpu") || !isServiceUsable("cdc:CHK"))
|
||||
svcSleepThread(250 * 1000 * 1000LL);
|
||||
|
||||
ScreenFiltersMenu_LoadConfig();
|
||||
handleShellOpened();
|
||||
|
||||
hidInit(); // assume this doesn't fail
|
||||
|
@ -45,12 +45,21 @@ typedef union {
|
||||
ScreenFilter topScreenFilter;
|
||||
ScreenFilter bottomScreenFilter;
|
||||
|
||||
static inline bool ScreenFiltersMenu_IsDefaultSettingsFilter(const ScreenFilter *filter)
|
||||
{
|
||||
bool ok = true;
|
||||
ok = ok && filter->cct == 6500;
|
||||
ok = ok && !filter->invert;
|
||||
ok = ok && filter->gamma == 1.0f;
|
||||
ok = ok && filter->contrast == 1.0f;
|
||||
ok = ok && filter->brightness == 0.0f;
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
static inline bool ScreenFiltersMenu_IsDefaultSettings(void)
|
||||
{
|
||||
static const ScreenFilter defaultFilter = { 6500, false, 1.0f, 1.0f, 0.0f };
|
||||
bool ok1 = memcmp(&topScreenFilter, &defaultFilter, sizeof(defaultFilter)) == 0;
|
||||
bool ok2 = memcmp(&bottomScreenFilter, &defaultFilter, sizeof(defaultFilter)) == 0;
|
||||
return ok1 && ok2;
|
||||
return ScreenFiltersMenu_IsDefaultSettingsFilter(&topScreenFilter) && ScreenFiltersMenu_IsDefaultSettingsFilter(&bottomScreenFilter);
|
||||
}
|
||||
|
||||
static inline u8 ScreenFiltersMenu_GetColorLevel(int inLevel, float wp, float a, float b, float g)
|
||||
|
@ -78,6 +78,9 @@ static void forceAudioOutput(u32 forceOp)
|
||||
|
||||
void handleShellOpened(void)
|
||||
{
|
||||
// Somtimes this is called before Rosalina thread main executes,
|
||||
// sometimes not... how fun :))
|
||||
|
||||
s64 out = 0;
|
||||
svcGetSystemInfo(&out, 0x10000, 4);
|
||||
u32 multiConfig = (u32)out;
|
||||
|
Loading…
x
Reference in New Issue
Block a user