From ed576d5f5f0760a6e17e8749735c6f6b8b9440a8 Mon Sep 17 00:00:00 2001 From: aliaspider Date: Sat, 1 Nov 2014 10:27:16 +0100 Subject: fix frameskip. --- libretro.c | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/libretro.c b/libretro.c index 9d746d6..445f0ec 100644 --- a/libretro.c +++ b/libretro.c @@ -400,46 +400,49 @@ void retro_run(void) samples_to_play -= (int)samples_to_play; } - -// samples_to_play = 0; +#ifdef FRAMESKIP + if (IPPU.RenderThisFrame) + { +#endif #ifdef PSP - static unsigned int __attribute__((aligned(16))) d_list[32]; - void* const texture_vram_p = (void*)(0x44200000 - (512 * - 512)); // max VRAM address - frame size + static unsigned int __attribute__((aligned(16))) d_list[32]; + void* const texture_vram_p = (void*)(0x44200000 - (512 * + 512)); // max VRAM address - frame size - sceKernelDcacheWritebackRange(GFX.Screen, GFX.Pitch * IPPU.RenderedScreenHeight); + sceKernelDcacheWritebackRange(GFX.Screen, GFX.Pitch * IPPU.RenderedScreenHeight); - sceGuStart(GU_DIRECT, d_list); + sceGuStart(GU_DIRECT, d_list); - sceGuCopyImage(GU_PSM_4444, 0, 0, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, GFX.Pitch >> 1, GFX.Screen, 0, - 0, - 512, texture_vram_p); + sceGuCopyImage(GU_PSM_4444, 0, 0, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, GFX.Pitch >> 1, GFX.Screen, 0, + 0, + 512, texture_vram_p); - sceGuTexSync(); - sceGuTexImage(0, 512, 512, 512, texture_vram_p); - sceGuTexMode(GU_PSM_5551, 0, 0, GU_FALSE); - sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB); - sceGuDisable(GU_BLEND); + sceGuTexSync(); + sceGuTexImage(0, 512, 512, 512, texture_vram_p); + sceGuTexMode(GU_PSM_5551, 0, 0, GU_FALSE); + sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB); + sceGuDisable(GU_BLEND); - sceGuFinish(); + sceGuFinish(); - video_cb(texture_vram_p, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, GFX.Pitch); + video_cb(texture_vram_p, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, GFX.Pitch); #else - video_cb(GFX.Screen, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, GFX.Pitch); + video_cb(GFX.Screen, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, GFX.Pitch); #endif #ifdef FRAMESKIP - if (IPPU.RenderThisFrame) IPPU.RenderThisFrame = false; + } else { - video_cb(NULL, 256, 224, GFX.Pitch); + video_cb(NULL, IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, GFX.Pitch); IPPU.RenderThisFrame = true; } #endif + // if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) // check_variables(); -- cgit v1.2.3