Fix horizontal window inversion logic.
This commit is contained in:
parent
6e59ca6795
commit
1d46986e92
1 changed files with 7 additions and 4 deletions
11
video.cc
11
video.cc
|
@ -2190,10 +2190,13 @@ static void render_window_n_pass(u16 *scanline, u32 start, u32 end)
|
||||||
u32 win_bot = read_ioreg(REG_WINxV(winnum)) & 0xFF;
|
u32 win_bot = read_ioreg(REG_WINxV(winnum)) & 0xFF;
|
||||||
// Check the X coordinates and generate up to three segments
|
// Check the X coordinates and generate up to three segments
|
||||||
// Clip the coordinates to the [start, end) range.
|
// Clip the coordinates to the [start, end) range.
|
||||||
u32 win_l = MAX(start, MIN(end, read_ioreg(REG_WINxH(winnum)) >> 8));
|
u32 win_lraw = read_ioreg(REG_WINxH(winnum)) >> 8;
|
||||||
u32 win_r = MAX(start, MIN(end, read_ioreg(REG_WINxH(winnum)) & 0xFF));
|
u32 win_rraw = read_ioreg(REG_WINxH(winnum)) & 0xFF;
|
||||||
|
u32 win_l = MAX(start, MIN(end, win_lraw));
|
||||||
|
u32 win_r = MAX(start, MIN(end, win_rraw));
|
||||||
|
bool goodwin = win_lraw < win_rraw;
|
||||||
|
|
||||||
if (!in_window_y(vcount, win_top, win_bot) || (win_l == win_r))
|
if (!in_window_y(vcount, win_top, win_bot) || (win_lraw == win_rraw))
|
||||||
// WindowN is completely out, just render all out.
|
// WindowN is completely out, just render all out.
|
||||||
outfn(scanline, start, end);
|
outfn(scanline, start, end);
|
||||||
else {
|
else {
|
||||||
|
@ -2203,7 +2206,7 @@ static void render_window_n_pass(u16 *scanline, u32 start, u32 end)
|
||||||
u32 wndn_enable = (winin >> (8 * winnum)) & 0x3F;
|
u32 wndn_enable = (winin >> (8 * winnum)) & 0x3F;
|
||||||
|
|
||||||
// If the window is defined upside down, the areas are inverted.
|
// If the window is defined upside down, the areas are inverted.
|
||||||
if (win_l < win_r) {
|
if (goodwin) {
|
||||||
// Render [start, win_l) range (which is outside the window)
|
// Render [start, win_l) range (which is outside the window)
|
||||||
if (win_l != start)
|
if (win_l != start)
|
||||||
outfn(scanline, start, win_l);
|
outfn(scanline, start, win_l);
|
||||||
|
|
Loading…
Add table
Reference in a new issue