aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliaspider2014-11-01 10:27:16 +0100
committeraliaspider2014-11-01 10:27:16 +0100
commited576d5f5f0760a6e17e8749735c6f6b8b9440a8 (patch)
tree40c6e5996adabb16d8893d8375e433eb6a0fbab0
parent10f0c6a523f50168c5caebef105b54e2832b126f (diff)
downloadsnesemu-ed576d5f5f0760a6e17e8749735c6f6b8b9440a8.tar.gz
snesemu-ed576d5f5f0760a6e17e8749735c6f6b8b9440a8.tar.bz2
snesemu-ed576d5f5f0760a6e17e8749735c6f6b8b9440a8.zip
fix frameskip.
-rw-r--r--libretro.c43
1 files 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();