mirror of
https://github.com/LumaTeam/Luma3DS.git
synced 2026-02-22 01:44:38 +00:00
rosalina: clean up code in N3DSMenu_UpdateStatus
This commit is contained in:
parent
0a11d29d8b
commit
946eb94f02
@ -291,7 +291,7 @@ static void menuInitializeQtm(void)
|
|||||||
|
|
||||||
// Steal QTM handle from GSP, because there is a limit of 3 sessions (or 2 before 9.3) for ALL qtm services
|
// Steal QTM handle from GSP, because there is a limit of 3 sessions (or 2 before 9.3) for ALL qtm services
|
||||||
Handle qtmHandle = 0;
|
Handle qtmHandle = 0;
|
||||||
for (int i = 0; i < 20 && !qtmIsInitialized(); i++)
|
for (int i = 0; i < 30 && !qtmIsInitialized(); i++)
|
||||||
{
|
{
|
||||||
if (R_SUCCEEDED(svcControlService(SERVICEOP_STEAL_CLIENT_SESSION, &qtmHandle, "qtm:sp")))
|
if (R_SUCCEEDED(svcControlService(SERVICEOP_STEAL_CLIENT_SESSION, &qtmHandle, "qtm:sp")))
|
||||||
*qtmGetSessionHandle() = qtmHandle;
|
*qtmGetSessionHandle() = qtmHandle;
|
||||||
|
|||||||
@ -71,15 +71,13 @@ void N3DSMenu_UpdateStatus(void)
|
|||||||
|
|
||||||
if (N3DSMenu_CheckNotN2dsXl())
|
if (N3DSMenu_CheckNotN2dsXl())
|
||||||
{
|
{
|
||||||
|
bool blacklisted = false;
|
||||||
|
|
||||||
// Read status
|
// Read status
|
||||||
if (R_FAILED(QTMS_GetQtmStatus(&lastUpdatedQtmStatus)))
|
if (R_FAILED(QTMS_GetQtmStatus(&lastUpdatedQtmStatus)))
|
||||||
qtmUnavailableAndNotBlacklisted = true; // stop showing QTM options if unavailable but not blacklisted
|
qtmUnavailableAndNotBlacklisted = true; // stop showing QTM options if unavailable but not blacklisted
|
||||||
|
|
||||||
if ((lastUpdatedQtmStatus & 0xFF) == QTM_STATUS_UNAVAILABLE)
|
else if (lastUpdatedQtmStatus == QTM_STATUS_UNAVAILABLE)
|
||||||
__builtin_trap();
|
|
||||||
|
|
||||||
bool blacklisted = false;
|
|
||||||
if (lastUpdatedQtmStatus == QTM_STATUS_UNAVAILABLE)
|
|
||||||
qtmUnavailableAndNotBlacklisted = R_FAILED(QTMU_IsCurrentAppBlacklisted(&blacklisted)) || !blacklisted;
|
qtmUnavailableAndNotBlacklisted = R_FAILED(QTMU_IsCurrentAppBlacklisted(&blacklisted)) || !blacklisted;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user