if (fabs (currprefs.chipset_refreshrate) > 0.1) {
syncadjust = currprefs.chipset_refreshrate / vblank_hz_nom;
vblank_hz = currprefs.chipset_refreshrate;
- if (isvsync_chipset ()) {
+ if (isvsync_chipset() && !currprefs.gfx_variable_sync) {
int mult = 0;
if (getvsyncrate(0, vblank_hz, &mult) != vblank_hz) {
vblank_hz = getvsyncrate(0, vblank_hz, &vblank_hz_mult);
double v = -1;
if (!ad->picasso_on && !ad->picasso_requested_on) {
if (isvsync_chipset ()) {
- if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
- if ((fabs (vblank_hz - 50) < 1 || fabs (vblank_hz - 60) < 1 || fabs (vblank_hz - 100) < 1 || fabs (vblank_hz - 120) < 1) && currprefs.gfx_apmode[0].gfx_vsync == 2 && currprefs.gfx_apmode[0].gfx_fullscreen > 0) {
- vsync_switchmode(0, (int)vblank_hz);
+ if (!currprefs.gfx_variable_sync) {
+ if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
+ if ((fabs(vblank_hz - 50) < 1 || fabs(vblank_hz - 60) < 1 || fabs(vblank_hz - 100) < 1 || fabs(vblank_hz - 120) < 1) && currprefs.gfx_apmode[0].gfx_vsync == 2 && currprefs.gfx_apmode[0].gfx_fullscreen > 0) {
+ vsync_switchmode(0, (int)vblank_hz);
+ }
+ }
+ if (isvsync_chipset() < 0) {
+
+ double v2;
+ v2 = target_getcurrentvblankrate(0);
+ if (!cr->locked)
+ v = v2;
+ } else if (isvsync_chipset() > 0) {
+ if (currprefs.gfx_apmode[0].gfx_refreshrate)
+ v = abs(currprefs.gfx_apmode[0].gfx_refreshrate);
}
- }
- if (isvsync_chipset () < 0) {
-
- double v2;
- v2 = target_getcurrentvblankrate(0);
- if (!cr->locked)
- v = v2;
- } else if (isvsync_chipset () > 0) {
- if (currprefs.gfx_apmode[0].gfx_refreshrate)
- v = abs (currprefs.gfx_apmode[0].gfx_refreshrate);
}
} else {
if (cr->locked == false) {
display_rendered = true;
}
// if 2 slices: make sure we are out of vblank.
- if (display_slices <= 2) {
+ if (display_slices <= 2 && !currprefs.gfx_variable_sync) {
while (!currprefs.turbo_emulation && sync_timeout_check(maxtime)) {
int vp = target_get_display_scanline(-1);
if (vp != -1)
// topmost/first slice?
if (display_slice_cnt == 0) {
+ // variable sync: use read_processor_time() for vblank timing
if (currprefs.gfx_variable_sync) {
if (!currprefs.turbo_emulation) {
+
+ frame_time_t rpt;
+ for (;;) {
+ rpt = read_processor_time();
+ if ((int)rpt - (int)(vsyncmintime - vsynctimebase / 2) >= 0 || (int)rpt - (int)vsyncmintime < -2 * vsynctimebase)
+ break;
+ maybe_process_pull_audio();
+ if (currprefs.m68k_speed < 0 && !was_syncline) {
+ is_syncline = -1;
+ return 0;
+ }
+ target_spin(0);
+ }
+
if (!was_syncline) {
do_render_slice(2, display_slice_cnt, vpos - 1);
display_rendered = true;
}
- frame_time_t rpt;
for(;;) {
rpt = read_processor_time();
if ((int)rpt - (int)vsyncmintime >= 0 || (int)rpt - (int)vsyncmintime < -2 * vsynctimebase)
}
target_spin(0);
}
- do_display_slice();
if ((int)rpt - (int)vsyncmintime < vsynctimebase && (int)rpt - (int)vsyncmintime > -vsynctimebase) {
vsyncmintime += vsynctimebase;
} else {
vsyncmintime = rpt + vsynctimebase;
}
+ do_display_slice();
display_rendered = false;
input_read_done = true;
}
} else {
+ // non-variable: poll vblank
if (!currprefs.turbo_emulation) {
if (!was_syncline) {
do_render_slice(2, display_slice_cnt, vpos - 1);
write_log(_T("fs guimode end\n"));
}
-static int xD3D_isenabled(int monid)
+static int xD3D11_isenabled(int monid)
{
struct d3d11struct *d3d = &d3d11data[monid];
return d3d->m_device != NULL ? 2 : 0;
D3D_showframe_special = NULL;
D3D_guimode = xD3D11_guimode;
D3D_getDC = xD3D_getDC;
- D3D_isenabled = xD3D_isenabled;
+ D3D_isenabled = xD3D11_isenabled;
D3D_clear = xD3D11_clear;
D3D_canshaders = xD3D11_canshaders;
D3D_goodenough = xD3D11_goodenough;
void S2X_configure(int monid, int rb, int gb, int bb, int rs, int gs, int bs)
{
+ if (monid)
+ return;
Init_2xSaI(rb, gb, bb, rs, gs, bs);
hq_init(rb, gb, bb, rs, gs, bs);
PAL_init(monid);
void S2X_reset(int monid)
{
+ if (monid)
+ return;
if (!inited)
return;
S2X_init(monid, dst_width2, dst_height2, amiga_depth2);
void S2X_free(int monid)
{
+ if (monid)
+ return;
+
changed_prefs.leds_on_screen &= ~STATUSLINE_TARGET;
currprefs.leds_on_screen &= ~STATUSLINE_TARGET;
bool S2X_init(int monid, int dw, int dh, int dd)
{
+ if (monid)
+ return false;
+
struct vidbuf_description *avidinfo = &adisplays[monid].gfxvidinfo;
struct amigadisplay *ad = &adisplays[monid];
struct vidbuffer *vb = avidinfo->outbuffer;
void S2X_render(int monid, int y_start, int y_end)
{
+ if (monid)
+ return;
struct AmigaMonitor *mon = &AMonitors[monid];
struct amigadisplay *ad = &adisplays[monid];
struct uae_filter *usedfilter = mon->usedfilter;
void S2X_refresh(int monid)
{
+ if (monid)
+ return;
DirectDraw_ClearSurface(NULL);
S2X_render(monid, -1, -1);
}
int S2X_getmult(int monid)
{
+ if (monid)
+ return 1;
struct AmigaMonitor *mon = &AMonitors[monid];
struct uae_filter *usedfilter = mon->usedfilter;
if (!usedfilter)