mirror of
https://github.com/wiiu-env/ScreenshotWUPS.git
synced 2024-11-05 07:55:09 +01:00
Support games that use VPADGetButtonProcMode (e.g. Zelda TP HD)
This commit is contained in:
parent
a466b2f40f
commit
0bd1feb1ff
@ -11,6 +11,8 @@
|
|||||||
#include <vpad/input.h>
|
#include <vpad/input.h>
|
||||||
#include <wups.h>
|
#include <wups.h>
|
||||||
|
|
||||||
|
extern "C" uint32_t VPADGetButtonProcMode(uint32_t);
|
||||||
|
|
||||||
DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffer, uint32_t buffer_size, VPADReadError *error) {
|
DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffer, uint32_t buffer_size, VPADReadError *error) {
|
||||||
|
|
||||||
VPADReadError real_error;
|
VPADReadError real_error;
|
||||||
@ -18,23 +20,31 @@ DECL_FUNCTION(int32_t, VPADRead, VPADChan chan, VPADStatus *buffer, uint32_t buf
|
|||||||
|
|
||||||
if (gEnabled && (gTakeScreenshotTV == SCREENSHOT_STATE_READY || gTakeScreenshotDRC == SCREENSHOT_STATE_READY)) {
|
if (gEnabled && (gTakeScreenshotTV == SCREENSHOT_STATE_READY || gTakeScreenshotDRC == SCREENSHOT_STATE_READY)) {
|
||||||
if (result > 0 && real_error == VPAD_READ_SUCCESS) {
|
if (result > 0 && real_error == VPAD_READ_SUCCESS) {
|
||||||
if (((buffer[0].trigger & 0x000FFFFF) == gButtonCombo)) {
|
uint32_t end = 1;
|
||||||
if (!OSIsHomeButtonMenuEnabled()) {
|
// Fix games like TP HD
|
||||||
DEBUG_FUNCTION_LINE("Screenshots are disabled");
|
if (VPADGetButtonProcMode(chan) == 1) {
|
||||||
} else {
|
end = result;
|
||||||
if (gImageSource == IMAGE_SOURCE_TV_AND_DRC || gImageSource == IMAGE_SOURCE_TV) {
|
}
|
||||||
if (gTakeScreenshotTV == SCREENSHOT_STATE_READY) {
|
for (uint32_t i = 0; i < end; i++) {
|
||||||
DEBUG_FUNCTION_LINE("Requested screenshot for TV!");
|
if (((buffer[i].trigger & 0x000FFFFF) == gButtonCombo)) {
|
||||||
gTakeScreenshotTV = SCREENSHOT_STATE_REQUESTED;
|
if (!OSIsHomeButtonMenuEnabled()) {
|
||||||
|
DEBUG_FUNCTION_LINE("Screenshots are disabled");
|
||||||
|
} else {
|
||||||
|
if (gImageSource == IMAGE_SOURCE_TV_AND_DRC || gImageSource == IMAGE_SOURCE_TV) {
|
||||||
|
if (gTakeScreenshotTV == SCREENSHOT_STATE_READY) {
|
||||||
|
DEBUG_FUNCTION_LINE("Requested screenshot for TV!");
|
||||||
|
gTakeScreenshotTV = SCREENSHOT_STATE_REQUESTED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (gImageSource == IMAGE_SOURCE_TV_AND_DRC || gImageSource == IMAGE_SOURCE_DRC) {
|
||||||
if (gImageSource == IMAGE_SOURCE_TV_AND_DRC || gImageSource == IMAGE_SOURCE_DRC) {
|
if (gTakeScreenshotDRC == SCREENSHOT_STATE_READY) {
|
||||||
if (gTakeScreenshotDRC == SCREENSHOT_STATE_READY) {
|
DEBUG_FUNCTION_LINE("Requested screenshot for DRC!");
|
||||||
DEBUG_FUNCTION_LINE("Requested screenshot for DRC!");
|
gTakeScreenshotDRC = SCREENSHOT_STATE_REQUESTED;
|
||||||
gTakeScreenshotDRC = SCREENSHOT_STATE_REQUESTED;
|
}
|
||||||
}
|
}
|
||||||
|
OSMemoryBarrier();
|
||||||
}
|
}
|
||||||
OSMemoryBarrier();
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user