GPU/HW: More improvements to GPUSTAT.31

Fixes True Pinball without breaking intros to Final Fantasy 7/8.
This commit is contained in:
Connor McLaughlin
2020-05-26 22:57:56 +10:00
parent 04f131f979
commit 23436f08ba
7 changed files with 34 additions and 30 deletions

View File

@ -580,7 +580,7 @@ void GPU_HW_OpenGL::UpdateDisplay()
else
{
const u32 vram_offset_x = m_crtc_state.display_vram_left;
const u32 vram_offset_y = m_crtc_state.display_vram_top;
const u32 vram_offset_y = m_crtc_state.display_vram_top + GetActiveLineLSB();
const u32 scaled_vram_offset_x = vram_offset_x * m_resolution_scale;
const u32 scaled_vram_offset_y = vram_offset_y * m_resolution_scale;
const u32 display_width = m_crtc_state.display_vram_width;
@ -616,7 +616,7 @@ void GPU_HW_OpenGL::UpdateDisplay()
const u32 flipped_vram_offset_y = VRAM_HEIGHT - vram_offset_y - (display_height >> height_div2);
const u32 scaled_flipped_vram_offset_y =
m_vram_texture.GetHeight() - scaled_vram_offset_y - (scaled_display_height >> height_div2);
const u32 reinterpret_field_offset = GetInterlacedDisplayLineOffset();
const u32 reinterpret_field_offset = GetInterlacedDisplayField();
const u32 reinterpret_start_x = m_crtc_state.regs.X * m_resolution_scale;
const u32 reinterpret_crop_left = (m_crtc_state.display_vram_left - m_crtc_state.regs.X) * m_resolution_scale;
const u32 uniforms[4] = {reinterpret_start_x, scaled_flipped_vram_offset_y, reinterpret_crop_left,
@ -724,7 +724,7 @@ void GPU_HW_OpenGL::FillVRAM(u32 x, u32 y, u32 width, u32 height, u32 color)
Uniforms uniforms;
std::tie(uniforms.u_fill_color[0], uniforms.u_fill_color[1], uniforms.u_fill_color[2], uniforms.u_fill_color[3]) =
RGBA8ToFloat(color);
uniforms.u_interlaced_displayed_field = GetInterlacedDisplayLineOffset();
uniforms.u_interlaced_displayed_field = GetActiveLineLSB();
m_vram_interlaced_fill_program.Bind();
UploadUniformBuffer(&uniforms, sizeof(uniforms));