mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2024-11-04 18:05:08 +01:00
[Plugin] Increased the stability of the screenshot tool
This commit is contained in:
parent
af70ccf83f
commit
1157026b8b
@ -11,15 +11,15 @@
|
||||
#include "screenshot_utils.h"
|
||||
#include "retain_vars.hpp"
|
||||
|
||||
static bool takeScreenshotTV = false;
|
||||
static bool takeScreenshotDRC = false;
|
||||
static u8 screenshotCooldown = 0;
|
||||
static u32 counter = 0;
|
||||
static bool takeScreenshotTV __attribute__((section(".data"))) = false;
|
||||
static bool takeScreenshotDRC __attribute__((section(".data"))) = false;
|
||||
static u8 screenshotCooldown __attribute__((section(".data"))) = 0;
|
||||
static u32 counter __attribute__((section(".data"))) = 0;
|
||||
|
||||
DECL_FUNCTION(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error) {
|
||||
int result = real_VPADRead(chan, buffer, buffer_size, error);
|
||||
u32 btns = gButtonCombo;
|
||||
if(result > 0 && (buffer[0].btns_h == btns) && screenshotCooldown == 0 && OSIsHomeButtonMenuEnabled()) {
|
||||
|
||||
if(result > 0 && (buffer[0].btns_h == gButtonCombo) && screenshotCooldown == 0 && OSIsHomeButtonMenuEnabled()) {
|
||||
counter++;
|
||||
takeScreenshotTV = true;
|
||||
takeScreenshotDRC = true;
|
||||
@ -34,7 +34,7 @@ DECL_FUNCTION(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *e
|
||||
}
|
||||
|
||||
DECL_FUNCTION(void, GX2CopyColorBufferToScanBuffer, const GX2ColorBuffer *colorBuffer, s32 scan_target) {
|
||||
if(takeScreenshotTV || takeScreenshotDRC) {
|
||||
if((takeScreenshotTV || takeScreenshotDRC) && gAppStatus == WUPS_APP_STATUS_FOREGROUND) {
|
||||
OSCalendarTime output;
|
||||
OSTicksToCalendarTime(OSGetTime(), &output);
|
||||
char buffer[255] = {0};
|
||||
|
@ -36,8 +36,10 @@ INITIALIZE_PLUGIN() {
|
||||
InitOSFunctionPointers();
|
||||
InitVPadFunctionPointers();
|
||||
u32 res = SplashScreen(10,2);
|
||||
gButtonCombo = res;
|
||||
|
||||
gButtonCombo = res;
|
||||
ICInvalidateRange((void*)(&gButtonCombo), 4);
|
||||
DCFlushRange((void*)(&gButtonCombo), 4);
|
||||
}
|
||||
|
||||
// Called whenever an application was started.
|
||||
@ -46,6 +48,8 @@ ON_APPLICATION_START(my_args) {
|
||||
InitSocketFunctionPointers();
|
||||
InitFSFunctionPointers();
|
||||
|
||||
gAppStatus = WUPS_APP_STATUS_FOREGROUND;
|
||||
|
||||
log_init();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user