GPU: Adjust 4-pixel boundary alignment formula

Fixes missing edge in Tenchi wo Kurau II: Sekiheki no Tatakai.
This commit is contained in:
Albert Liu 2020-07-04 17:59:14 -07:00
parent 000a51298a
commit e42d5fed75

View file

@ -612,7 +612,8 @@ void GPU::UpdateCRTCDisplayParameters()
}
// align to 4-pixel boundary
cs.display_vram_width = ((horizontal_active_ticks / cs.dot_clock_divider) + 2u) & ~3u;
cs.display_vram_width =
(static_cast<u16>(std::round(horizontal_active_ticks / static_cast<float>(cs.dot_clock_divider))) + 2u) & ~3u;
// apply the crop from the start (usually overscan)
cs.display_vram_width -= std::min(cs.display_vram_width, horizontal_skip_pixels);