mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2024-12-25 01:21:57 +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 "screenshot_utils.h"
|
||||||
#include "retain_vars.hpp"
|
#include "retain_vars.hpp"
|
||||||
|
|
||||||
static bool takeScreenshotTV = false;
|
static bool takeScreenshotTV __attribute__((section(".data"))) = false;
|
||||||
static bool takeScreenshotDRC = false;
|
static bool takeScreenshotDRC __attribute__((section(".data"))) = false;
|
||||||
static u8 screenshotCooldown = 0;
|
static u8 screenshotCooldown __attribute__((section(".data"))) = 0;
|
||||||
static u32 counter = 0;
|
static u32 counter __attribute__((section(".data"))) = 0;
|
||||||
|
|
||||||
DECL_FUNCTION(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error) {
|
DECL_FUNCTION(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error) {
|
||||||
int result = real_VPADRead(chan, buffer, buffer_size, 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++;
|
counter++;
|
||||||
takeScreenshotTV = true;
|
takeScreenshotTV = true;
|
||||||
takeScreenshotDRC = 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) {
|
DECL_FUNCTION(void, GX2CopyColorBufferToScanBuffer, const GX2ColorBuffer *colorBuffer, s32 scan_target) {
|
||||||
if(takeScreenshotTV || takeScreenshotDRC) {
|
if((takeScreenshotTV || takeScreenshotDRC) && gAppStatus == WUPS_APP_STATUS_FOREGROUND) {
|
||||||
OSCalendarTime output;
|
OSCalendarTime output;
|
||||||
OSTicksToCalendarTime(OSGetTime(), &output);
|
OSTicksToCalendarTime(OSGetTime(), &output);
|
||||||
char buffer[255] = {0};
|
char buffer[255] = {0};
|
||||||
|
@ -36,8 +36,10 @@ INITIALIZE_PLUGIN() {
|
|||||||
InitOSFunctionPointers();
|
InitOSFunctionPointers();
|
||||||
InitVPadFunctionPointers();
|
InitVPadFunctionPointers();
|
||||||
u32 res = SplashScreen(10,2);
|
u32 res = SplashScreen(10,2);
|
||||||
gButtonCombo = res;
|
|
||||||
|
|
||||||
|
gButtonCombo = res;
|
||||||
|
ICInvalidateRange((void*)(&gButtonCombo), 4);
|
||||||
|
DCFlushRange((void*)(&gButtonCombo), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called whenever an application was started.
|
// Called whenever an application was started.
|
||||||
@ -46,6 +48,8 @@ ON_APPLICATION_START(my_args) {
|
|||||||
InitSocketFunctionPointers();
|
InitSocketFunctionPointers();
|
||||||
InitFSFunctionPointers();
|
InitFSFunctionPointers();
|
||||||
|
|
||||||
|
gAppStatus = WUPS_APP_STATUS_FOREGROUND;
|
||||||
|
|
||||||
log_init();
|
log_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user