From 30a61c2a5145d0b002b31642e7bcabce76751cf0 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Thu, 25 Jan 2024 19:57:28 +0100 Subject: [PATCH] Banshee/Voodoo3 fixes in mem_write_linear (issue #231). - Applied memory mask to start address. - Consider half mode and double width for redraw setup. --- bochs/iodev/display/banshee.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bochs/iodev/display/banshee.cc b/bochs/iodev/display/banshee.cc index 649a61518..7de7629cd 100644 --- a/bochs/iodev/display/banshee.cc +++ b/bochs/iodev/display/banshee.cc @@ -1024,7 +1024,7 @@ void bx_banshee_c::mem_write(bx_phy_address addr, unsigned len, void *data) void bx_banshee_c::mem_write_linear(Bit32u offset, Bit64u value, unsigned len) { Bit8u value8; - Bit32u start = v->banshee.io[io_vidDesktopStartAddr]; + Bit32u start = v->banshee.io[io_vidDesktopStartAddr] & v->fbi.mask; Bit32u pitch = v->banshee.io[io_vidDesktopOverlayStride] & 0x7fff; unsigned i, w, x, y; @@ -1047,6 +1047,13 @@ void bx_banshee_c::mem_write_linear(Bit32u offset, Bit64u value, unsigned len) x = (offset % pitch) / (v->banshee.disp_bpp >> 3); y = offset / pitch; w = len / (v->banshee.disp_bpp >> 3); + if (v->banshee.half_mode) { + y <<= 1; + } + if (v->banshee.double_width) { + x <<= 1; + w <<= 1; + } if (w == 0) w = 1; theVoodooVga->redraw_area(x, y, w, 1); }