GPU: Fix mask for drawing area coordinates

This commit is contained in:
Stenzek 2024-04-28 15:44:41 +10:00
parent d094978214
commit 25f725c263
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View file

@ -62,6 +62,7 @@ public:
HBLANK_TIMER_INDEX = 1,
MAX_RESOLUTION_SCALE = 32,
DEINTERLACE_BUFFER_COUNT = 4,
DRAWING_AREA_COORD_MASK = 1023,
};
enum : u16

View file

@ -239,8 +239,8 @@ bool GPU::HandleSetTextureWindowCommand()
bool GPU::HandleSetDrawingAreaTopLeftCommand()
{
const u32 param = FifoPop() & 0x00FFFFFFu;
const u32 left = param & VRAM_WIDTH_MASK;
const u32 top = (param >> 10) & VRAM_HEIGHT_MASK;
const u32 left = param & DRAWING_AREA_COORD_MASK;
const u32 top = (param >> 10) & DRAWING_AREA_COORD_MASK;
Log_DebugPrintf("Set drawing area top-left: (%u, %u)", left, top);
if (m_drawing_area.left != left || m_drawing_area.top != top)
{
@ -260,8 +260,8 @@ bool GPU::HandleSetDrawingAreaBottomRightCommand()
{
const u32 param = FifoPop() & 0x00FFFFFFu;
const u32 right = param & VRAM_WIDTH_MASK;
const u32 bottom = (param >> 10) & VRAM_HEIGHT_MASK;
const u32 right = param & DRAWING_AREA_COORD_MASK;
const u32 bottom = (param >> 10) & DRAWING_AREA_COORD_MASK;
Log_DebugPrintf("Set drawing area bottom-right: (%u, %u)", m_drawing_area.right, m_drawing_area.bottom);
if (m_drawing_area.right != right || m_drawing_area.bottom != bottom)
{