*first += y;
}
+static int vsyncnextscanline;
+static int vsyncnextscanline_add;
+static int nextwaitvpos;
+static int display_slice_cnt;
+static int display_slice_lines;
+static int display_slices;
+static bool display_rendered;
+
static bool linesync_beam_single(void)
{
frame_time_t maxtime = read_processor_time() + 2 * vsynctimebase;
static bool linesync_beam_multi_dual(void)
{
frame_time_t maxtime = read_processor_time() + 2 * vsynctimebase;
- static int vsyncnextscanline;
- static int nextwaitvpos;
- static int display_slice_cnt;
- static int display_slice_lines;
- static int display_slices;
- static bool display_rendered;
bool input_read_done = false;
bool was_syncline = is_syncline != 0;
static bool linesync_beam_multi_single(void)
{
frame_time_t maxtime = read_processor_time() + 2 * vsynctimebase;
- static int vsyncnextscanline;
- static int vsyncnextscanline_add;
- static int nextwaitvpos;
- static int display_slice_cnt;
- static int display_slice_lines;
- static int display_slices;
- static bool display_rendered;
bool input_read_done = false;
bool was_syncline = is_syncline != 0;
// called when extra CPU wait is done
void vsync_event_done(void)
{
+ if (!isvsync_chipset()) {
+ is_syncline = 0;
+ return;
+ }
if (currprefs.gfx_display_sections <= 1) {
linesync_beam_single();
} else {
extern void vsync_event_done(void);
extern int vsync_activeheight;
-void do_cycles_slow (unsigned long cycles_to_add)
+static bool event_check_vsync(void)
{
-#ifdef WITH_X86
- if (x86_turbo_on) {
- execute_other_cpu_single();
- }
+ /* Keep only CPU emulation running while waiting for sync point. */
+ if (is_syncline == -1) {
+
+ if (!isvsync_chipset()) {
+ is_syncline = 0;
+ return false;
+ }
+ // wait for vblank
+ audio_finish_pull();
+ int done = vsync_isdone(NULL);
+ if (!done) {
+#ifdef WITH_PPC
+ if (ppc_state) {
+ if (is_syncline == 1) {
+ uae_ppc_execute_check();
+ } else {
+ uae_ppc_execute_quick();
+ }
+ }
#endif
+ if (currprefs.cachesize)
+ pissoff = pissoff_value;
+ else
+ pissoff = pissoff_nojit_value;
+ return true;
+ }
+ vsync_clear();
+ vsync_event_done();
- if ((pissoff -= cycles_to_add) >= 0)
- return;
+ } else if (is_syncline == -2) {
- cycles_to_add = -pissoff;
- pissoff = 0;
+ if (!isvsync_chipset()) {
+ is_syncline = 0;
+ return false;
+ }
+ // wait for vblank or early vblank
+ audio_finish_pull();
+ int done = vsync_isdone(NULL);
+ int vp = target_get_display_scanline(-1);
+ if (vp < 0 || vp >= is_syncline_end)
+ done = true;
+ if (!done) {
+#ifdef WITH_PPC
+ if (ppc_state) {
+ if (is_syncline == 1) {
+ uae_ppc_execute_check();
+ } else {
+ uae_ppc_execute_quick();
+ }
+ }
+#endif
+ if (currprefs.cachesize)
+ pissoff = pissoff_value;
+ else
+ pissoff = pissoff_nojit_value;
+ return true;
+ }
+ vsync_clear();
+ vsync_event_done();
- while ((nextevent - currcycle) <= cycles_to_add) {
+ } else if (is_syncline > 0) {
+
+ if (!isvsync_chipset()) {
+ is_syncline = 0;
+ return false;
+ }
+ audio_finish_pull();
+ // wait for specific scanline
+ int vp = target_get_display_scanline(-1);
+ if (vp < 0 || is_syncline > vp) {
+#ifdef WITH_PPC
+ if (ppc_state) {
+ uae_ppc_execute_check();
+ }
+#endif
+ if (currprefs.cachesize)
+ pissoff = pissoff_value;
+ else
+ pissoff = pissoff_nojit_value;
+ return true;
+ }
+ vsync_event_done();
- /* Keep only CPU emulation running while waiting for sync point. */
- if (is_syncline == -1) {
+ } else if (is_syncline == -10) {
- // wait for vblank
- audio_finish_pull();
- int done = vsync_isdone(NULL);
- if (!done) {
+ // wait is_syncline_end
+ if (event_wait) {
+ int rpt = read_processor_time();
+ int v = rpt - is_syncline_end;
+ if (v < 0) {
#ifdef WITH_PPC
if (ppc_state) {
- if (is_syncline == 1) {
- uae_ppc_execute_check();
- } else {
- uae_ppc_execute_quick();
- }
+ uae_ppc_execute_check();
}
#endif
if (currprefs.cachesize)
pissoff = pissoff_value;
else
pissoff = pissoff_nojit_value;
- return;
+ return true;
}
- vsync_clear();
- vsync_event_done();
-
- } else if (is_syncline == -2) {
-
- // wait for vblank or early vblank
- audio_finish_pull();
- int done = vsync_isdone(NULL);
- int vp = target_get_display_scanline(-1);
- if (vp < 0 || vp >= is_syncline_end)
- done = true;
- if (!done) {
+ }
+ is_syncline = 0;
+
+ } else if (is_syncline < -10) {
+
+ // wait is_syncline_end/vsyncmintime
+ if (event_wait) {
+ int rpt = read_processor_time();
+ int v = rpt - vsyncmintime;
+ int v2 = rpt - is_syncline_end;
+ if (v > vsynctimebase || v < -vsynctimebase) {
+ v = 0;
+ }
+ if (v < 0 && v2 < 0) {
#ifdef WITH_PPC
if (ppc_state) {
- if (is_syncline == 1) {
+ if (is_syncline == -11) {
uae_ppc_execute_check();
} else {
uae_ppc_execute_quick();
pissoff = pissoff_value;
else
pissoff = pissoff_nojit_value;
- return;
+ return true;
}
- vsync_clear();
- vsync_event_done();
-
- } else if (is_syncline > 0) {
+ }
+ is_syncline = 0;
+ }
+ return false;
+}
- audio_finish_pull();
- // wait for specific scanline
- int vp = target_get_display_scanline(-1);
- if (vp < 0 || is_syncline > vp) {
-#ifdef WITH_PPC
- if (ppc_state) {
- uae_ppc_execute_check();
- }
+void do_cycles_slow (unsigned long cycles_to_add)
+{
+#ifdef WITH_X86
+ if (x86_turbo_on) {
+ execute_other_cpu_single();
+ }
#endif
- if (currprefs.cachesize)
- pissoff = pissoff_value;
- else
- pissoff = pissoff_nojit_value;
- return;
- }
- vsync_event_done();
- } else if (is_syncline == -10) {
+ if ((pissoff -= cycles_to_add) >= 0)
+ return;
- // wait is_syncline_end
- if (event_wait) {
- int rpt = read_processor_time();
- int v = rpt - is_syncline_end;
- if (v < 0) {
-#ifdef WITH_PPC
- if (ppc_state) {
- uae_ppc_execute_check();
- }
-#endif
- if (currprefs.cachesize)
- pissoff = pissoff_value;
- else
- pissoff = pissoff_nojit_value;
- return;
- }
- }
- is_syncline = 0;
-
- } else if (is_syncline < -10) {
-
- // wait is_syncline_end/vsyncmintime
- if (event_wait) {
- int rpt = read_processor_time();
- int v = rpt - vsyncmintime;
- int v2 = rpt - is_syncline_end;
- if (v > vsynctimebase || v < -vsynctimebase) {
- v = 0;
- }
- if (v < 0 && v2 < 0) {
-#ifdef WITH_PPC
- if (ppc_state) {
- if (is_syncline == -11) {
- uae_ppc_execute_check();
- } else {
- uae_ppc_execute_quick();
- }
- }
-#endif
- if (currprefs.cachesize)
- pissoff = pissoff_value;
- else
- pissoff = pissoff_nojit_value;
- return;
- }
- }
- is_syncline = 0;
+ cycles_to_add = -pissoff;
+ pissoff = 0;
+ while ((nextevent - currcycle) <= cycles_to_add) {
+
+ if (is_syncline) {
+ if (event_check_vsync())
+ return;
}
cycles_to_add -= nextevent - currcycle;