Skip to content

Commit

Permalink
Fixed Voodoo3 issue found with Diablo II game (#349).
Browse files Browse the repository at this point in the history
If front and back buffer addresses are identical, 'video_changed' flag must be set.
  • Loading branch information
vruppert committed Sep 11, 2024
1 parent f5e3dd9 commit bfebb17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bochs/iodev/display/voodoo_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,6 @@ Bit32u lfb_w(Bit32u offset, Bit32u data, Bit32u mem_mask)
{
Bit16u *dest, *depth;
Bit32u destmax, depthmax;
Bit32u forcefront=0;

int sr[2], sg[2], sb[2], sa[2], sw[2];
int x, y, scry, mask;
Expand Down Expand Up @@ -2679,7 +2678,7 @@ Bit32u lfb_w(Bit32u offset, Bit32u data, Bit32u mem_mask)
mask &= ~(0xf0 + LFB_DEPTH_PRESENT_MSW);

/* select the target buffer */
destbuf = (v->type >= VOODOO_BANSHEE) ? (!forcefront) : LFBMODE_WRITE_BUFFER_SELECT(v->reg[lfbMode].u);
destbuf = (v->type >= VOODOO_BANSHEE) ? 1 : LFBMODE_WRITE_BUFFER_SELECT(v->reg[lfbMode].u);
switch (destbuf)
{
case 0: /* front buffer */
Expand All @@ -2691,6 +2690,8 @@ Bit32u lfb_w(Bit32u offset, Bit32u data, Bit32u mem_mask)
case 1: /* back buffer */
dest = (Bit16u *)(v->fbi.ram + v->fbi.rgboffs[v->fbi.backbuf]);
destmax = (v->fbi.mask + 1 - v->fbi.rgboffs[v->fbi.backbuf]) / 2;
if (v->fbi.rgboffs[v->fbi.frontbuf] == v->fbi.rgboffs[v->fbi.backbuf])
v->fbi.video_changed = 1;
break;

default: /* reserved */
Expand Down

0 comments on commit bfebb17

Please sign in to comment.