Revision: 19106
http://vice-emu.svn.sourceforge.net/vice-emu/?rev=19106&view=rev
Author: pottendo
Date: 2008-08-02 20:18:34 +0000 (Sat, 02 Aug 2008)
Log Message:
-----------
Moved generic vblank code to src/vsync.c.
(vsyncarch_sync_with_raster): New function.
Modified Paths:
--------------
branches/pottendo/v2.0-work/vice/src/arch/win32/vsyncarch.c
Modified: branches/pottendo/v2.0-work/vice/src/arch/win32/vsyncarch.c
===================================================================
--- branches/pottendo/v2.0-work/vice/src/arch/win32/vsyncarch.c 2008-08-02 20:17:19 UTC (rev 19105)
+++ branches/pottendo/v2.0-work/vice/src/arch/win32/vsyncarch.c 2008-08-02 20:18:34 UTC (rev 19106)
@@ -141,47 +141,12 @@
ui_display_speed((float) speed, (float)frame_rate, warp_enabled);
}
-static unsigned long last = 0;
-static unsigned long nosynccount = 0;
-
-void vsyncarch_verticalblank(video_canvas_t *c, float rate, int frames)
+void vsyncarch_sync_with_raster(video_canvas_t *c)
{
- unsigned long nowi, lastx, max, frm, vbl;
-
- if (c->refreshrate <= 0.0f)
- return;
-
- nowi = vsyncarch_frequency();
-
- /* calculate counter cycles per frame */
- frm = (unsigned long)((float)(nowi * frames) / rate);
-
- nowi = vsyncarch_gettime();
-
- lastx = last - (frm * nosynccount);
- max = (frm * 7) >> 3;
- vbl = 0;
- while (max >= (nowi - lastx)) {
- IDirectDraw2_WaitForVerticalBlank(c->dd_object2, DDWAITVB_BLOCKBEGIN,
- 0);
- nowi = vsyncarch_gettime();
- vbl = 1;
- }
- if ((!vbl) && (nosynccount < 16)) {
- nosynccount ++;
- } else {
- last = nowi;
- nosynccount = 0;
- }
+ IDirectDraw2_WaitForVerticalBlank(c->dd_object2, DDWAITVB_BLOCKBEGIN,
+ 0);
}
-void vsyncarch_prepare_vbl(void)
-{
- /* keep vertical blank data prepared */
- last = vsyncarch_gettime();
- nosynccount = 0;
-}
-
void vsyncarch_sleep(signed long delay)
{
unsigned long start, now;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|