-///////////////////////////////////////////////////////////////////////////////
-void GPU_updateLace(void)
-{
-#ifdef ENABLE_GPU_LOG_SUPPORT
- fprintf(stdout,"GPU_updateLace()\n");
-#endif
-#ifdef DEBUG_ANALYSIS
- dbg_anacnt_GPU_updateLace++;
-#endif
- pcsx4all_prof_start_with_pause(PCSX4ALL_PROF_GPU,PCSX4ALL_PROF_COUNTERS);
-#ifdef PROFILER_PCSX4ALL
- pcsx4all_prof_frames++;
-#endif
-#ifdef DEBUG_FRAME
- if(isdbg_frame())
- {
- static int passed=0;
- if (!passed) dbg_enable();
- else pcsx4all_exit();
- passed++;
- }
-#endif
-
- // Frame skip table
- static const unsigned char skipTable[12][12] =
- {
- { 0,0,0,0,0,0,0,0,0,0,0,0 },
- { 0,0,0,0,0,0,0,0,0,0,0,1 },
- { 0,0,0,0,0,1,0,0,0,0,0,1 },
- { 0,0,0,1,0,0,0,1,0,0,0,1 },
- { 0,0,1,0,0,1,0,0,1,0,0,1 },
- { 0,1,0,0,1,0,1,0,0,1,0,1 },
- { 0,1,0,1,0,1,0,1,0,1,0,1 },
- { 0,1,0,1,1,0,1,0,1,1,0,1 },
- { 0,1,1,0,1,1,0,1,1,0,1,1 },
- { 0,1,1,1,0,1,1,1,0,1,1,1 },
- { 0,1,1,1,1,1,0,1,1,1,1,1 },
- { 0,1,1,1,1,1,1,1,1,1,1,1 }
- };
-
- // Interlace bit toggle
- GPU_GP1 ^= 0x80000000;
-
- // Update display
- if ((!skipFrame) && (!isSkip) && (fb_dirty) && (!(((GPU_GP1&0x08000000))||((GPU_GP1&0x00800000)))))
- {
- gpuVideoOutput(); // Display updated
-
- if (DisplayArea[3] == 480)
- {
- if (linesInterlace_user) linesInterlace = 3; // 1/4 of lines
- else linesInterlace = 1; // if 480 we only need half of lines
- }
- else if (linesInterlace != linesInterlace_user)
- {
- linesInterlace = linesInterlace_user; // resolution changed from 480 to lower one
- video_clear();
- }
- }
-
- // Limit FPS
- if (frameLimit)
- {
- static unsigned next=get_ticks();
- if (!skipFrame)
- {
- unsigned now=get_ticks();
- if (now<next) wait_ticks(next-now);
- }
- next+=(isPAL?(1000000/50):((unsigned)(1000000.0/59.94)));
- }
-
- // Show FPS statistics
- if (show_fps)
- {
- static u32 real_fps=0;
- static u32 prev=get_ticks();
- static char msg[32]="FPS=000/00 SPD=000%";
- u32 now=get_ticks();
- real_fps++;
- if ((now-prev)>=1000000)
- {
- u32 expected_fps=(isPAL?50:60);
- sprintf(msg,"FPS=%3d/%2d SPD=%3d%%",((real_fps*(12-skipCount))/12),((expected_fps*(12-skipCount))/12),((real_fps*100)/expected_fps));
- prev=now;
- real_fps=0;
- }
- port_printf(5,5,msg);
- }
-
- // Update frame-skip
- if (!alt_fps)
- {
- // Video frame-skip
- skipFrame=skipTable[skipCount][skCount];
- skCount--; if (skCount<0) skCount=11;
- isSkip=skipFrame;
- }
- else
- {
- // Game frame-skip
- if (!isSkip)
- {
- skipFrame=skipTable[skipCount][skCount];
- skCount--; if (skCount<0) skCount=11;
- isSkip=true;
- }
- }
- fb_dirty=false;
-
- pcsx4all_prof_end_with_resume(PCSX4ALL_PROF_GPU,PCSX4ALL_PROF_COUNTERS);
-}
-
-#else
-
-#include "../../frontend/plugin_lib.h"
-#include "../gpulib/cspace.h"