Only block the TV Menu if screenshots are mapped to the TV button.

This commit is contained in:
Maschell 2023-01-26 13:04:33 +01:00
parent dbd48c757f
commit ac3e01fa75
3 changed files with 24 additions and 3 deletions

View File

@ -47,7 +47,15 @@ WUPS_MUST_REPLACE(CCRCDCRegisterUVCAttachCallback, WUPS_LOADER_LIBRARY_NSYSCCR,
void DRCAttachDetachCallback(CCRCDCCallbackData *data, void *context) { void DRCAttachDetachCallback(CCRCDCCallbackData *data, void *context) {
gBlockDRCScreenshots = !data->attached; gBlockDRCScreenshots = !data->attached;
if (!data->attached) { if (data->attached) {
if (gButtonCombo & VPAD_BUTTON_TV) {
DEBUG_FUNCTION_LINE("Block TV Menu");
VPADSetTVMenuInvalid(data->chan, true);
} else {
DEBUG_FUNCTION_LINE("Unblock TV Menu");
VPADSetTVMenuInvalid(data->chan, false);
}
} else {
DEBUG_FUNCTION_LINE("Block DRC screenshots"); DEBUG_FUNCTION_LINE("Block DRC screenshots");
} }
OSMemoryBarrier(); OSMemoryBarrier();

View File

@ -83,6 +83,14 @@ void InitConfig() {
} }
} }
if (gButtonCombo & VPAD_BUTTON_TV) {
DEBUG_FUNCTION_LINE("Block TV Menu");
VPADSetTVMenuInvalid(VPAD_CHAN_0, true);
} else {
DEBUG_FUNCTION_LINE("Unblock TV Menu");
VPADSetTVMenuInvalid(VPAD_CHAN_0, false);
}
if (gOutputFormat >= 3) { if (gOutputFormat >= 3) {
gOutputFormat = IMAGE_OUTPUT_FORMAT_JPEG; gOutputFormat = IMAGE_OUTPUT_FORMAT_JPEG;
} }
@ -151,6 +159,13 @@ void buttonComboItemChanged(ConfigItemButtonCombo *item, uint32_t newValue) {
DEBUG_FUNCTION_LINE("New value in %s changed: %d", item->configId, newValue); DEBUG_FUNCTION_LINE("New value in %s changed: %d", item->configId, newValue);
if (std::string_view(item->configId) == BUTTON_COMBO_CONFIG_STRING) { if (std::string_view(item->configId) == BUTTON_COMBO_CONFIG_STRING) {
gButtonCombo = newValue; gButtonCombo = newValue;
if (gButtonCombo & VPAD_BUTTON_TV) {
DEBUG_FUNCTION_LINE("Block TV Menu");
VPADSetTVMenuInvalid(VPAD_CHAN_0, true);
} else {
DEBUG_FUNCTION_LINE("Unblock TV Menu");
VPADSetTVMenuInvalid(VPAD_CHAN_0, false);
}
WUPS_StoreInt(nullptr, item->configId, (int32_t) gButtonCombo); WUPS_StoreInt(nullptr, item->configId, (int32_t) gButtonCombo);
} }
} }

View File

@ -49,8 +49,6 @@ ON_APPLICATION_START() {
ApplyGameSpecificPatches(); ApplyGameSpecificPatches();
VPADSetTVMenuInvalid(VPAD_CHAN_0, true);
InitDRCAttachCallbacks(); InitDRCAttachCallbacks();
} }