]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1600b21.zip
authorToni Wilen <twilen@winuae.net>
Tue, 31 Mar 2009 14:39:31 +0000 (17:39 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:45:42 +0000 (21:45 +0200)
cfgfile.c
custom.c
od-win32/parser.c
od-win32/win32.c
od-win32/win32.h
od-win32/winuaechangelog.txt
od-win32/writelog.c

index 347303a7499df2fa234965e6628f44d019679998..3f47b05a092a0b14f9bf4a8d51267bbd5311a905 100644 (file)
--- 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;
 }
 
index b3f5aa9b605766dfa72abcea5e637a6f77e0ba5d..1b59e6ea336c5aee061cd3d05a7914cc78eb3e09 100644 (file)
--- 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
index 582c292ab91f36b5648765ce96fb03767a5d8deb..17598af9e9e8aa91b5a67346573a8d5d5ce93175 100644 (file)
@@ -53,7 +53,7 @@
 #include <Ghostscript/errors.h>
 #include <Ghostscript/iapi.h>
 
-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);
 }
index 4722cdcf63fa4ae6497deea9116a18661424a7c4..738fb7b26c80fd504aaabdc5457498420eadc321 100644 (file)
@@ -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];
index 61c2a33dff551cc1bb34f6dce57be7a2f9a712f0..bb62f58540891f08544654cf64083161002acea2 100644 (file)
@@ -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""
 
index 7ce87a48eed025a4167376b725340d5fd37e00c4..4c19028feafd0ff41250e0f0f5489cd4d0ac6996 100644 (file)
@@ -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
index 1f46696167b43f399a12e2cbf2ba4d58092f6e2b..260aa7aeae8fffe1e201ed46ef38c82882a781ff 100644 (file)
@@ -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);