Commit 4ff48558 authored by mtufan's avatar mtufan

puae 2.3.3

parent 99f53495
......@@ -1436,8 +1436,8 @@ if [[ "x$WANT_A2091" = "xyes" ]]; then
fi
NEED_THREAD_SUPPORT=yes
if [[ "$srcdir" != "." ]]; then
AC_CONFIG_LINKS(src/libscg.a:src/libscg.a)
AC_CONFIG_LINKS(src/libschily.a:src/libschily.a)
dnl AC_CONFIG_LINKS(src/libscg.a:src/libscg.a)
dnl AC_CONFIG_LINKS(src/libschily.a:src/libschily.a)
UAE_LIBS="$LIBSCG_LIBS $UAE_LIBS"
else
UAE_LIBS="-L. $SCGLIBS $UAE_LIBS"
......
......@@ -969,6 +969,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
_tcscat (s, ",vsync");
else if (cr->vsync == 0)
_tcscat (s, ",nvsync");
if (cr->rtg)
_tcscat (s, ",rtg");
if (cr->commands[0]) {
_tcscat (s, ",");
_tcscat (s, cr->commands);
......@@ -1948,7 +1950,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
tmpbuf[sizeof tmpbuf / sizeof (TCHAR) - 1] = '\0';
int vert = -1, horiz = -1, lace = -1, ntsc = -1, framelength = -1, vsync = -1;
int locked = 0;
bool locked = false;
bool rtg = false;
double rate = -1;
TCHAR cmd[MAX_DPATH], label[16] = { 0 };
TCHAR *tmpp = tmpbuf;
......@@ -1981,7 +1984,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
}
}
if (!_tcsnicmp (tmpp, "locked", 4))
locked = 1;
locked = true;
if (!_tcsnicmp (tmpp, "nlace", 5))
lace = 0;
if (!_tcsnicmp (tmpp, "lace", 4))
......@@ -1998,6 +2001,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
framelength = 1;
if (!_tcsnicmp (tmpp, "shf", 3))
framelength = 0;
if (!_tcsnicmp (tmpp, "rtg", 3))
rtg = true;
tmpp = next;
if (tmpp >= end)
break;
......@@ -2020,7 +2025,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
p->cr[i].lace = lace;
p->cr[i].ntsc = ntsc;
p->cr[i].vsync = vsync;
p->cr[i].locked = locked != 0;
p->cr[i].locked = locked;
p->cr[i].rtg = rtg;
p->cr[i].framelength = framelength;
p->cr[i].rate = rate;
_tcscpy (p->cr[i].commands, cmd);
......@@ -2865,7 +2871,8 @@ static void subst (TCHAR *p, TCHAR *f, int n)
TCHAR *str = cfgfile_subst_path (UNEXPANDED, p, f);
_tcsncpy (f, str, n - 1);
f[n - 1] = '\0';
//FIXME: free (str);
//FIXME:
free (str);
}
static char *cfg_fgets (char *line, int max, struct zfile *fh)
......
......@@ -2868,7 +2868,6 @@ void init_hz_fullinit (bool fullinit)
reset_drawing ();
}
if (!picasso_on) {
for (i = 0; i < MAX_CHIPSET_REFRESH_TOTAL; i++) {
struct chipset_refresh *cr = &currprefs.cr[i];
if ((cr->horiz < 0 || cr->horiz == maxhpos) &&
......@@ -2876,9 +2875,11 @@ void init_hz_fullinit (bool fullinit)
(cr->ntsc < 0 || (cr->ntsc > 0 && isntsc) || (cr->ntsc == 0 && !isntsc)) &&
(cr->lace < 0 || (cr->lace > 0 && islace) || (cr->lace == 0 && !islace)) &&
(cr->framelength < 0 || (cr->framelength > 0 && lof_store) || (cr->framelength == 0 && !lof_store)) &&
((cr->rtg && picasso_on) || (!cr->rtg && !picasso_on)) &&
(cr->vsync < 0 || (cr->vsync > 0 && isvsync ()) || (cr->vsync == 0 && !isvsync ()))) {
double v = -1;
if (!picasso_on) {
if (isvsync ()) {
if (i == CHIPSET_REFRESH_PAL || i == CHIPSET_REFRESH_NTSC) {
if ((abs (vblank_hz - 50) < 1 || abs (vblank_hz - 60) < 1) && currprefs.gfx_avsync == 2 && currprefs.gfx_afullscreen > 0) {
......@@ -2901,11 +2902,18 @@ void init_hz_fullinit (bool fullinit)
if (v < 0)
v = cr->rate;
if (v > 0) {
changed_prefs.chipset_refreshrate = v;
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v;
cfgfile_parse_lines (&changed_prefs, cr->commands, -1);
}
break;
}
} else {
if (cr->locked == false)
v = vblank_hz;
else
v = cr->rate;
changed_prefs.chipset_refreshrate = currprefs.chipset_refreshrate = v;
cfgfile_parse_lines (&changed_prefs, cr->commands, -1);
}
break;
}
}
......@@ -5048,26 +5056,29 @@ static void framewait (void)
if (vs > 0) {
vsyncmintime = vsynctime;
update_screen ();
render_screen ();
show_screen ();
return;
} else if (vs < 0) {
vsyncmintime = vsynctime;
render_screen ();
vsync_busywait ();
update_screen ();
show_screen ();
return;
}
render_screen ();
for (;;) {
double v = rpt_vsync () / (syncbase / 1000.0);
if (v >= -4)
break;
uae_msleep (2);
}
update_screen ();
curr_time = start = uae_gethrtime ();
while (rpt_vsync () < 0);
curr_time = uae_gethrtime ();
vsyncmintime = curr_time + vsynctime;
idletime += uae_gethrtime () - start;
show_screen ();
}
static frame_time_t frametime2;
......@@ -5178,7 +5189,8 @@ static void vsync_handler_post (void)
if ((long int)(curr_time - vsyncmintime) > 0 || rpt_did_reset)
vsyncmintime = curr_time + vsynctime;
rpt_did_reset = 0;
update_screen ();
render_screen ();
show_screen ();
} else if (rpt_available) {
framewait ();
}
......@@ -5187,14 +5199,16 @@ static void vsync_handler_post (void)
if (rpt_available && currprefs.m68k_speed == 0) {
framewait ();
} else {
update_screen ();
render_screen ();
show_screen ();
}
}
#endif
} else if (currprefs.m68k_speed == 0) {
framewait ();
} else {
update_screen ();
render_screen ();
show_screen ();
}
gui_handle_events ();
......
......@@ -151,6 +151,7 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000,
struct chipset_refresh
{
bool locked;
bool rtg;
int horiz;
int vert;
int lace;
......
......@@ -1486,7 +1486,7 @@ static int mouseedge (void)
static int melast_x, melast_y;
static int isnonzero;
if (currprefs.input_magic_mouse == 0 || currprefs.input_tablet > 0)
if (currprefs.input_magic_mouse == 0 || currprefs.input_tablet > 0 || isfullscreen ())
return 0;
if (magicmouse_ibase == 0xffffffff)
return 0;
......
......@@ -71,7 +71,7 @@ static int data_in_serdatr; /* new data received */
//win32gfx.cpp
static double remembered_vblank;
static int vblankbase;
static int vblankbasewait, vblankbasefull;
// dinput
int rawkeyboard = -1;
......@@ -1367,12 +1367,25 @@ void update_debug_info(void)
}
//win32gfx.cpp
void update_screen (void)
static bool render_ok;
bool render_screen (void)
{
bool v = false;
render_ok = false;
//
render_ok = v;
return render_ok;
}
void show_screen (void)
{
if (!render_ok)
return;
//
}
double vblank_calibrate (bool waitonly)
double vblank_calibrate (double approx_vblank, bool waitonly)
{
frame_time_t t1, t2;
double tsum, tsum2, tval, tfirst;
......@@ -1381,7 +1394,8 @@ double vblank_calibrate (bool waitonly)
if (remembered_vblank > 0)
return remembered_vblank;
if (waitonly) {
vblankbase = (syncbase / currprefs.chipset_refreshrate) * 3 / 4;
vblankbasefull = syncbase / approx_vblank;
vblankbasewait = (syncbase / approx_vblank) * 3 / 4;
remembered_vblank = -1;
return -1;
}
......@@ -1442,7 +1456,8 @@ double vblank_calibrate (bool waitonly)
}
if (tsum >= 85)
tsum /= 2;
vblankbase = (syncbase / tsum) * 3 / 4;
vblankbasefull = (syncbase / tsum);
vblankbasewait = (syncbase / tsum) * 3 / 4;
write_log ("VSync calibration: %.6fHz\n", tsum);
remembered_vblank = tsum;
return tsum;
......@@ -1455,11 +1470,23 @@ bool vsync_busywait (void)
{
bool v;
static frame_time_t prevtime;
static bool framelost;
if (currprefs.turbo_emulation)
return true;
while (uae_gethrtime () - prevtime < vblankbase)
if (!framelost && uae_gethrtime () - prevtime > vblankbasefull) {
framelost = true;
prevtime = uae_gethrtime ();
return true;
}
if (framelost) {
framelost = false;
prevtime = uae_gethrtime ();
return true;
}
while (uae_gethrtime () - prevtime < vblankbasewait)
uae_msleep (1);
v = false;
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment