From f63ac6f674fcdc5de5009abbb3f8a24c299f1197 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Tue, 31 Mar 2009 17:39:31 +0300 Subject: [PATCH] imported winuaesrc1600b21.zip --- cfgfile.c | 6 +++++- custom.c | 2 +- od-win32/parser.c | 25 +++++++++++++------------ od-win32/win32.c | 5 ++++- od-win32/win32.h | 4 ++-- od-win32/winuaechangelog.txt | 8 ++++++++ od-win32/writelog.c | 18 +++++------------- 7 files changed, 38 insertions(+), 30 deletions(-) diff --git a/cfgfile.c b/cfgfile.c index 347303a7..3f47b05a 100644 --- a/cfgfile.c +++ b/cfgfile.c @@ -2691,6 +2691,7 @@ int cmdlineparser (TCHAR *s, TCHAR *outp[], int max) doout = 0; prev = s; j = 0; + outp[0] = 0; while (cnt < max) { TCHAR c = *s++; if (!c) @@ -2719,14 +2720,17 @@ int cmdlineparser (TCHAR *s, TCHAR *outp[], int max) } if (doout) { outp[cnt++] = my_strdup (tmp1); + outp[cnt] = 0; tmp1[0] = 0; doout = 0; j = 0; } slash = 0; } - if (j > 0 && cnt < max) + if (j > 0 && cnt < max) { outp[cnt++] = my_strdup (tmp1); + outp[cnt] = 0; + } return cnt; } diff --git a/custom.c b/custom.c index b3f5aa9b..1b59e6ea 100644 --- a/custom.c +++ b/custom.c @@ -1608,7 +1608,7 @@ STATIC_INLINE void update_fetch (int until, int fm) if (plfstate < plf_passed_stop && ddf_change != vpos && ddf_change + 1 != vpos && dma && (fetch_cycle & f_fetchstart_mask) == (f_fm_maxplane & f_fetchstart_mask) - && toscr_delay1 == toscr_delay1x && toscr_delay2 == toscr_delay2x && badmode + && toscr_delay1 == toscr_delay1x && toscr_delay2 == toscr_delay2x && !badmode # if 0 /* @@@ We handle this case, but the code would be simpler if we * disallowed it - it may even be possible to guarantee that diff --git a/od-win32/parser.c b/od-win32/parser.c index 582c292a..17598af9 100644 --- a/od-win32/parser.c +++ b/od-win32/parser.c @@ -53,7 +53,7 @@ #include #include -static char prtbuf[PRTBUFSIZE]; +static uae_char prtbuf[PRTBUFSIZE]; static int prtbufbytes,wantwrite; static HANDLE hPrt = INVALID_HANDLE_VALUE; static DWORD dwJob; @@ -130,20 +130,21 @@ static int openprinter_ps (void) if (ptr_gsapi_new_instance (&gsinstance, NULL) < 0) return 0; - tmpparms[0] = L"WinUAE"; - gsargc2 = cmdlineparser (currprefs.ghostscript_parameters, tmpparms + 1, 100 - 10) + 1; + cmdlineparser (currprefs.ghostscript_parameters, tmpparms, 100 - 10); + gsargc2 = 0; + gsparms[gsargc2++] = ua (L"WinUAE"); for (gsargc = 0; gsargv[gsargc]; gsargc++) { - gsparms[gsargc] = ua (gsargv[gsargc]); + gsparms[gsargc2++] = ua (gsargv[gsargc]); } - for (i = 0; i < gsargc; i++) + for (i = 0; tmpparms[i]; i++) gsparms[gsargc2++] = ua (tmpparms[i]); if (currprefs.prtname[0]) { _stprintf (tmp, L"-sOutputFile=%%printer%%%s", currprefs.prtname); gsparms[gsargc2++] = ua (tmp); } if (postscript_print_debugging) { - for(i = 0; i < gsargc2; i++) { + for (i = 0; i < gsargc2; i++) { TCHAR *parm = au (gsparms[i]); write_log (L"GSPARM%d: '%s'\n", i, parm); xfree (parm); @@ -175,7 +176,7 @@ static void *prt_thread (void *p) ok = 1; prt_running++; prt_started = 1; - SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL); + SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_BELOW_NORMAL); if (load_ghostscript ()) { if (openprinter_ps ()) { write_log (L"PostScript printing emulation started..\n"); @@ -193,10 +194,10 @@ static void *prt_thread (void *p) } cnt = 0; while (buffers[cnt]) { - free (buffers[cnt]); + xfree (buffers[cnt]); cnt++; } - free (buffers); + xfree (buffers); if (ok) { write_log (L"PostScript printing emulation finished..\n"); ptr_gsapi_run_string_end (gsinstance, 0, &gs_exitcode); @@ -236,7 +237,7 @@ static void flushprtbuf (void) prtbufbytes = 0; return; } else if (hPrt != INVALID_HANDLE_VALUE) { - if (WritePrinter(hPrt, prtbuf, prtbufbytes, &written)) { + if (WritePrinter (hPrt, prtbuf, prtbufbytes, &written)) { if (written != prtbufbytes) write_log (L"PRINTER: Only wrote %d of %d bytes!\n", written, prtbufbytes); } else { @@ -461,7 +462,7 @@ void flushprinter (void) closeprinter (); } -void closeprinter( void ) +void closeprinter (void) { #ifdef PRINT_DUMP zfile_fclose (prtdump); @@ -487,7 +488,7 @@ void closeprinter( void ) freepsbuffers (); } -static void putprinter (char val) +static void putprinter (uae_char val) { DoSomeWeirdPrintingStuff (val); } diff --git a/od-win32/win32.c b/od-win32/win32.c index 4722cdcf..738fb7b2 100644 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -3825,7 +3825,8 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR } #ifdef AVIOUTPUT AVIOutput_Initialize (); -#endif WIN32_HandleRegistryStuff (); +#endif + WIN32_HandleRegistryStuff (); WIN32_InitLang (); WIN32_InitHtmlHelp (); DirectDraw_Release (); @@ -4000,6 +4001,7 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer PCONTEXT ctx = pExceptionPointers->ContextRecord; /* Check possible access violation in 68010+/compatible mode disabled if PC points to non-existing memory */ +#if 1 if (ec == EXCEPTION_ACCESS_VIOLATION && !er->ExceptionFlags && er->NumberParameters >= 2 && !er->ExceptionInformation[0] && regs.pc_p) { void *p = (void*)er->ExceptionInformation[1]; @@ -4030,6 +4032,7 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer } } } +#endif #ifndef _DEBUG if (lRet == EXCEPTION_CONTINUE_SEARCH) { TCHAR path[MAX_DPATH]; diff --git a/od-win32/win32.h b/od-win32/win32.h index 61c2a33d..bb62f585 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -17,8 +17,8 @@ #define WINUAEPUBLICBETA 1 -#define WINUAEBETA L"20" -#define WINUAEDATE MAKEBD(2009, 3, 30) +#define WINUAEBETA L"21" +#define WINUAEDATE MAKEBD(2009, 3, 31) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 7ce87a48..4c19028f 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,12 @@ +Beta 21: + +- registry subsystem wasn't initialized in b20 (broke lots of things) +- postscript printing crash fixed (old bug that didn't crash so + easily in older versions..) +- slowdown introduced in b13 should be fixed (inverted comparison + when testing if current scan line can be emulated in "fast" mode) + Beta 20: (feature complete now. I think..) - added controller type to gameports panel, easier way to enable diff --git a/od-win32/writelog.c b/od-win32/writelog.c index 1f466961..260aa7ae 100644 --- a/od-win32/writelog.c +++ b/od-win32/writelog.c @@ -31,17 +31,9 @@ int always_flush_log = 0; /* console functions for debugger */ -typedef HWND (CALLBACK* GETCONSOLEWINDOW)(void); - static HWND myGetConsoleWindow (void) { - GETCONSOLEWINDOW pGetConsoleWindow; - /* Windows 2000 or newer only */ - pGetConsoleWindow = (GETCONSOLEWINDOW)GetProcAddress ( - GetModuleHandle (L"kernel32.dll"), "GetConsoleWindow"); - if (pGetConsoleWindow) - return pGetConsoleWindow (); - return NULL; + return GetConsoleWindow (); } static void open_console_window (void) @@ -219,7 +211,7 @@ static TCHAR *writets (void) if (bootlogmode) return NULL; - _ftime(&tb); + _ftime (&tb); t = localtime (&tb.time); _tcsftime (curts, sizeof curts / sizeof (TCHAR), L"%Y-%m-%d %H:%M:%S\n", t); p = out; @@ -233,7 +225,7 @@ static TCHAR *writets (void) p += _tcslen (p); _stprintf (p, L"%03d", tb.millitm); p += _tcslen (p); - if (timeframes || vpos > 0 && current_hpos () > 0) + if (timeframes || (vpos > 0 && current_hpos () > 0)) _stprintf (p, L" [%d %03dx%03d]", timeframes, current_hpos (), vpos); _tcscat (p, L": "); return out; @@ -312,7 +304,7 @@ void write_log (const TCHAR *format, ...) _ftprintf (debugfile, bufp); } lfdetected = 0; - if (_tcslen (bufp) > 0 && bufp[_tcslen(bufp) - 1] == '\n') + if (_tcslen (bufp) > 0 && bufp[_tcslen (bufp) - 1] == '\n') lfdetected = 1; va_end (parms); if (bufp != buffer) @@ -351,7 +343,7 @@ TCHAR* buf_out (TCHAR *buffer, int *bufsize, const TCHAR *format, ...) if (buffer == NULL) return 0; - count = _vsntprintf (buffer, (*bufsize)-1, format, parms); + count = _vsntprintf (buffer, (*bufsize) - 1, format, parms); va_end (parms); *bufsize -= _tcslen (buffer); return buffer + _tcslen (buffer); -- 2.47.3