record_sprite (next_lineno, nr, posns[i], sprdata[nr], sprdatb[nr], sprctl[nr]);
/* get left and right sprite edge if brdsprt enabled */
#if AUTOSCALE_SPRITES
- if (dmaen (DMA_SPRITE) && (bplcon0 & 1) && (bplcon3 & 0x02) && !(bplcon3 & 0x20)) {
+ if (dmaen (DMA_SPRITE) && (bplcon0 & 1) && (bplcon3 & 0x02) && !(bplcon3 & 0x20) && nr > 0) {
int j, jj;
for (j = 0, jj = 0; j < sprite_width; j+= 16, jj++) {
int nx = fromspritexdiw (posns[i] + j);
// fastest possible
int max, adjust;
+ frame_time_t now;
- adjust = 0;
- curr_time = read_processor_time ();
- start = vsync_busywait_end ();
- if ((int)curr_time - (int)vsyncwaittime < 0)
- curr_time = start;
-
+ curr_time = vsync_busywait_end (); // vsync time
vsync_busywait_do (NULL, (bplcon0 & 4) != 0 && !lof_changed && !lof_changing, lof_store != 0);
vsync_busywait_start ();
- max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000;
- if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vsynctimebase / 2)
- adjust = curr_time - vsyncwaittime;
- max -= adjust;
+ now = read_processor_time (); // current time
+ adjust = (int)now - (int)curr_time;
+ if (adjust < 0)
+ adjust = 0;
+ if (adjust > vsynctimebase / 3)
+ adjust = vsynctimebase / 3;
- vsyncmintime = curr_time;
+ max = (vsynctimebase - (adjust * 3 / 2)) * (1000 + currprefs.m68k_speed_throttle) / 1000;
+ vsyncmintime = now;
vsyncwaittime = curr_time + vsynctimebase;
vsynctimeperline = max / (maxvpos_nom + 1);
- vsyncmaxtime = curr_time + max;
+ vsyncmaxtime = now + max;
} else {
+ int max, adjust;
+ frame_time_t now;
+
render_screen ();
bool show = show_screen_maybe (false);
vsync_busywait_do (&freetime, (bplcon0 & 4) != 0 && !lof_changed && !lof_changing, lof_store != 0);
curr_time = read_processor_time ();
- vsyncmintime = curr_time;
- vsyncwaittime = curr_time + vsynctimebase;
- vsyncmaxtime = curr_time + vsynctimebase;
- vsynctimeperline = vsynctimebase / (maxvpos_nom + 1);
if (!show) {
show_screen ();
if (extraframewait)
sleep_millis_main (extraframewait);
}
+ now = read_processor_time ();
+ adjust = (int)now - (int)curr_time;
+ if (adjust < 0)
+ adjust = 0;
+ if (adjust > vsynctimebase / 3)
+ adjust = vsynctimebase / 3;
+ max = vsynctimebase - (adjust * 3 / 2);
+
+ vsyncmintime = now;
+ vsyncwaittime = curr_time + vsynctimebase;
+
+ vsynctimeperline = max / 3;
+ vsyncmaxtime = now + max;
+
frame_shown = true;
}
#endif
}
+STATIC_INLINE bool is_last_line (void)
+{
+ return vpos + 1 == maxvpos + lof_store;
+}
+
// this prepares for new line
static void hsync_handler_post (bool onvsync)
{
}
#endif
if (currprefs.m68k_speed < 0) {
- if (vpos + 1 == maxvpos + lof_store) {
+ if (is_last_line ()) {
/* really last line, just run the cpu emulation until whole vsync time has been used */
if (currprefs.m68k_speed_throttle) {
vsyncmintime = read_processor_time (); /* end of CPU emulation time */
} else {
vsyncmintime = vsyncmaxtime; /* emulate if still time left */
+ is_syncline_end = read_processor_time () + vsynctimebase;
is_syncline = 1;
}
} else {
linecounter = 0;
}
}
- // extra cpu emulation time if previous 8 lines without extra time.
- if (!is_syncline && linecounter >= 8) {
- is_syncline = -1;
- is_syncline_end = read_processor_time () + vsynctimeperline;
- linecounter = 0;
+ if (!isvsync ()) {
+ // extra cpu emulation time if previous 10 lines without extra time.
+ if (!is_syncline && linecounter >= 10) {
+ is_syncline = -1;
+ is_syncline_end = read_processor_time () + vsynctimeperline;
+ linecounter = 0;
+ }
}
}
+ } else {
+ ;//write_log (L"%d ", vpos);
}
}
} else {
if (vpos + 1 < maxvpos + lof_store && (vpos == maxvpos_nom * 1 / 3 || vpos == maxvpos_nom * 2 / 3)) {
frame_time_t rpt = read_processor_time ();
- vsyncmintime += vsynctimebase / 3;
+ vsyncmintime += vsynctimeperline;
// sleep if more than 2ms "free" time
if (!vblank_found_chipset && (int)vsyncmintime - (int)(rpt + vsynctimebase / 10) > 0) {
sleep_millis_main (1);
if (diw_change > 0)
diw_change--;
- if (is_syncline > 0 && isvsync_chipset () == -2 && !vsync_rendered && currprefs.gfx_apmode[0].gfx_vflip == 0) {
+ if (is_last_line () && isvsync_chipset () == -2 && !vsync_rendered && currprefs.gfx_apmode[0].gfx_vflip == 0) {
frame_time_t start, end;
start = read_processor_time ();
/* fastest possible + last line and no vflip wait: render the frame as early as possible */
// interlace = only use long frames
if (!lof_store)
return ret;
- last_planes_vpos++;
- plflastline_total++;
+ /* program may have set last visible line as last possible line (CD32 boot screen) */
+ if (last_planes_vpos < maxvpos)
+ last_planes_vpos++;
+ if (plflastline_total < maxvpos)
+ plflastline_total++;
}
- if (!plflastline_total)
+ if (plflastline_total < 4)
plflastline_total = last_planes_vpos;
ddffirstword_total = coord_hw_to_window_x (ddffirstword_total * 2 + DIW_DDF_OFFSET);
}
}
+void reset_decision_table (void)
+{
+ for (int i = 0; i < sizeof linestate / sizeof *linestate; i++)
+ linestate[i] = LINE_UNDECIDED;
+}
+
void reset_drawing (void)
{
unsigned int i;
int i;
/* Keep only CPU emulation running while waiting for sync point. */
- if (is_syncline > 0) {
- int rpt = read_processor_time ();
- int v = rpt - vsyncmintime;
- int v2 = rpt - is_syncline_end;
- if (v > (int)vsynctimebase || v < -((int)vsynctimebase)) {
- v = 0;
- }
- if (v < 0 && v2 < 0 && !vblank_found_chipset) {
- pissoff = pissoff_value;
- return;
- }
- is_syncline = 0;
- } else if (is_syncline < 0) {
- int rpt = read_processor_time ();
- int v = rpt - is_syncline_end;
- if (v < 0 && !vblank_found_chipset) {
- pissoff = pissoff_value;
- return;
+ if (is_syncline) {
+ if (!vblank_found_chipset) {
+ if (is_syncline > 0) {
+ int rpt = read_processor_time ();
+ int v = rpt - vsyncmintime;
+ int v2 = rpt - is_syncline_end;
+ if (v > (int)vsynctimebase || v < -((int)vsynctimebase)) {
+ v = 0;
+ }
+ if (v < 0 && v2 < 0) {
+ pissoff = pissoff_value;
+ return;
+ }
+ } else if (is_syncline < 0) {
+ int rpt = read_processor_time ();
+ int v = rpt - is_syncline_end;
+ if (v < 0) {
+ pissoff = pissoff_value;
+ return;
+ }
+ }
}
is_syncline = 0;
}
if (ap->gfx_vsyncmode) {
// low latency vsync: no flip only if no-buffer
if (ap->gfx_backbuffers >= 1)
- ap->gfx_vflip = -1;
+ ap->gfx_vflip = 1;
if (!i && ap->gfx_backbuffers == 2)
ap->gfx_vflip = 1;
} else {
//write_log (_T("%.1fx%.1f %.1fx%.1f %.1fx%.1f\n"), dw, dh, w, h, sw, sh);
// ratio between Amiga texture and overlay mask texture
- float sw2 = dw * tin_w / window_w - 0.5f;
- float sh2 = dh * tin_h / window_h + 0.5f;
+ float sw2 = dw * tin_w / window_w;
+ float sh2 = dh * tin_h / window_h;
maskmult.x = sw2 * maskmult_x / w;
maskmult.y = sh2 * maskmult_y / h;
udi->removablemedia = devDesc->RemovableMedia;
write_log (_T("device id string: '%s'\n"), udi->device_name);
if (ignoreduplicates) {
- _stprintf (orgname, _T(":%s"), udi->device_name);
- if (isharddrive (orgname) >= 0) {
- write_log (_T("duplicate device, ignored\n"));
- return 1;
- }
if (!udi->removablemedia) {
write_log (_T("drive letter not removable, ignored\n"));
- return 1;
+ return -2;
+ }
+ _stprintf (orgname, _T(":%s"), udi->device_name);
+ for (i = 0; i < hdf_getnumharddrives (); i++) {
+ if (!_tcscmp (uae_drives[i].device_name, orgname)) {
+ if (uae_drives[i].dangerous == -10) {
+ write_log (_T("replaced old '%s'\n"), uae_drives[i].device_name);
+ return i;
+ }
+ write_log (_T("duplicate device, ignored\n"));
+ return -2;
+ }
}
}
- return 0;
+ return -1;
}
static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWORD *index2, uae_u8 *buffer, int ignoreduplicates)
BOOL status;
ULONG length = 0, returned = 0, returnedLength;
BOOL showonly = FALSE;
+ struct uae_driveinfo tmpudi = { 0 };
+
+ udi = &tmpudi;
+ int udiindex = *index2;
//
// Now we have the device path. Open the device interface
// to send Pass Through command
- udi = &uae_drives[*index2];
- memset (udi, 0, sizeof (struct uae_driveinfo));
_tcscpy (udi->device_path, DevicePath);
write_log (_T("opening device '%s'\n"), udi->device_path);
hDevice = CreateFile(
}
nosp = 1;
generatestorageproperty (udi, ignoreduplicates);
+ udiindex = -1;
} else {
- int r;
nosp = 0;
- r = getstorageproperty (outBuf, returnedLength, udi, ignoreduplicates);
- if (r) {
- ret = r;
+ udiindex = getstorageproperty (outBuf, returnedLength, udi, ignoreduplicates);
+ if (udiindex == -2) {
+ ret = 1;
goto end;
}
}
+ udi = &uae_drives[udiindex < 0 ? *index2 : udiindex];
+ memcpy (udi, &tmpudi, sizeof (struct uae_driveinfo));
+
+
_tcscpy (orgname, udi->device_name);
udi->bytespersector = 512;
geom_ok = 1;
}
amipartfound:
_stprintf (udi->device_name, _T(":%s"), orgname);
- {
+ if (udiindex < 0) {
int cnt = 1;
int off = _tcslen (udi->device_name);
while (isharddrive (udi->device_name) >= 0) {
udi->device_name[off + 2] = 0;
cnt++;
}
- }
- (*index2)++;
+ (*index2)++;
+ }
end:
if (hDevice != INVALID_HANDLE_VALUE)
CloseHandle (hDevice);
#define IDS_SCREEN_VSYNC2_AUTOSWITCH 376
#define IDS_SCREEN_VSYNC2 377
#define IDS_SCREEN_VSYNC_NONE 378
+#define IDS_FILTEROVERLAYTYPE_MASKS 379
+#define IDS_STRING380 380
+#define IDS_FILTEROVERLAYTYPE_OVERLAYS 380
#define IDS_QS_MODELS 1000
#define IDS_QS_MODEL_A500 1001
#define IDS_QS_MODEL_A500P 1002
IDS_SCREEN_VSYNC2_AUTOSWITCH "Low latency VS, 50/60Hz"\r
IDS_SCREEN_VSYNC2 "Low latency VSync"\r
IDS_SCREEN_VSYNC_NONE "-"\r
+ IDS_FILTEROVERLAYTYPE_MASKS "Masks"\r
+ IDS_FILTEROVERLAYTYPE_OVERLAYS "Overlays"\r
END\r
\r
STRINGTABLE\r
}
}
}
- write_log (L"********* -> %s\n", out);
+ write_log (_T("port_get_custom: %s\n"), out);
return true;
}
}
}
if (wdnum >= 0) {
- write_log (_T("kb=%d (%s) wdnum=%d\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), wdnum);
+ //write_log (_T("kb=%d (%s) wdnum=%d\n"), j, inputdevicefunc_keyboard.get_friendlyname (j), wdnum);
inputdevice_set_gameports_mapping (&changed_prefs, kb + j, wdnum, evtnum, flags, inputmap_port);
inputdevice_set_gameports_mapping (&currprefs, kb + j, wdnum, evtnum, flags, inputmap_port);
} else {
double skipmode, avgskipmode;
double avg = s->avg_correct / s->cnt_correct;
- skipmode = sync / 10.0;
+ skipmode = sync / 100.0;
avgskipmode = avg / (10000.0 / granulaty);
if ((0 || sound_debug) && (tfprev % 10) == 0) {
int log_net;
int log_vsync;
int uaelib_debug;
-int pissoff_value = 20000 * CYCLE_UNIT;
+int pissoff_value = 15000 * CYCLE_UNIT;
unsigned int fpucontrol;
int extraframewait = 0;
int wow64 = 0;
static int started;
static int first;
- TCHAR tmp[MAX_DPATH];
+ TCHAR tmp[MAX_DPATH], filedate[256];
if (first > 1) {
write_log (_T("** RESTART **\n"));
logging_open (first ? 0 : 1, 0);
logging_started = 1;
first++;
+
#ifdef _WIN64
wow64 = 1;
#else
if (fnIsWow64Process)
fnIsWow64Process (GetCurrentProcess (), &wow64);
#endif
+
+ _tcscpy (filedate, _T("?"));
+ if (GetModuleFileName (NULL, tmp, sizeof tmp / sizeof (TCHAR))) {
+ HANDLE h = CreateFile (tmp, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (h != INVALID_HANDLE_VALUE) {
+ FILETIME ft;
+ if (GetFileTime (h, &ft, NULL, NULL)) {
+ SYSTEMTIME st;
+ if (FileTimeToSystemTime(&ft, &st)) {
+ _stprintf (filedate, _T("%02d:%02d"), st.wHour, st.wMinute);
+ }
+ }
+ CloseHandle (h);
+ }
+ }
+
write_log (_T("%s (%d.%d %s%s[%d])"), VersionStr,
osVersion.dwMajorVersion, osVersion.dwMinorVersion, osVersion.szCSDVersion,
_tcslen (osVersion.szCSDVersion) > 0 ? _T(" ") : _T(""), os_winnt_admin);
- write_log (_T(" %d-bit %X.%X.%X %d"),
+ write_log (_T(" %d-bit %X.%X.%X %d %s"),
wow64 ? 64 : 32,
SystemInfo.wProcessorArchitecture, SystemInfo.wProcessorLevel, SystemInfo.wProcessorRevision,
- SystemInfo.dwNumberOfProcessors);
+ SystemInfo.dwNumberOfProcessors, filedate);
write_log (_T("\n(c) 1995-2001 Bernd Schmidt - Core UAE concept and implementation.")
_T("\n(c) 1998-2012 Toni Wilen - Win32 port, core code updates.")
_T("\n(c) 1996-2001 Brian King - Win32 port, Picasso96 RTG, and GUI.")
#define LANG_DLL 1
//#define WINUAEBETA _T("")
-#define WINUAEBETA _T("Beta 11")
-#define WINUAEDATE MAKEBD(2012, 4, 27)
+#define WINUAEBETA _T("12")
+#define WINUAEDATE MAKEBD(2012, 5, 1)
#define WINUAEEXTRA _T("")
//#define WINUAEEXTRA _T("AmiKit Preview")
#define WINUAEREV _T("")
if (vsync_busy_wait_mode == 0) {
dowait = ap->gfx_vflip || !preferbusy;
+ //dowait = !preferbusy;
} else if (vsync_busy_wait_mode < 0) {
dowait = true;
} else {
}
}
-static bool vblank_wait (void)
+static int vblank_wait (void)
{
int vp;
for (;;) {
int opos = prevvblankpos;
if (!getvblankpos (&vp))
- return false;
+ return -2;
if (opos > maxscanline / 2 && vp < maxscanline / 3)
- return true;
+ return vp;
if (vp <= 0)
- return true;
+ return vp;
vsync_sleep (true);
}
}
extern int log_vsync;
static bool dooddevenskip;
static volatile bool vblank_skipeveryother;
-static volatile bool vblank_first_time;
static bool vblanklaceskip (void)
{
static unsigned int __stdcall vblankthread (void *dummy)
{
- static bool firstvblankbasewait2;
+ bool vblank_first_time = false;
+ bool firstvblankbasewait2;
+ frame_time_t vblank_prev_time2;
+ bool doflipped;
+
while (vblankthread_mode > VBLANKTH_KILL) {
struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[1] : &currprefs.gfx_apmode[0];
vblankthread_counter++;
- if (vblankthread_mode == VBLANKTH_CALIBRATE) {
+ int mode = vblankthread_mode;
+ if (mode == VBLANKTH_CALIBRATE) {
// calibrate mode, try to keep CPU power saving inactive
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_LOWEST);
while (vblankthread_mode == 0)
vblankthread_counter++;
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_HIGHEST);
- } else if (vblankthread_mode == VBLANKTH_IDLE) {
+ } else if (mode == VBLANKTH_IDLE) {
// idle mode
Sleep (100);
- } else if (vblankthread_mode == VBLANKTH_ACTIVE_WAIT) {
- sleep_millis (ap->gfx_vflip && currprefs.m68k_speed >= 0 ? 2 : 1);
- } else if (vblankthread_mode == VBLANKTH_ACTIVE_START) {
+ } else if (mode == VBLANKTH_ACTIVE_WAIT) {
+ sleep_millis (1);
+ } else if (mode == VBLANKTH_ACTIVE_START) {
// do not start until vblank has been passed
int vp;
- firstvblankbasewait2 = false;
getvblankpos (&vp);
- if (vp <= 0) {
- if (!vblank_first_time) {
- // set prevtime now if we are still at vsync to improve timing
- vblank_prev_time = read_processor_time ();
- vblank_first_time = true;
- }
+ if (vp > maxscanline / 2) {
sleep_millis (1);
continue;
}
- if (vp > maxscanline / 2) {
+ if (!vblank_first_time) {
+ frame_time_t rpt = read_processor_time ();
+ if (vp <= 0) {
+ vblank_prev_time2 = rpt;
+ } else {
+ vblank_prev_time2 = rpt - (vblankbasefull * vp / maxscanline) / (vblank_skipeveryother ? 2 : 1 );
+ }
+ vblank_first_time = true;
+ }
+ if (vp <= 0) {
sleep_millis (1);
continue;
}
+ vblank_prev_time = vblank_prev_time2;
+ vblank_first_time = false;
+ firstvblankbasewait2 = false;
prevvblankpos = 0;
+ doflipped = false;
if (vblank_skipeveryother) // wait for first vblank in skip frame mode (100Hz+)
vblankthread_mode = VBLANKTH_ACTIVE_SKIPFRAME;
else
vblankthread_mode = VBLANKTH_ACTIVE;
- } else if (vblankthread_mode == VBLANKTH_ACTIVE_SKIPFRAME) {
+ } else if (mode == VBLANKTH_ACTIVE_SKIPFRAME) {
int vp;
sleep_millis (1);
getvblankpos (&vp);
if (vp >= maxscanline / 2)
vblankthread_mode = VBLANKTH_ACTIVE_SKIPFRAME2;
- } else if (vblankthread_mode == VBLANKTH_ACTIVE_SKIPFRAME2) {
+ if (read_processor_time () - vblank_prev_time2 > vblankbasefull * 2)
+ vblankthread_mode = VBLANKTH_ACTIVE;
+ } else if (mode == VBLANKTH_ACTIVE_SKIPFRAME2) {
int vp;
sleep_millis (1);
getvblankpos (&vp);
- if (vp < maxscanline / 2)
+ if (vp > 0 && vp < maxscanline / 2) {
+ prevvblankpos = 0;
vblankthread_mode = VBLANKTH_ACTIVE;
- } else if (vblankthread_mode == VBLANKTH_ACTIVE) {
+ }
+ if (read_processor_time () - vblank_prev_time2 > vblankbasefull * 2)
+ vblankthread_mode = VBLANKTH_ACTIVE;
+ } else if (mode == VBLANKTH_ACTIVE) {
// busy wait mode
frame_time_t t = read_processor_time ();
bool donotwait = false;
bool end = false;
+ bool vblank_found_rtg2 = false;
+ bool vblank_found2 = false;
+ frame_time_t thread_vblank_time2 = 0;
int vs = isvsync_chipset ();
// immediate vblank if mismatched frame type
if (vs < 0 && vblanklaceskip ()) {
- vblank_found = true;
+ vblank_found2 = true;
vblank_found_chipset = true;
end = true;
- } else if (t - vblank_prev_time > vblankbasewait2) {
+ } else if (t - vblank_prev_time2 > vblankbasewait2) {
int vp = 0;
bool vb = false;
bool ok;
if (firstvblankbasewait2 == false) {
firstvblankbasewait2 = true;
vblank_getstate (&vb, &vp);
- if (!dooddevenskip && ap->gfx_vflip > 0) {
- doflipevent ();
- }
+ }
+ if (!doflipped && !dooddevenskip && ap->gfx_vflip > 0) {
+ doflipevent ();
+ doflipped = true;
}
ok = vblank_getstate (&vb, &vp);
if (!ok || vb) {
- thread_vblank_time = t;
+ thread_vblank_time2 = t;
if (vs < 0) {
vblank_found_chipset = true;
if (!ap->gfx_vflip) {
show_screen ();
}
}
- vblank_found_rtg = true;
- vblank_found = true;
+ vblank_found_rtg2 = true;
+ vblank_found2 = true;
end = true;
}
- if (t - vblank_prev_time > vblankbasewait3)
+ if (t - vblank_prev_time2 > vblankbasewait3)
donotwait = true;
}
- if (t - vblank_prev_time > vblankbasefull * 2) {
- thread_vblank_time = t;
- vblank_found = true;
- vblank_found_rtg = true;
+ if (!end && t - vblank_prev_time2 > vblankbasefull * 2) {
+ thread_vblank_time2 = t;
+ vblank_found2 = true;
+ vblank_found_rtg2 = true;
vblank_found_chipset = true;
end = true;
}
if (end) {
+ if (!dooddevenskip && ap->gfx_vflip > 0 && !doflipped) {
+ doflipevent ();
+ doflipped = true;
+ }
+ thread_vblank_time = thread_vblank_time2;
+ vblank_found_rtg = vblank_found_rtg2;
+ vblank_found = vblank_found2;
vblankthread_mode = VBLANKTH_ACTIVE_WAIT;
} else if (!donotwait || ap->gfx_vflip || picasso_on) {
- sleep_millis (ap->gfx_vflip && currprefs.m68k_speed >= 0 ? 2 : 1);
+// } else if (!donotwait || picasso_on) {
+ sleep_millis (1);
}
} else {
break;
return 0;
}
-#if 0
-static void vsync_notvblank (void)
+frame_time_t vsync_busywait_end (void)
{
+ frame_time_t prev;
for (;;) {
- int vp;
- if (!getvblankpos (&vp))
- return;
- if (vp > 0) {
- //write_log (_T("%d "), vpos);
+ int v = vblankthread_mode;
+ if (v != VBLANKTH_ACTIVE_START && v != VBLANKTH_ACTIVE_SKIPFRAME && v != VBLANKTH_ACTIVE_SKIPFRAME2)
break;
- }
- vsync_sleep (true);
- }
-}
-#endif
-frame_time_t vsync_busywait_end (void)
-{
- while (vblankthread_mode == VBLANKTH_ACTIVE_START || vblankthread_mode == VBLANKTH_ACTIVE_SKIPFRAME || vblankthread_mode == VBLANKTH_ACTIVE_SKIPFRAME2) {
sleep_millis_main (1);
}
+ prev = vblank_prev_time;
if (!dooddevenskip) {
- while (!vblank_found && vblankthread_mode == VBLANKTH_ACTIVE) {
- vsync_sleep (currprefs.m68k_speed < 0 && currprefs.m68k_speed_throttle == 0);
+ while (vblankthread_mode == VBLANKTH_ACTIVE) {
+ vsync_sleep (currprefs.m68k_speed < 0 || currprefs.m68k_speed_throttle < 0);
}
}
changevblankthreadmode_fast (VBLANKTH_ACTIVE_WAIT);
- return thread_vblank_time;
+ return prev + vblankbasefull;
}
void vsync_busywait_start (void)
{
-#if 0
- struct apmode *ap = picasso_on ? &currprefs.gfx_apmode[1] : &currprefs.gfx_apmode[0];
- if (!dooddevenskip) {
- vsync_notvblank ();
- if (ap->gfx_vflip > 0) {
- doflipevent ();
- }
- }
-#endif
- vblank_prev_time = thread_vblank_time;
- vblank_first_time = false;
+ if (vblankthread_mode != VBLANKTH_ACTIVE_WAIT)
+ write_log (L"low latency vsync state mismatch %d\n", vblankthread_mode);
changevblankthreadmode_fast (VBLANKTH_ACTIVE_START);
}
while (!framelost && read_processor_time () - prevtime < vblankbasewait1) {
vsync_sleep (false);
}
- v = vblank_wait ();
+ int vp = vblank_wait ();
+ if (vp >= -1) {
+ vblank_prev_time = read_processor_time ();
+ if (vp > 0)
+ vblank_prev_time -= (vblankbasefull * vp / maxscanline) / (vblank_skipeveryother ? 2 : 1 );
+ v = true;
+ }
} else {
v = true;
+ vblank_prev_time = read_processor_time ();
}
framelost = false;
-
}
if (v) {
- vblank_prev_time = read_processor_time ();
frame_counted++;
return true;
}
while (rv) {
if (rv->width == width && rv->height == height && rv->depth == depth && rv->rate == rate && rv->mode == mode && rv->rtg == picasso_on) {
approx_vblank = rv->remembered_rate2;
- rval = rv->remembered_rate;
+ tsum = rval = rv->remembered_rate;
maxscanline = rv->maxscanline;
maxvpos = rv->maxvpos;
lace = rv->lace;
tsum /= total;
}
-skip:
if (waitonly)
tsum = approx_vblank;
+skip:
vblank_skipeveryother = false;
getvsyncrate (tsum, &mult);
vblankbasefull = (syncbase / tsum2);
vblankbasewait1 = (syncbase / tsum2) * 75 / 100;
vblankbasewait2 = (syncbase / tsum2) * 55 / 100;
- vblankbasewait3 = (syncbase / tsum2) * 99 / 100 - syncbase / 500; // at least 2ms before vblank
+ vblankbasewait3 = (syncbase / tsum2) * 99 / 100 - syncbase / (250 * (vblank_skipeveryother ? 1 : 2)); // at least 2ms before vblank
vblankbaselace = lace;
write_log (_T("VSync %s: %.6fHz/%.1f=%.6fHz. MinV=%d MaxV=%d%s Units=%d %.1f%%\n"),
waitonly ? _T("remembered") : _T("calibrated"), tsum, div, tsum2,
bool iscustom = false;
TCHAR custom[MAX_DPATH];
- if (!_tcscmp (inputdevice_get_eventinfo (INPUTEVENT_SPC_CUSTOM_EVENT)->name, eventnames[input_selected_event])) {
+ if (eventnames[input_selected_event] && !_tcscmp (inputdevice_get_eventinfo (INPUTEVENT_SPC_CUSTOM_EVENT)->name, eventnames[input_selected_event])) {
doinputcustom (hDlg, 1);
iscustom = true;
}
LRESULT item;
TCHAR tmp[100];
int i;
- static int filteroverlaypos;
+ static int filteroverlaypos = -1;
switch (msg)
{
}
SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_RESETCONTENT, 0, 0L);
- SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)_T("Overlays"));
- SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)_T("Masks"));
+ WIN32GUI_LoadUIString (IDS_FILTEROVERLAYTYPE_OVERLAYS, tmp, sizeof tmp / sizeof (TCHAR));
+ SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)tmp);
+ WIN32GUI_LoadUIString (IDS_FILTEROVERLAYTYPE_MASKS, tmp, sizeof tmp / sizeof (TCHAR));
+ SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)tmp);
+ if (filteroverlaypos < 0) {
+ if (!workprefs.gfx_filteroverlay[0])
+ filteroverlaypos = 1;
+ else
+ filteroverlaypos = 0;
+ }
SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_SETCURSEL, filteroverlaypos, 0);
enable_for_hw3ddlg (hDlg);
<ClCompile Include="..\..\moduleripper.cpp" />
</ItemGroup>
<ItemGroup>
- <None Include="..\..\..\..\..\Users\Toni\Desktop\winuaebootlog.txt" />
<None Include="..\resources\35floppy.ico" />
<None Include="..\resources\amigainfo.ico" />
<None Include="..\resources\avioutput.ico" />
<None Include="..\resources\drive_spinnd.wav" />
<None Include="..\resources\drive_startup.wav" />
<None Include="..\resources\resource" />
- <None Include="..\..\..\..\..\Users\Toni\Desktop\winuaebootlog.txt">
- <Filter>common</Filter>
- </None>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\resources\winuae.rc">
- restore only single input target to default.
- hdd from command line
+Beta 12: (RC1)
+
+- Ignore sprite 0 (normally mouse pointer) when calculating autoscale position and size.
+- Custom Input event editor usually crashed.
+- CD32 boot screen autoscale improved.
+- b10 "show drives that require admin privileges" hide drives that also have drive letter.
+ Background info: for some strange reason USB memory card adapters have two devices, one (without drive letter) that can't
+ be accessed without admin privileges and drive letter device that can be accessed.
+- Fastest possible CPU + low latency vsync and double frame mode (85Hz+) jitter fixed.
+- "Masks" in filter panel is selected by default, "Overlays" is only selected if overlay image is already configured.
+- Possible fix for D3D mask alignment errors in some scaling settings.
+
Beta 11:
- Adjusted Fastest Possible timing a bit more..