Skip to content

Commit

Permalink
Banshee / Voodoo3: Skip rectangle fill command in case of an address …
Browse files Browse the repository at this point in the history
…wrap.

This is a temporary fix for issue #470.
  • Loading branch information
vruppert committed Feb 4, 2025
1 parent 189e51c commit 57020b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bochs/iodev/display/banshee.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,7 @@ Bit32u bx_banshee_c::blt_yuv_conversion(Bit8u *ptr, Bit16u xc, Bit16u yc,
void bx_banshee_c::blt_rectangle_fill()
{
Bit32u dpitch = BLT.dst_pitch;
Bit32u dbase = BLT.dst_base;
Bit8u dpxsize = (BLT.dst_fmt > 1) ? (BLT.dst_fmt - 1) : 1;
Bit8u *dst_ptr, *dst_ptr1;
Bit8u colorkey_en = BLT.reg[blt_commandExtra] & 3;
Expand All @@ -2496,8 +2497,13 @@ void bx_banshee_c::blt_rectangle_fill()
BLT.busy = 0;
return;
}
if (dbase + (dy + h - 1) * dpitch + (dx + w - 1) * dpxsize > v->fbi.mask) {
BX_ERROR(("skip address wrap during blt_rectangle_fill()"));
BLT.busy = 0;
return;
}
BX_LOCK(render_mutex);
dst_ptr = &v->fbi.ram[BLT.dst_base + dy * dpitch + dx * dpxsize];
dst_ptr = &v->fbi.ram[dbase + dy * dpitch + dx * dpxsize];
for (y = 0; y < h; y++) {
dst_ptr1 = dst_ptr;
for (x = 0; x < w; x++) {
Expand Down

0 comments on commit 57020b8

Please sign in to comment.