Skip to content

Commit

Permalink
Implement 6 byte reads for Voodoo 3 (#473)
Browse files Browse the repository at this point in the history
Fixes artifacts in Grim Fandango demo.
  • Loading branch information
Vort authored Feb 3, 2025
1 parent 0b367fa commit c0f4441
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bochs/iodev/display/banshee.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,16 @@ void bx_banshee_c::mem_read(bx_phy_address addr, unsigned len, void *data)
case 4:
*((Bit32u*)data) = (Bit32u)value;
break;
case 6:
#ifdef BX_LITTLE_ENDIAN
*((Bit32u*)data) = (Bit32u)value;
*((Bit16u*)data + 2) = (Bit16u)(value >> 32);
#else
for (unsigned i = 0; i < 6; i++) {
*((Bit8u*)data + i) = (Bit8u)(value >> ((5 - i) << 3));
}
#endif
break;
case 8:
*((Bit64u*)data) = value;
break;
Expand Down

0 comments on commit c0f4441

Please sign in to comment.