diff --git a/source/ngc/freeze.cpp b/source/ngc/freeze.cpp index 044f88c..75daea0 100644 --- a/source/ngc/freeze.cpp +++ b/source/ngc/freeze.cpp @@ -189,7 +189,7 @@ done: FreeSaveBuffer (); // save screenshot - I would prefer to do this from gameScreenTex - if(gameScreenTex != NULL && method != METHOD_MC_SLOTA && method != METHOD_MC_SLOTB) + if(gameScreenTex2 != NULL && method != METHOD_MC_SLOTA && method != METHOD_MC_SLOTB) { AllocSaveBuffer (); @@ -197,7 +197,7 @@ done: if (pngContext != NULL) { - imgSize = PNGU_EncodeFromGXTexture(pngContext, 640, 480, gameScreenTex, 0); + imgSize = PNGU_EncodeFromGXTexture(pngContext, 640, 480, gameScreenTex2, 0); PNGU_ReleaseImageContext(pngContext); } diff --git a/source/ngc/gui/gui_savebrowser.cpp b/source/ngc/gui/gui_savebrowser.cpp index 4036f27..e611678 100644 --- a/source/ngc/gui/gui_savebrowser.cpp +++ b/source/ngc/gui/gui_savebrowser.cpp @@ -222,7 +222,11 @@ void GuiSaveBrowser::Update(GuiTrigger * t) int i, len; char savetext[50]; // update the location of the scroll box based on the position in the option list - int position = 136*(listOffset+selectedItem)/saves->length; + int position; + if(action == 0) + position = 136*(listOffset+selectedItem)/saves->length; + else + position = 136*(listOffset+selectedItem+2)/saves->length; if(position > 130) position = 136; diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 6f6a1e3..3bc40ff 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -1286,10 +1286,13 @@ static int MenuGame() mainWindow->Remove(gameScreenImg); delete gameScreenImg; gameScreenImg = NULL; + } + if(gameScreenTex) + { free(gameScreenTex); gameScreenTex = NULL; - bgImg->SetVisible(true); } + bgImg->SetVisible(true); #ifndef NO_SOUND bgMusic->Play(); // startup music #endif @@ -3240,7 +3243,7 @@ MainMenu (int menu) if(gameScreenTex) { - gameScreenImg = new GuiImage(gameScreenTex2, screenwidth, screenheight); + gameScreenImg = new GuiImage(gameScreenTex, screenwidth, screenheight); gameScreenImg->SetAlpha(192); //gameScreenImg->SetStripe(100); gameScreenImg->ColorStripe(30); @@ -3381,6 +3384,9 @@ MainMenu (int menu) { free(gameScreenTex); gameScreenTex = NULL; + } + if(gameScreenTex2) + { free(gameScreenTex2); gameScreenTex2 = NULL; } diff --git a/source/ngc/video.cpp b/source/ngc/video.cpp index 3188e9d..54b1bab 100644 --- a/source/ngc/video.cpp +++ b/source/ngc/video.cpp @@ -868,20 +868,22 @@ setGFX () */ void TakeScreenshot() { - if(gameScreenTex) - free(gameScreenTex); - + if(gameScreenTex) free(gameScreenTex); gameScreenTex = (u8 *)memalign(32, vmode->fbWidth * vmode->efbHeight * 4); - gameScreenTex2 = (u8 *)memalign(32, vmode->fbWidth * vmode->efbHeight * 4); - if(gameScreenTex == NULL || gameScreenTex2 == NULL) - return; + if(gameScreenTex == NULL) return; GX_SetTexCopySrc(0, 0, vmode->fbWidth, vmode->efbHeight); GX_SetTexCopyDst(vmode->fbWidth, vmode->efbHeight, GX_TF_RGBA8, GX_FALSE); GX_CopyTex(gameScreenTex, GX_FALSE); - GX_CopyTex(gameScreenTex2, GX_FALSE); GX_PixModeSync(); DCFlushRange(gameScreenTex, vmode->fbWidth * vmode->efbHeight * 4); + + #ifdef HW_RVL + if(gameScreenTex2) free(gameScreenTex2); + gameScreenTex2 = (u8 *)memalign(32, vmode->fbWidth * vmode->efbHeight * 4); + if(gameScreenTex2 == NULL) return; + memcpy(gameScreenTex2, gameScreenTex, vmode->fbWidth * vmode->efbHeight * 4) DCFlushRange(gameScreenTex2, vmode->fbWidth * vmode->efbHeight * 4); + #endif } /****************************************************************************