]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
41020b4
authorToni Wilen <twilen@winuae.net>
Sat, 1 Apr 2023 14:11:08 +0000 (17:11 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 1 Apr 2023 14:11:08 +0000 (17:11 +0300)
od-win32/direct3d.cpp
od-win32/direct3d.h
od-win32/direct3d11.cpp
od-win32/gdirender.cpp
od-win32/rp.cpp
od-win32/win32.h
od-win32/winuaechangelog.txt

index a105e0c8b2908be6609671964cae08efe7e21c09..15b28032d9705010a757d13a022fec626fe748b6 100644 (file)
@@ -4132,9 +4132,9 @@ static bool xD3D_run(int monid)
        return false;
 }
 
-static bool xD3D_extoverlay(struct extoverlay *ext)
+static bool xD3D_extoverlay(struct extoverlay *ext, int monid)
 {
-       struct d3dstruct *d3d = &d3ddata[0];
+       struct d3dstruct *d3d = &d3ddata[monid];
        struct d3d9overlay *ov, *ovprev, *ov2;
        LPDIRECT3DTEXTURE9 s;
        D3DLOCKED_RECT locked;
index 559e860ba2cf5589e61b197102757198384f70a8..05bbfccefb7341c94814b0490fb1bce8cf9d9480 100644 (file)
@@ -34,7 +34,7 @@ extern bool(*D3D_run)(int);
 extern int(*D3D_debug)(int, int);
 extern void(*D3D_led)(int, int, int);
 extern bool(*D3D_getscanline)(int*, bool*);
-extern bool(*D3D_extoverlay)(struct extoverlay*);
+extern bool(*D3D_extoverlay)(struct extoverlay*, int);
 extern void(*D3D_paint)(void);
 
 extern LPDIRECT3DSURFACE9 D3D_capture(int, int*,int*,int*,bool);
index e449772265bc7ef12a708aece8698310f22b3322..3bded9935491c06e62765690ac15954ae936fbcf 100644 (file)
@@ -72,7 +72,7 @@ bool(*D3D_run)(int);
 int(*D3D_debug)(int, int);
 void(*D3D_led)(int, int, int);
 bool(*D3D_getscanline)(int*, bool*);
-bool(*D3D_extoverlay)(struct extoverlay*);
+bool(*D3D_extoverlay)(struct extoverlay*,int);
 void(*D3D_paint)(void);
 
 static HMODULE hd3d11, hdxgi, hd3dcompiler, dwmapi;
@@ -5303,9 +5303,9 @@ static bool xD3D11_run(int monid)
        return D3D11_resize_do(d3d);
 }
 
-static bool xD3D11_extoverlay(struct extoverlay *ext)
+static bool xD3D11_extoverlay(struct extoverlay *ext, int monid)
 {
-       struct d3d11struct *d3d = &d3d11data[0];
+       struct d3d11struct *d3d = &d3d11data[monid];
        struct d3doverlay *ov, *ovprev, *ov2;
        struct d3d11sprite *s;
        D3D11_MAPPED_SUBRESOURCE map;
index fb2195562321fcdbe5947a4aa55823b432ee479c..85973d8ab31feb37001cf5edb4811b96ebe0ab8c 100644 (file)
@@ -31,6 +31,14 @@ struct gdibm
        int pitch;
 };
 
+struct gdioverlay
+{
+       struct gdioverlay *next;
+       int id;
+       int x, y;
+       struct gdibm tex;
+};
+
 struct gdistruct
 {
        int enabled;
@@ -46,6 +54,7 @@ struct gdistruct
        struct gdibm buf;
        struct gdibm osd;
        struct gdibm cursor;
+       struct gdioverlay *extoverlays;
 
        float cursor_x, cursor_y;
        float cursor_mx, cursor_my;
@@ -365,6 +374,14 @@ static void gdi_paint(void)
                if (gdi->osd.active && gdi->osd.hbm) {
                        TransparentBlt(gdi->buf.thdc, gdi->osd.x, gdi->osd.y, gdi->ledwidth, gdi->ledheight, gdi->osd.thdc, 0, 0, gdi->ledwidth, gdi->ledheight, 0x000000);
                }
+               struct gdioverlay *ov = gdi->extoverlays;
+               while (ov) {
+                       if (ov->tex.bits) {
+                               TransparentBlt(gdi->buf.thdc, ov->x, ov->y, ov->tex.width, ov->tex.height, ov->tex.thdc, 0, 0, ov->tex.width, ov->tex.height, 0x000000);
+                       }
+                       ov = ov->next;
+               }
+
                BitBlt(gdi->hdc, 0, 0, gdi->wwidth, gdi->wheight, gdi->buf.thdc, 0, 0, SRCCOPY);
        }
 }
@@ -394,6 +411,16 @@ void gdi_free(int monid, bool immediate)
        freetexture(monid);
        freesprite(gdi, &gdi->osd);
        freesprite(gdi, &gdi->cursor);
+       struct gdioverlay *ov = gdi->extoverlays;
+       while (ov) {
+               struct gdioverlay *next = ov->next;
+               if (ov->tex.bits) {
+                       freesprite(gdi, &ov->tex);
+               }
+               xfree(ov);
+               ov = next;
+       }
+       gdi->extoverlays = NULL;
 }
 
 static const TCHAR *gdi_init(HWND ahwnd, int monid, int w_w, int w_h, int depth, int *freq, int mmulth, int mmultv, int *errp)
@@ -499,6 +526,89 @@ static uae_u8 *gdi_setcursorsurface(int monid, int *pitch)
        return NULL;
 }
 
+static bool gdi_extoverlay(struct extoverlay *ext, int monid)
+{
+       struct gdistruct *gdi = &gdidata[monid];
+       struct gdioverlay *ov, *ovprev, *ov2;
+       struct gdibm *s = NULL;
+
+       ov = gdi->extoverlays;
+       ovprev = NULL;
+       while (ov) {
+               if (ov->id == ext->idx) {
+                       s = &ov->tex;
+                       break;
+               }
+               ovprev = ov;
+               ov = ov->next;
+       }
+
+       write_log(_T("extoverlay %d: x=%d y=%d %d*%d data=%p ovl=%p\n"), ext->idx, ext->xpos, ext->ypos, ext->width, ext->height, ext->data, ov);
+
+       if (!s && (ext->width <= 0 || ext->height <= 0))
+               return false;
+
+       if (!ext->data && s && (ext->width == 0 || ext->height == 0)) {
+               ov->x = ext->xpos;
+               ov->y = ext->ypos;
+               return true;
+       }
+
+       if (ov && s) {
+               if (ovprev) {
+                       ovprev->next = ov->next;
+               } else {
+                       gdi->extoverlays = ov->next;
+               }
+               freesprite(gdi, s);
+               xfree(ov);
+               if (ext->width <= 0 || ext->height <= 0)
+                       return true;
+       }
+
+       if (ext->width <= 0 || ext->height <= 0)
+               return false;
+
+       ov = xcalloc(gdioverlay, 1);
+       if (!ov) {
+               return false;
+       }
+       if (!allocsprite(gdi, &ov->tex, ext->width, ext->height)) {
+               xfree(ov);
+               return false;
+       }
+
+       s = &ov->tex;
+       ov->id = ext->idx;
+       
+
+       ov2 = gdi->extoverlays;
+       ovprev = NULL;
+       for (;;) {
+               if (ov2 == NULL || ov2->id >= ov->id) {
+                       if (ov2 == gdi->extoverlays) {
+                               gdi->extoverlays = ov;
+                               ov->next = ov2;
+                       } else {
+                               ov->next = ovprev->next;
+                               ovprev->next = ov;
+                       }
+                       break;
+               }
+               ovprev = ov2;
+               ov2 = ov2->next;
+       }
+
+       ov->x = ext->xpos;
+       ov->y = ext->ypos;
+
+       for (int y = 0; y < ext->height; y++) {
+               memcpy((uae_u8 *)s->bits + y * s->pitch, ext->data + y * ext->width * 4, ext->width * 4);
+       }
+
+       return true;
+}
+
 void gdi_select(void)
 {
        for (int i = 0; i < MAX_AMIGAMONITORS; i++) {
@@ -535,6 +645,6 @@ void gdi_select(void)
        D3D_debug = NULL;
        D3D_led = NULL;
        D3D_getscanline = NULL;
-       D3D_extoverlay = NULL;
+       D3D_extoverlay = gdi_extoverlay;
        D3D_paint = gdi_paint;
 }
index 5163a85bbc10e974ed896fcb5593988dca763032..fb6cea4b3ce622fb25bf5d2f502c110ecbed5655 100644 (file)
@@ -1051,7 +1051,7 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
 
        int m = 1;
        if (fs < 2) {
-               if (smm_m >= RP_SCREENMODE_SCALE_2X) {
+               if (smm_m >= RP_SCREENMODE_SCALE_2X && smm < RP_SCREENMODE_SCALE_TARGET) {
                        m = smm_m - RP_SCREENMODE_SCALE_2X + 2;
                }
        }
@@ -1061,16 +1061,28 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p)
 
                int m = 1;
                if (fs == 2) {
-                       p->gf[1].gfx_filter_autoscale = 1;
+                       p->gf[GF_RTG].gfx_filter_autoscale = RTG_MODE_SCALE;
                } else {
-                       p->gf[1].gfx_filter_autoscale = 0;
-                       if (smm_m >= RP_SCREENMODE_SCALE_2X) {
+                       p->gf[GF_RTG].gfx_filter_autoscale = 0;
+                       if (smm_m >= RP_SCREENMODE_SCALE_2X && smm < RP_SCREENMODE_SCALE_TARGET) {
                                m = smm_m - RP_SCREENMODE_SCALE_2X + 2;
                        }
                }
 
+               p->win32_rtgallowscaling = false;
+               p->win32_rtgscaleaspectratio = keepaspect ? -1 : 0;
+
+               if (integerscale) {
+                       p->gf[GF_RTG].gfx_filter_autoscale = RTG_MODE_INTEGER_SCALE;
+               }
                gm->gfx_size_win.width = vidinfo->width * m;
                gm->gfx_size_win.height = vidinfo->height * m;
+               if (forcesize && !integerscale) {
+                       gm->gfx_size_win.width = sm->lTargetWidth;
+                       gm->gfx_size_win.height = sm->lTargetHeight;
+                       p->gf[GF_RTG].gfx_filter_autoscale = RTG_MODE_SCALE;
+                       p->win32_rtgallowscaling = true;
+               }
 
                hmult = (float)m;
                vmult = (float)m;
@@ -1234,7 +1246,7 @@ static int movescreenoverlay(WPARAM wParam, LPARAM lParam)
        eo.idx = (int)wParam;
        eo.xpos = LOWORD(lParam);
        eo.ypos = HIWORD(lParam);
-       int ret = D3D_extoverlay(&eo);
+       int ret = D3D_extoverlay(&eo, 0);
        if (pause_emulation && D3D_refresh) {
                D3D_refresh(0);
                delayed_refresh = 0;
@@ -1251,7 +1263,7 @@ static int deletescreenoverlay(WPARAM wParam)
        eo.idx = (int)wParam;
        eo.width = -1;
        eo.height = -1;
-       return D3D_extoverlay(&eo);
+       return D3D_extoverlay(&eo, 0);
 }
 
 static int screenoverlay(LPCVOID pData)
@@ -1269,7 +1281,7 @@ static int screenoverlay(LPCVOID pData)
        eo.width = rpo->lWidth;
        eo.height = rpo->lHeight;
        eo.data = rpo->btData;
-       return D3D_extoverlay(&eo);
+       return D3D_extoverlay(&eo, 0);
 }
 
 static void dos_execute_callback(uae_u32 id, uae_u32 status, uae_u32 flags, const char *outbuf, void *userdata)
index 0d33d4ebdacc56f0fbf159fcff6b681666cb3a60..68d31412990f44fc1b52c41cf97f8dd60eed15c3 100644 (file)
 #define LANG_DLL_FULL_VERSION_MATCH 1
 
 #if WINUAEPUBLICBETA
-#define WINUAEBETA _T("3")
+#define WINUAEBETA _T("4")
 #else
 #define WINUAEBETA _T("")
 #endif
 
-#define WINUAEDATE MAKEBD(2023, 3, 25)
+#define WINUAEDATE MAKEBD(2023, 4, 1)
 
 //#define WINUAEEXTRA _T("AmiKit Preview")
 //#define WINUAEEXTRA _T("Amiga Forever Edition")
index a9ea4b5971def47f4026583edbe047900318fd2d..e24f0a6f8623203a1718dcdd8f213d0f1b6f163b 100644 (file)
@@ -1,11 +1,21 @@
 
+Beta 4:
+
+- VHPOSW updates, copper special odd/even last cycle condition used original maxhpos value, not VHPOSW write "faked" hpos value. Do not do horizontal adjustments if CPU speed is fastest possible and/or JIT is enabled and VHPOSW access was CPU. Copper VHPOSW write is always accepted (which can only work if ECS or AGA).
+- ROM rescan in ini mode didn't clear previously detected ROMs. Ini file whole section delete only deleted first entry in section.
+- Added new KS ROMs to ROM scanner.
+- uaegfx and hardware emulated RTG board and emulation window smaller than RTG resolution: part of right or bottom of display was clipped. (Used window size to check limits instead of internal surface size)
+- Statefile restore fixes, 68020+ blitter wait hang after loading statefile, "cpu trace" error dialog shown even when there was nothing wrong.
+- If reset was requested, it wasn't processed until next vsync. Between reset request and reset process CPU might have executed random data, temporarily flooding log with invalid access errors, exceptions etc.
+- CIA synchronize clock drift bug fix (4.10.0)
+
 Beta 3:
 
 - Changed keyboard reset warning again: when reset keys are pressed, reset warning starts, when reset warning ends, system is reset but reset is kept active until at least one key is released. Keeping reset keys pressed more than 5 seconds force hard reset like non-reset warning config already did. Both keyboard reset modes now work identically.
 - Programmed mode "do not include hidden lines" (b1) removed one too many line, breaking some programmed modes interlace field order.
 - Interlace automatic LOF toggle cycle was still using pre-4.9 horizontal position origin. (Toggled 3 cycles too early, correct position is cycle 1 of line 0)
 - LOL (NTSC long line) was toggled 1 cycle too early. Both LOF and LOL toggle when HPOS=1.
-- COPJMP1+COPJMP2 strobe when Copper DMA is off stops the copper: this was not correct, if both strobes are generated, Copper instruction pointer is loaded with COP1PT OR'd with COP2PT. This usually indirectly stops the copper because it will sooner or later does MOVE to "dangerous" register. This is same address OR behavior as any other DMA pointer if more than one gets activated in same cycle (for example refresh + bitplane conflict). This was done before logic analyzer checks and was forgotten..
+- COPJMP1+COPJMP2 strobe when Copper DMA is off stops the copper: this was not correct, if both strobes are generated, Copper instruction pointer is loaded with COP1PT OR'd with COP2PT. This usually indirectly stops the copper because it will sooner or later do MOVE to "dangerous" register. This is same address OR behavior as any other DMA pointer if more than one gets activated in same cycle (for example refresh + bitplane conflict). This was done before logic analyzer checks and was forgotten..
 - HAM5/HAM7 was incorrectly allowed in AGA mode (broken probably in 4.9?). AGA only enables HAM if 6 or 8 planes.
 - Disk image was accidentally opened twice, preventing disk image deletion/editing without closing WinUAE (b1)
 - When disk image is ejected using GUI, close image file handle immediately (previously it was closed after returning back to emulation)
@@ -15,7 +25,7 @@ Beta 3:
 - Debugger wf didn't fill in binary mode.
 - GVP 2040 original ROM image added (No 68060 support). "tekscsi2.device 1.1 (17.4.95)". Filesystem loader has serial debugging enabled. Updated 68060 variant is "tekscsi2.device 1.0 (27.8.95)". For some reason newer version has 1.0 in version string but device internal version is still 1.1.
 - Changed new Agnus Chip RAM max addressing advanced chipset option: default equals Chip RAM size. Forcing 512k when OCS can break old configs and cause confusion and result will look like new emulation bug.
-- Some VHPOSW horizontal change support improvements. It is still a hack but it is simpler hack and generic, required changes are now dynamically calculated. It is not anymore hardwired to Smooth Copper / Up Front specific VHPOSW horizontal position changes. Demo specific hacks removed. Also now horizontal position moves beyond maxhpos is also emulated, hpos counts until to 0xFF before wrapping around. DMA debugger also updated to support skipped or doubled cycles. (Weird test cases by ross)
+- Some VHPOSW horizontal change support improvements. It is still a hack but it is simpler hack and generic, required changes are now dynamically calculated. It is not anymore hardwired to Smooth Copper / Up Front specific VHPOSW horizontal position changes. Demo specific hacks removed. Also now horizontal position moves beyond maxhpos is also emulated, hpos counts to 0xFF before wrapping around. DMA debugger also updated to support skipped or doubled cycles. VHSPOW behavior needs future undocumented feature thread post. (Weird test cases by ross)
 
 Beta 2: