Closed RetroCogs closed 2 months ago
That's really interesting. I have the suspect that the problem should be handled in vic4_render_scanline()
, so vic4_render_char_raster()
should be not even called in a case like our problematic one. As that function already should handle that, here:
// Top and bottom borders
if (ycounter < BORDER_Y_TOP || ycounter >= BORDER_Y_BOTTOM || !REG_DISPLAYENABLE) {
for (int i = 0; i < TEXTURE_WIDTH; i++)
*(current_pixel++) = palette[REG_BORDER_COLOR];
}
However this would take a bigger investigation, and your commit can provide an easy-and-fast fix till that, thank you!
Ok, so when vic4_render_char_raster is called it starts at CHARGEN_Y_START but this value can be < BORDER_Y_TOP, the fix here is to skip a line and fill with BORDER_COLOR if the requested line < BORDER_Y_TOP.