From 719132e49f7b0363e3ef01ad91aaf296581e08ce Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 16 May 2009 10:06:33 +0300 Subject: [PATCH] imported winuaesrc1600b29.zip --- audio.c | 2 + custom.c | 2 +- epsonprinter.c | 24 ++-- od-win32/cloanto/RetroPlatformGuestIPC.c | 2 +- od-win32/direct3d.c | 2 +- od-win32/lcd.c | 2 +- od-win32/rp.c | 2 +- od-win32/screenshot.c | 2 +- od-win32/sounddep/sound.c | 9 +- od-win32/win32.c | 2 +- od-win32/win32.h | 8 +- od-win32/win32_scale2x.c | 167 ++++++++++++++--------- od-win32/win32gfx.c | 54 +++++--- od-win32/winuaechangelog.txt | 12 ++ 14 files changed, 181 insertions(+), 109 deletions(-) diff --git a/audio.c b/audio.c index 82e7615d..8662d4a4 100644 --- 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; diff --git a/custom.c b/custom.c index b032a6c9..232449c4 100644 --- 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; diff --git a/epsonprinter.c b/epsonprinter.c index c4176564..f70dbf33 100644 --- a/epsonprinter.c +++ b/epsonprinter.c @@ -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) diff --git a/od-win32/cloanto/RetroPlatformGuestIPC.c b/od-win32/cloanto/RetroPlatformGuestIPC.c index 8a652a03..278b13df 100644 --- a/od-win32/cloanto/RetroPlatformGuestIPC.c +++ b/od-win32/cloanto/RetroPlatformGuestIPC.c @@ -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); diff --git a/od-win32/direct3d.c b/od-win32/direct3d.c index 2c816853..e2bffc09 100644 --- a/od-win32/direct3d.c +++ b/od-win32/direct3d.c @@ -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; diff --git a/od-win32/lcd.c b/od-win32/lcd.c index 480d6dee..fc4221fc 100644 --- a/od-win32/lcd.c +++ b/od-win32/lcd.c @@ -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; } diff --git a/od-win32/rp.c b/od-win32/rp.c index 089b4248..6e3d4c62 100644 --- a/od-win32/rp.c +++ b/od-win32/rp.c @@ -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); diff --git a/od-win32/screenshot.c b/od-win32/screenshot.c index 09bd5d34..e16406be 100644 --- a/od-win32/screenshot.c +++ b/od-win32/screenshot.c @@ -88,7 +88,7 @@ void screenshot_free(void) } -int screenshot_prepare(void) +int screenshot_prepare (void) { unsigned int width, height; HGDIOBJ hgdiobj; diff --git a/od-win32/sounddep/sound.c b/od-win32/sounddep/sound.c index 5e7215f7..46cb251a 100644 --- a/od-win32/sounddep/sound.c +++ b/od-win32/sounddep/sound.c @@ -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; diff --git a/od-win32/win32.c b/od-win32/win32.c index fbbe2713..7aac0c22 100644 --- a/od-win32/win32.c +++ b/od-win32/win32.c @@ -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; } diff --git a/od-win32/win32.h b/od-win32/win32.h index 44994c4f..86d0dc6f 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,11 +15,11 @@ #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 diff --git a/od-win32/win32_scale2x.c b/od-win32/win32_scale2x.c index 36c4e593..198c9448 100644 --- a/od-win32/win32_scale2x.c +++ b/od-win32/win32_scale2x.c @@ -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; diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index b87627a4..f09b88f4 100644 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -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) { diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 48e5180b..66d72b6b 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -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 -- 2.47.3