GS/PCRTC/HW: Correct height of framebuffer reads

This commit is contained in:
refractionpcsx2 2023-12-22 18:18:13 +00:00
parent ade6a6c3ab
commit 3a242b513c
1 changed files with 5 additions and 0 deletions

View File

@ -4458,6 +4458,9 @@ GSVector2i GSState::GSPCRTCRegs::GetFramebufferSize(int display)
combined_rect.z += std::max(PCRTCDisplays[0].framebufferOffsets.x, PCRTCDisplays[1].framebufferOffsets.x); combined_rect.z += std::max(PCRTCDisplays[0].framebufferOffsets.x, PCRTCDisplays[1].framebufferOffsets.x);
combined_rect.w += std::max(PCRTCDisplays[0].framebufferOffsets.y, PCRTCDisplays[1].framebufferOffsets.y); combined_rect.w += std::max(PCRTCDisplays[0].framebufferOffsets.y, PCRTCDisplays[1].framebufferOffsets.y);
} }
max_height += combined_rect.y;
offset = (max_height / min_mag) - offset; offset = (max_height / min_mag) - offset;
combined_rect.w = std::min(combined_rect.w, offset); combined_rect.w = std::min(combined_rect.w, offset);
return GSVector2i(combined_rect.z, combined_rect.w); return GSVector2i(combined_rect.z, combined_rect.w);
@ -4481,6 +4484,8 @@ GSVector2i GSState::GSPCRTCRegs::GetFramebufferSize(int display)
offset = (offset - 1) / 2; offset = (offset - 1) / 2;
} }
max_height += out_rect.y;
offset = (max_height / min_mag) - offset; offset = (max_height / min_mag) - offset;
out_rect.w = std::min(out_rect.w, offset); out_rect.w = std::min(out_rect.w, offset);