static TCHAR *writets (void) { struct tm *t; struct _timeb tb; static TCHAR out[100]; TCHAR *p; static TCHAR lastts[100]; TCHAR curts[100]; if (bootlogmode) return NULL; if (nodatestamps) return NULL; _ftime (&tb); t = localtime (&tb.time); _tcsftime (curts, sizeof curts / sizeof (TCHAR), _T("%Y-%m-%d %H:%M:%S\n"), t); p = out; *p = 0; if (_tcsncmp (curts, lastts, _tcslen (curts) - 3)) { // "xx\n" _tcscat (p, curts); p += _tcslen (p); _tcscpy (lastts, curts); } _tcsftime (p, sizeof out / sizeof (TCHAR) - (p - out) , _T("%S-"), t); p += _tcslen (p); _stprintf (p, _T("%03d"), tb.millitm); p += _tcslen (p); if (vsync_counter != 0xffffffff) _stprintf (p, _T(" [%d %03d%s%03d]"), vsync_counter, current_hpos_safe (), lof_store ? _T("-") : _T("="), vpos); _tcscat (p, _T(": ")); return out; }
int current_hpos (void) { int hp = current_hpos_safe (); if (hp < 0 || hp > 256) { gui_message(_T("hpos = %d!?\n"), hp); hp = 0; } return hp; }