]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
imported winuaesrc1600b29.zip
authorToni Wilen <twilen@winuae.net>
Sat, 16 May 2009 07:06:33 +0000 (10:06 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 22 Feb 2010 19:46:23 +0000 (21:46 +0200)
14 files changed:
audio.c
custom.c
epsonprinter.c
od-win32/cloanto/RetroPlatformGuestIPC.c
od-win32/direct3d.c
od-win32/lcd.c
od-win32/rp.c
od-win32/screenshot.c
od-win32/sounddep/sound.c
od-win32/win32.c
od-win32/win32.h
od-win32/win32_scale2x.c
od-win32/win32gfx.c
od-win32/winuaechangelog.txt

diff --git a/audio.c b/audio.c
index 82e7615db715a14b503372890826ded14096f979..8662d4a47d82c94471d3c396232564485264a998 100644 (file)
--- a/audio.c
+++ b/audio.c
@@ -1455,6 +1455,8 @@ void set_audio (void)
     }
 
     sep = (currprefs.sound_stereo_separation = changed_prefs.sound_stereo_separation) * 3 / 2;
+    if (sep >= 15)
+       sep = 16;
     delay = currprefs.sound_mixed_stereo_delay = changed_prefs.sound_mixed_stereo_delay;
     mixed_mul1 = MIXED_STEREO_SCALE / 2 - sep;
     mixed_mul2 = MIXED_STEREO_SCALE / 2 + sep;
index b032a6c9dc908379fa0b2f79615c03705b87dd40..232449c4ebaf83d14efea8340a20bcd7b3654c6c 100644 (file)
--- a/custom.c
+++ b/custom.c
@@ -3215,7 +3215,7 @@ static void BPLxPTL (int hpos, uae_u16 v, int num)
     }
 
     // hack until bitplane pipelin is properly emulated
-    if (fetchmode == 0 && fetch_state != fetch_not_started && diwstate == DIW_waiting_stop && f_fm_maxplane == 8) {
+    if (fetchmode == 0 && fetch_state != fetch_not_started && diwstate == DIW_waiting_stop && f_fm_maxplane == 8 && t_bplcon0_planes > 1 && td_bplcon0_res == 0) {
         if (hpos > plfstrt && hpos <= plfstrt + 7) {
            if (num == 1 && hpos <= plfstrt + 2)
                delta = 2;
index c41765645e0c127dd6adc603cb09254aa34c796a..f70dbf33e4080cfa5244b78ebae115bf51700ef8 100644 (file)
@@ -367,15 +367,15 @@ static const Bit16u intCharSets[15][12] =
        {0x0023, 0x0024, 0x00e0, 0x00ba, 0x00e7, 0x00a7, 0x005e, 0x0060, 0x00e9, 0x00f9, 0x00e8, 0x00a8}, // France
        {0x0023, 0x0024, 0x00a7, 0x00c4, 0x00d6, 0x00dc, 0x005e, 0x0060, 0x00e4, 0x00f6, 0x00fc, 0x00df}, // Germany
        {0x00a3, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // UK
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
-       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Denmark I
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Sweden
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Italy
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Spain
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Japan
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Norway
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Denmark II
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Spain II
+       {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e}, // Latin America
        {0x0023, 0x0024, 0x0040, 0x005b, 0x005c, 0x005d, 0x005e, 0x0060, 0x007b, 0x007c, 0x007d, 0x007e},
        {0x0023, 0x0024, 0x00a7, 0x00c4, 0x0027, 0x0022, 0x00b6, 0x0060, 0x00a9, 0x00ae, 0x2020, 0x2122} // Legal
 };
@@ -1755,7 +1755,11 @@ static void printBitGraph(Bit8u ch)
        bitGraph.readBytesColumn = 0;
 
        // Advance to the left
-       curX += (Real64)1/(Real64)bitGraph.horizDens;
+       if (bitGraph.adjacent == false)
+           curX += (Real64)0.5/(Real64)bitGraph.horizDens;
+       else
+           curX += (Real64)1/(Real64)bitGraph.horizDens;
+
 }
 
 static void blitGlyph(FT_Bitmap bitmap, Bit16u destx, Bit16u desty, int add)
index 8a652a036a5e0cd4a83225d0ad88eecf89f86ecc..278b13df98e09bd85aad2bee541146dfd4a1b936 100644 (file)
@@ -58,7 +58,7 @@ HRESULT RPInitializeGuest(RPGUESTINFO *pInfo, HINSTANCE hInstance, LPCTSTR pszHo
 
        // find the host message window
        //
-       pszHostClass = (_TCHAR *)LocalAlloc(LMEM_FIXED, _tcslen(g_szHostWndClass) + _tcslen(pszHostInfo) + 1);
+       pszHostClass = (_TCHAR *)LocalAlloc(LMEM_FIXED, (_tcslen(g_szHostWndClass) + _tcslen(pszHostInfo) + 1) * sizeof (_TCHAR));
        if (!pszHostClass)
                return E_OUTOFMEMORY;
        wsprintf(pszHostClass, g_szHostWndClass, pszHostInfo);
index 2c8168534305456bd5d6325d197513b64f71ff0e..e2bffc09db5f1876399c17e7461fe4fa80939111 100644 (file)
@@ -1079,7 +1079,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth
     dpp.BackBufferFormat = mode.Format;
     dpp.BackBufferCount = 1;
     dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
-    dpp.Flags = dpp.Windowed ? 0 : D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
+    dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
     dpp.BackBufferWidth = w_w;
     dpp.BackBufferHeight = w_h;
     dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
index 480d6dee14df77525677fd4041f0ce0f43f65beb..fc4221fc253312aa72db8187646cd3ab22a42ef1 100644 (file)
@@ -94,7 +94,7 @@ static int lcd_init (void)
     memcpy (origbitmap, bitmap, desc.Width * desc.Height);
     DeleteDC (dc);
 
-    write_log (L"LCD: Logitech LCD system initialized\n");
+    write_log (L"LCD: '%s' enabled\n", desc.deviceDisplayName);
     return 1;
 }
 
index 089b4248f7c7b9376aa159c6ab3c7b78197ad061..6e3d4c62991ffb4997b641c64e7c60fe667c9e8b 100644 (file)
@@ -642,7 +642,7 @@ HRESULT rp_init (void)
 {
     HRESULT hr;
 
-    hr = RPInitializeGuest(&guestinfo, hInst, rp_param, RPHostMsgFunction, 0);
+    hr = RPInitializeGuest (&guestinfo, hInst, rp_param, RPHostMsgFunction, 0);
     if (SUCCEEDED (hr)) {
        initialized = TRUE;
        write_log (L"rp_init('%s') succeeded\n", rp_param);
index 09bd5d34f27e4b904e2b1974dfe1e13fb575d136..e16406be41e105e193351422ad9146eb8d0b0661 100644 (file)
@@ -88,7 +88,7 @@ void screenshot_free(void)
 }
 
 
-int screenshot_prepare(void)
+int screenshot_prepare (void)
 {
     unsigned int width, height;
     HGDIOBJ hgdiobj;
index 5e7215f70cb0cecbfd858024f4c35e31936c9261..46cb251a99139dce84d40844889e91744c4e7940 100644 (file)
@@ -453,23 +453,24 @@ static int open_audio_pa (struct sound_data *sd, int index)
     const PaDeviceInfo *di;
     PaStreamParameters p;
     PaError err;
+    TCHAR *name;
 
     size = sd->sndbufsize;
     s->paframesperbuffer = size;
     sd->sndbufsize = size * ch * 2;
     sd->devicetype = SOUND_DEVICE_PA;
     memset (&p, 0, sizeof p);
+    di = Pa_GetDeviceInfo (dev);
     p.channelCount = ch;
     p.device = dev;
     p.hostApiSpecificStreamInfo = NULL;
     p.sampleFormat = paInt16;
-    p.suggestedLatency = Pa_GetDeviceInfo (dev)->defaultLowOutputLatency;
+    p.suggestedLatency = di->defaultLowOutputLatency;
     p.hostApiSpecificStreamInfo = NULL; 
     for (;;) {
        err = Pa_IsFormatSupported (NULL, &p, freq);
        if (err == paFormatIsSupported)
            break;
-       di = Pa_GetDeviceInfo (dev);
        if (freq < 48000) {
            freq = 48000;
            err = Pa_IsFormatSupported (NULL, &p, freq);
@@ -497,6 +498,10 @@ static int open_audio_pa (struct sound_data *sd, int index)
     s->paevent = CreateEvent (NULL, FALSE, FALSE, NULL);
     for (i = 0; i < 2; i++)
        s->pasoundbuffer[i] = xcalloc (sd->sndbufsize, 1);
+    name = au (di->name);
+    write_log (L"PASOUND: CH=%d,FREQ=%d (%s) '%s' buffer %d\n",
+       ch, freq, sound_devices[index].name, name, sd->sndbufsize);
+    xfree (name);
     return 1;
 end:
     s->pastream = NULL;
index fbbe2713d6ce2ab2e23cb27a00c05e3b1a157236..7aac0c22dccfb40c893f0850644d197cf7e63661 100644 (file)
@@ -1246,7 +1246,7 @@ static int canstretch (void)
        return 0;
     if (!WIN32GFX_IsPicassoScreen ())
        return 1;
-    if (currprefs.win32_rtgallowscaling)
+    if (currprefs.win32_rtgallowscaling || currprefs.win32_rtgscaleaspectratio)
        return 1;
     return 0;
 }
index 44994c4f7a643be5093c403538f0f5f88d7e0bac..86d0dc6fbe7c0e9880625e311de135004e1fa648 100644 (file)
 #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
 #define GETBDD(x) ((x) % 100)
 
-#define WINUAEPUBLICBETA 1
+#define WINUAEPUBLICBETA 0
 
-#define WINUAEBETA L"28"
-#define WINUAEDATE MAKEBD(2009, 5, 9)
-#define WINUAEEXTRA L""
+#define WINUAEBETA L"29"
+#define WINUAEDATE MAKEBD(2009, 5, 16)
+#define WINUAEEXTRA L"RC2"
 #define WINUAEREV L""
 
 #define IHF_WINDOWHIDDEN 6
index 36c4e5932575106d53f6b5ce431b65ae1142ddef..198c944836dd0958ded98ff17d054c6f77e6e450 100644 (file)
@@ -74,6 +74,23 @@ static int vblscale (int v)
     static int o;
     int n;
 
+    n = (beamcon0 & 0x80) + maxvpos;
+    if (n != o)
+       cleartemp = 1;
+    o = n;
+    if (beamcon0 & 0x80)
+       return v;
+    if (currprefs.ntscmode)
+       v = v * maxvpos / MAXVPOS_NTSC;
+    else
+       v = v * maxvpos / MAXVPOS_PAL;
+    return v;
+}
+static int vblscale2 (int v)
+{
+    static int o;
+    int n;
+
     n = (beamcon0 & 0x80) + maxvpos;
     if (n != o)
        cleartemp = 1;
@@ -106,18 +123,34 @@ static void sizeoffset (RECT *dr, RECT *zr, int w, int h)
     OffsetRect (zr, w / 2, h / 2);
 }
 
+static void xymult (int *x, int *y)
+{
+    int mult = currprefs.gfx_resolution - (currprefs.gfx_linedbl ? 1 : 0);
+    if (mult < 0)
+       *x *= 1 << (-mult);
+    else
+       *y *= 1 << mult;
+}
+
+static int ppp = 320;
+
 void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height, int aw, int ah, int scale, int temp_width, int temp_height)
 {
+    float srcratio, dstratio;
     int aws, ahs, ahs2;
     int xs, ys;
-    int xmult, ymult;
+    float xmult, ymult;
     int v;
-
+    int extraw, extrah;
+    
     getinit ();
     ahs2 = vblscale (ah) * scale;
     aws = aw * scale;
     ahs = ah * scale;
 
+    extraw = -aws * currprefs.gfx_filter_horiz_zoom / 2000;
+    extrah = -ahs * currprefs.gfx_filter_vert_zoom / 2000;
+
     SetRect (sr, 0, 0, dst_width, dst_height);
     SetRect (zr, 0, 0, 0, 0);
     dr->left = (temp_width - aws) /2;
@@ -132,24 +165,27 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
 
     xmult = currprefs.gfx_filter_horiz_zoom_mult;
     ymult = currprefs.gfx_filter_vert_zoom_mult;
+
+    srcratio = 4.0 / 3.0;
+    if (currprefs.gfx_filter_aspect > 0) {
+        dstratio = (currprefs.gfx_filter_aspect >> 8) * 1.0 / (currprefs.gfx_filter_aspect & 0xff);
+    } else if (currprefs.gfx_filter_aspect < 0 && deskw > 0 && deskh > 0) {
+        dstratio = 1.0 * deskw / deskh;
+    } else {
+        dstratio = srcratio;
+    }
+
     if (currprefs.gfx_filter_autoscale) {
        int cw, ch, cx, cy, cv;
-       int extraw = currprefs.gfx_filter_horiz_zoom;
-       int extrah = currprefs.gfx_filter_vert_zoom;
        static int oxmult, oymult;
 
        filterxmult = 1000 / scale;
        filterymult = 1000 / scale;
 
-       xmult = 1000;
-       ymult = 1000;
         cv = get_custom_limits (&cw, &ch, &cx, &cy);
        if (cv) {
            int diff;
-
-           extraw = amiga_width * extraw / 2000;
-           extrah = amiga_height * extrah / 2000;
-
+       
            if (currprefs.gfx_filter_autoscale == 2 && isfullscreen () == 0) {
                int ww;
                static int lastresize = 0;
@@ -224,45 +260,32 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
            filteroffsety = -zr->top / scale;
 
            if (currprefs.gfx_filter_keep_aspect || currprefs.gfx_filter_aspect != 0) {
-               int dw = dst_width;
-               int dh = dst_height;
-               int xratio, yratio;
                int diffx = dr->right - dr->left;
                int diffy = dr->bottom - dr->top;
-       
-               xratio = 4 * 256;
-               yratio = 3 * 256;
-               if (currprefs.gfx_filter_aspect != 0) {
-                   int xm, ym, mult;
-                   if (currprefs.gfx_filter_aspect > 0) {
-                       xm = (currprefs.gfx_filter_aspect >> 8) * 256;
-                       ym = (currprefs.gfx_filter_aspect & 0xff) * 256;
-                   } else if (deskw > 0 && deskh > 0) {
-                       xm = deskw * 256;
-                       ym = deskh * 256;
-                   } else {
-                       xm = xratio;
-                       ym = yratio;
-                   }
-                   mult = currprefs.gfx_resolution - (currprefs.gfx_linedbl ? 1 : 0);
-                   if (mult < 0)
-                       xm *= 1 << (-mult);
-                   else
-                       ym *= 1 << mult;
-                   xratio *= ym / 256;
-                   yratio *= xm / 256;
+               float xmult = 1.0;
+               float ymult = 1.0;
+
+               if (currprefs.gfx_filter_keep_aspect) {
+                   dstratio = dstratio * (aws * 1.0 / ahs2) / (cw * 1.0 / ch);
+                   if (currprefs.ntscmode)
+                       dstratio = dstratio * 1.2;
                }
 
-               if (xratio < yratio) {
-                   diff = diffx - diffx * xratio / yratio;
-                   sizeoffset (dr, zr, -diff, 0);
-                   filteroffsetx += (diff * cw / dst_width) / 2;
+               if (srcratio > dstratio) {
+                   ymult = ymult * srcratio / dstratio;
                } else {
-                   diff = diffx - diffx * yratio / xratio;
-                   sizeoffset (dr, zr, 0, -diff);
-                   filteroffsety += diff / 2;
+                   xmult = xmult * dstratio / srcratio;
                }
+
+               diff = diffx - diffx * xmult;
+               sizeoffset (dr, zr, diff, 0);
+               filteroffsetx += diff / 2;
+
+               diff = diffy - diffy * ymult;
+               sizeoffset (dr, zr, 0, diff);
+               filteroffsety += diff / 2;
            }
+
            diff = dr->right - dr->left;
            filterxmult = diff * 1000 / (dst_width * scale);
            diff = dr->bottom - dr->top;
@@ -270,37 +293,42 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
            return;
        }
     }
-    
-    if (currprefs.gfx_filter_keep_aspect && !xmult && !ymult) {
-        xmult = aws * 1000 / dst_width;
-        ymult = ahs * 1000 / dst_height;
-       if (xmult < ymult)
-           xmult = ymult;
-       else
-           ymult = xmult;
-    } else {
-       if (xmult <= 0)
+  
+    if (!currprefs.gfx_filter_horiz_zoom_mult && !currprefs.gfx_filter_vert_zoom_mult) {
+
+       sizeoffset (dr, zr, extraw, extrah);
+
+       if (currprefs.gfx_filter_keep_aspect) {
+           float xm, ym, m;
+
+           xm = 1.0 * aws / dst_width;
+           ym = 1.0 * ahs / dst_height;
+           if (xm < ym)
+               xm = ym;
+           else
+               ym = xm;
+           xmult = ymult = xm * 1000.0;
+
+           m = (aws * 1.0 / dst_width) / (ahs * 1.0 / dst_height);
+           dstratio = dstratio * m;
+       }
+
+    }
+
+    if (xmult <= 0.01 || ymult <= 0.01) {
+
+       if (xmult <= 0.01)
            xmult = aws * 1000 / dst_width;
        else
            xmult = xmult + xmult * currprefs.gfx_filter_horiz_zoom / 2000;
-       if (ymult <= 0)
+       if (ymult <= 0.01)
            ymult = ahs * 1000 / dst_height;
        else
            ymult = ymult + ymult * currprefs.gfx_filter_vert_zoom / 2000;
+
     }
-    
+
     if (currprefs.gfx_filter_aspect != 0) {
-       int srcratio, dstratio;
-       int xmult2 = xmult;
-       int ymult2 = ymult;
-       srcratio = 4 * 256 / 3;
-       if (currprefs.gfx_filter_aspect > 0) {
-           dstratio = (currprefs.gfx_filter_aspect >> 8) * 256 / (currprefs.gfx_filter_aspect & 0xff);
-       } else if (deskw > 0 && deskh > 0) {
-           dstratio = deskw * 256 / deskh;
-       } else {
-           dstratio = srcratio;
-       }
        if (srcratio > dstratio) {
            ymult = ymult * srcratio / dstratio;
        } else {
@@ -308,7 +336,15 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
        }
     }
 
+    if (!currprefs.gfx_filter_horiz_zoom_mult && !currprefs.gfx_filter_vert_zoom_mult && currprefs.ntscmode) {
+       int v = vblscale2 (ahs);
+       ymult /= 1.2;
+       OffsetRect (dr, 0, (v - ahs2) / 2);
+    }
+
+
     ymult = vblscale (ymult);
+    OffsetRect (dr, 0, (ahs2 - ahs) / 2);
 
     v = currprefs.gfx_filter ? currprefs.gfx_filter_horiz_offset : 0;
     OffsetRect (zr, (int)(-v * aws / 1000.0), 0);
@@ -317,7 +353,6 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height
 
     xs = dst_width - dst_width * xmult / 1000;
     ys = dst_height - dst_height * ymult / 1000;
-    OffsetRect (dr, 0, (ahs2 - ahs) / 2);
     sizeoffset (dr, zr, xs, ys);
 
     filterxmult = xmult;
index b87627a4f50ce3c2e518f342ced23ca60c2aa2f0..f09b88f416599afcaca9ba6e915917b8ab0df683 100644 (file)
@@ -78,7 +78,7 @@
 #define SM_NONE 11
 
 struct uae_filter *usedfilter;
-int scalepicasso;
+static int scalepicasso;
 
 struct winuae_currentmode {
     unsigned int flags;
@@ -892,33 +892,38 @@ static void DX_Blit96 (int x, int y, int w, int h)
     picasso_offset_my = 1000;
     if (scalepicasso) {
        int srcratio, dstratio;
+       int srcwidth, srcheight;
+
+       if (scalepicasso < 0) {
+           srcwidth = picasso96_state.Width;
+           srcheight = picasso96_state.Height;
+       } else {
+           srcwidth = currentmode->native_width;
+           srcheight = currentmode->native_height;
+       }
+
        SetRect (&sr, 0, 0, picasso96_state.Width, picasso96_state.Height);
        if (currprefs.win32_rtgscaleaspectratio < 0) {
            // automatic
            srcratio = picasso96_state.Width * 256 / picasso96_state.Height;
-           dstratio = currentmode->native_width * 256 / currentmode->native_height;
+           dstratio = srcwidth * 256 / srcheight;
        } else if (currprefs.win32_rtgscaleaspectratio == 0) {
            // none
            srcratio = dstratio = 0;
        } else {
            // manual
-           if (isfullscreen () == 0) {
-               dstratio = currentmode->native_width * 256 / currentmode->native_height;
-               srcratio = (currprefs.win32_rtgscaleaspectratio >> 8) * 256 / (currprefs.win32_rtgscaleaspectratio & 0xff);
-           } else {
-               srcratio = picasso96_state.Width * 256 / picasso96_state.Height;
-               dstratio = (currprefs.win32_rtgscaleaspectratio >> 8) * 256 / (currprefs.win32_rtgscaleaspectratio & 0xff);
-           }
+           srcratio = (currprefs.win32_rtgscaleaspectratio >> 8) * 256 / (currprefs.win32_rtgscaleaspectratio & 0xff);
+           dstratio = srcwidth * 256 / srcheight;
        }
        if (srcratio == dstratio) {
-           SetRect (&dr, 0, 0, currentmode->native_width, currentmode->native_height);
+           SetRect (&dr, 0, 0, srcwidth, srcheight);
        } else if (srcratio > dstratio) {
-           int yy = currentmode->native_height - currentmode->native_height * dstratio / srcratio;
-           SetRect (&dr, 0, yy / 2, currentmode->native_width, currentmode->native_height - yy / 2);
+           int yy = srcheight - srcheight * dstratio / srcratio;
+           SetRect (&dr, 0, yy / 2, srcwidth, srcheight - yy / 2);
            picasso_offset_y = yy / 2;
        } else {
-           int xx = currentmode->native_width - currentmode->native_width * srcratio / dstratio;
-           SetRect (&dr, xx / 2, 0, currentmode->native_width - xx / 2, currentmode->native_height);
+           int xx = srcwidth - srcwidth * srcratio / dstratio;
+           SetRect (&dr, xx / 2, 0,srcwidth - xx / 2, srcheight);
            picasso_offset_x = xx / 2;
        }
        picasso_offset_mx = picasso96_state.Width * 1000 / (dr.right - dr.left);
@@ -1073,6 +1078,8 @@ static void updatemodes (void)
         RECT rc = getdisplay (&currprefs)->rect;
         currentmode->native_width = rc.right - rc.left;
         currentmode->native_height = rc.bottom - rc.top;
+        currentmode->current_width = currentmode->native_width;
+        currentmode->current_height = currentmode->native_height;
     } else {
        currentmode->native_width = currentmode->current_width;
        currentmode->native_height = currentmode->current_height;
@@ -1121,18 +1128,25 @@ static void update_gfxparams (void)
     if (screen_is_picasso) {
        if (isfullscreen () < 0) {
            if ((currprefs.win32_rtgscaleifsmall || currprefs.win32_rtgallowscaling) && (picasso96_state.Width != currentmode->native_width || picasso96_state.Height != currentmode->native_height))
-               scalepicasso = -1;
+               scalepicasso = 1;
+           if (!scalepicasso && currprefs.win32_rtgscaleaspectratio)
+               scalepicasso = -1;
        } else if (isfullscreen () > 0) {
-           //if (currprefs.gfx_size.width > picasso96_state.Width && currprefs.gfx_size.height > picasso96_state.Height) {
-           if (currentmode->native_width > picasso96_state.Width && currentmode->native_height > picasso96_state.Height) {
-               if (currprefs.win32_rtgscaleifsmall && !currprefs.win32_rtgmatchdepth) // can't scale to different color depth
-                   scalepicasso = 1;
+           if (!currprefs.win32_rtgmatchdepth) { // can't scale to different color depth
+               if (currentmode->native_width > picasso96_state.Width && currentmode->native_height > picasso96_state.Height) {
+                   if (currprefs.win32_rtgscaleifsmall)
+                       scalepicasso = 1;
+               }
+               if (!scalepicasso && currprefs.win32_rtgscaleaspectratio)
+                   scalepicasso = -1;
            }
        } else if (isfullscreen () == 0) {
            if ((currprefs.gfx_size.width != picasso96_state.Width || currprefs.gfx_size.height != picasso96_state.Height) && currprefs.win32_rtgallowscaling)
                scalepicasso = 1;
            if ((currprefs.gfx_size.width > picasso96_state.Width || currprefs.gfx_size.height > picasso96_state.Height) && currprefs.win32_rtgscaleifsmall)
                scalepicasso = 1;
+           if (!scalepicasso && currprefs.win32_rtgscaleaspectratio)
+               scalepicasso = -1;
        }
 
        if (scalepicasso > 0 && (currprefs.gfx_size.width != picasso96_state.Width || currprefs.gfx_size.height != picasso96_state.Height)) {
@@ -1801,7 +1815,7 @@ int machdep_init (void)
     screen_is_picasso = 0;
     memset (currentmode, 0, sizeof (*currentmode));
 #ifdef LOGITECHLCD
-    lcd_open();
+    lcd_open ();
 #endif
 #ifdef RETROPLATFORM
     if (rp_param != NULL) {
index 48e5180b0a564e725cf7a2141a2dda2b85277ab0..66d72b6b50e81bb3537c430fb8ee5fcb7abc287a 100644 (file)
@@ -1,4 +1,16 @@
 
+Beat 29: (RC2, beta dialog removed)
+
+- Pang hack fixed, it was wrong and caused side-effects..
+- autoscale/keep aspect ratio combination fixed
+- NTSC hardware in PAL mode: shrink display (fit PAL display in NTSC
+  space) Previously NTSC was always streched but I think it is better
+  to make "base" hardware PAL/NTSC mode non-scaled. Note that PAL/NTSC
+  vertical streching/shrinking is only supported in filter modes
+- screenshots didn't work in windowed D3D modes
+- screenshot size was wrong in full-window mode
+- 100% stereo separation was only about 95% stereo separation
+
 Beta 28: (RC1)
 
 - re-added CD32 emulation hack that was removed in b4, fixes unreliable