From c63dd08461dde8af9797135766707315176ad608 Mon Sep 17 00:00:00 2001 From: dborth Date: Mon, 25 May 2009 06:48:28 +0000 Subject: [PATCH] fix black screenshot when returning to menu issue --- source/ngc/fceugx.cpp | 4 ++-- source/ngc/fceugx.h | 1 + source/ngc/gcvideo.cpp | 7 +++++++ source/ngc/pad.cpp | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/source/ngc/fceugx.cpp b/source/ngc/fceugx.cpp index 481dfe0..2a44bc5 100644 --- a/source/ngc/fceugx.cpp +++ b/source/ngc/fceugx.cpp @@ -55,9 +55,10 @@ static uint8 *xbsave=NULL; static int fskipc = 0; static int videoReset = 0; static int currentMode = 0; -static int ResetRequested = 0; +int ScreenshotRequested = 0; int ConfigRequested = 0; int ShutdownRequested = 0; +int ResetRequested = 0; int ExitRequested = 0; char appPath[1024]; FreeTypeGX *fontSystem; @@ -341,7 +342,6 @@ int main(int argc, char *argv[]) { if((GCSettings.render != 0 && videoReset == -1) || videoReset == 0) { - TakeScreenshot(); ResetVideo_Menu(); ConfigRequested = 0; GCSettings.render = currentMode; diff --git a/source/ngc/fceugx.h b/source/ngc/fceugx.h index 67db3c6..b1df0f1 100644 --- a/source/ngc/fceugx.h +++ b/source/ngc/fceugx.h @@ -89,6 +89,7 @@ struct SGCSettings{ void ExitApp(); void ShutdownWii(); extern struct SGCSettings GCSettings; +extern int ScreenshotRequested; extern int ConfigRequested; extern int ShutdownRequested; extern int ExitRequested; diff --git a/source/ngc/gcvideo.cpp b/source/ngc/gcvideo.cpp index 3e7f4e7..8d2f7dd 100644 --- a/source/ngc/gcvideo.cpp +++ b/source/ngc/gcvideo.cpp @@ -279,6 +279,13 @@ copy_to_xfb (u32 arg) { if (copynow == GX_TRUE) { + if(ScreenshotRequested) + { + TakeScreenshot(); + ScreenshotRequested = 0; + ConfigRequested = 1; + } + GX_CopyDisp (xfb[whichfb], GX_TRUE); GX_Flush (); copynow = GX_FALSE; diff --git a/source/ngc/pad.cpp b/source/ngc/pad.cpp index 3a2c0d3..f5ae57d 100644 --- a/source/ngc/pad.cpp +++ b/source/ngc/pad.cpp @@ -586,7 +586,7 @@ void GetJoy() (userInput[i].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) ) { - ConfigRequested = 1; // go to the menu + ScreenshotRequested = 1; // go to the menu } }