Updated compute_framesync
Now matches WinUAE's version
This commit is contained in:
parent
3932fb85d9
commit
b3a04c5366
2 changed files with 45 additions and 20 deletions
|
@ -52,7 +52,7 @@ int debug_sprite_mask = 0xff;
|
||||||
STATIC_INLINE bool nocustom (void)
|
STATIC_INLINE bool nocustom (void)
|
||||||
{
|
{
|
||||||
struct amigadisplay *ad = &adisplays;
|
struct amigadisplay *ad = &adisplays;
|
||||||
if (ad->picasso_on)
|
if (ad->picasso_on && currprefs.picasso96_nocustom)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -4340,20 +4340,34 @@ void compute_framesync(void)
|
||||||
double v = -1;
|
double v = -1;
|
||||||
if (!ad->picasso_on && !ad->picasso_requested_on) {
|
if (!ad->picasso_on && !ad->picasso_requested_on) {
|
||||||
if (isvsync_chipset ()) {
|
if (isvsync_chipset ()) {
|
||||||
if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
|
if (!currprefs.gfx_variable_sync) {
|
||||||
if ((fabs(vblank_hz - 50) < 1 || fabs(vblank_hz - 60) < 1 || fabs(vblank_hz - 100) < 1 || fabs(vblank_hz - 120) < 1)) {
|
if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) {
|
||||||
vsync_switchmode(int(vblank_hz));
|
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((int)vblank_hz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isvsync_chipset() < 0) {
|
||||||
|
|
||||||
|
double v2;
|
||||||
|
v2 = target_getcurrentvblankrate();
|
||||||
|
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 (isvsync_chipset() > 0) {
|
} else {
|
||||||
if (currprefs.gfx_apmode[0].gfx_refreshrate)
|
if (cr->locked == false) {
|
||||||
v = abs(currprefs.gfx_apmode[0].gfx_refreshrate);
|
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
|
||||||
|
cfgfile_parse_lines (&changed_prefs, cr->commands, -1);
|
||||||
|
if (cr->commands[0])
|
||||||
|
write_log (_T("CMD1: '%s'\n"), cr->commands);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
v = cr->rate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (v < 0)
|
if (v < 0)
|
||||||
v = cr->rate;
|
v = cr->rate;
|
||||||
if (v > 0) {
|
if (v > 0) {
|
||||||
|
@ -4362,17 +4376,20 @@ void compute_framesync(void)
|
||||||
if (cr->commands[0])
|
if (cr->commands[0])
|
||||||
write_log (_T("CMD2: '%s'\n"), cr->commands);
|
write_log (_T("CMD2: '%s'\n"), cr->commands);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
if (cr->locked == false)
|
||||||
v = vblank_hz;
|
v = vblank_hz;
|
||||||
|
else
|
||||||
|
v = cr->rate;
|
||||||
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v;
|
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v;
|
||||||
vsync_switchmode(int(v));
|
cfgfile_parse_lines (&changed_prefs, cr->commands, -1);
|
||||||
|
if (cr->commands[0])
|
||||||
|
write_log (_T("CMD3: '%s'\n"), cr->commands);
|
||||||
}
|
}
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (!found) {
|
||||||
vsync_switchmode(int(vblank_hz));
|
|
||||||
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
|
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = vblank_hz;
|
||||||
}
|
}
|
||||||
stored_chipset_refresh = cr;
|
stored_chipset_refresh = cr;
|
||||||
|
|
|
@ -4346,17 +4346,25 @@ void drawing_init(void)
|
||||||
int isvsync_chipset(void)
|
int isvsync_chipset(void)
|
||||||
{
|
{
|
||||||
struct amigadisplay *ad = &adisplays;
|
struct amigadisplay *ad = &adisplays;
|
||||||
if (ad->picasso_on)
|
if (ad->picasso_on || currprefs.gfx_apmode[0].gfx_vsync <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
if (currprefs.gfx_apmode[0].gfx_vsyncmode == 0)
|
||||||
|
return 1;
|
||||||
|
if (currprefs.m68k_speed >= 0)
|
||||||
|
return -1;
|
||||||
|
return currprefs.cachesize ? -3 : -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isvsync_rtg(void)
|
int isvsync_rtg(void)
|
||||||
{
|
{
|
||||||
struct amigadisplay *ad = &adisplays;
|
struct amigadisplay *ad = &adisplays;
|
||||||
if (!ad->picasso_on)
|
if (!ad->picasso_on || currprefs.gfx_apmode[1].gfx_vsync <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
return 1;
|
if (currprefs.gfx_apmode[1].gfx_vsyncmode == 0)
|
||||||
|
return 1;
|
||||||
|
if (currprefs.m68k_speed >= 0)
|
||||||
|
return -1;
|
||||||
|
return currprefs.cachesize ? -3 : -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isvsync(void)
|
int isvsync(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue