diff --git a/HISTORY.txt b/HISTORY.txt index d87ad31..61391e1 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -196,6 +196,7 @@ Genesis Plus GX 1.7.5 (xx/xx/xxxx) (Eke-Eke) * fixed bug with PICO pointer * fixed lightgun crosshair & CD leds positionning when using NTSC filter * fixed low-pass filter menu setting +* fixed random PNG snapshots corruption * various code cleanup & optimizations * built with devkitPPC r38, libogc 2.2.1 and libfat 1.1.5 with UStealth Mod diff --git a/gx/gx_video.c b/gx/gx_video.c index 4dc321f..f16f919 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -1019,22 +1019,19 @@ void gxCopyScreenshot(gx_texture *texture) GX_Color4u8(0xff,0xff,0xff,0xff); GX_TexCoord2f32(0.0, 0.0); GX_End(); + GX_DrawDone(); /* copy EFB to texture */ GX_SetTexCopySrc(0, 0, texture->width * 2, texture->height * 2); GX_SetTexCopyDst(texture->width, texture->height, texture->format, GX_TRUE); - GX_DrawDone(); GX_CopyTex(texture->data, GX_TRUE); GX_Flush(); /* wait for copy operation to finish */ - /* GX_PixModeSync is only useful if GX_ command follows */ - /* we use dummy GX commands to stall CPU execution */ GX_PixModeSync(); - GX_LoadTexObj(&screenTexObj, GX_TEXMAP0); - GX_InvalidateTexAll(); - GX_Flush(); - DCStoreRange(texture->data, texture->width * texture->height * 4); + + /* invalidate data cache area corresponding to texture RAM address */ + DCInvalidateRange(texture->data, texture->width * texture->height * 4); } /* Take Screenshot */