Commit 74b5340e authored by ds22x's avatar ds22x
Browse files

Prevent crashing when having too many lines

parent 297970e4
......@@ -1456,11 +1456,21 @@ int32_t GPU_Update(const int32_t sys_timestamp)
}
else
{
const unsigned int FirstVisibleLine =
unsigned int FirstVisibleLineTemp =
GPU.LineVisFirst + (crop_overscan == 2 ? GPU.VertStart : (GPU.HardwarePALType ? 20 : 16));
const unsigned int VisibleLineCount =
unsigned int VisibleLineCountTemp =
(crop_overscan == 2 ? (GPU.VertEnd - GPU.VertStart) - ((GPU.HardwarePALType ? 287 : 239) - GPU.LineVisLast) - GPU.LineVisFirst : GPU.LineVisLast + 1 - GPU.LineVisFirst); //HardwarePALType ? 288 : 240;
if (VisibleLineCountTemp > (GPU.HardwarePALType ? 288 : 240))
{
FirstVisibleLineTemp =
GPU.LineVisFirst + (GPU.HardwarePALType ? 20 : 16);
VisibleLineCountTemp =
GPU.LineVisLast + 1 - GPU.LineVisFirst; //HardwarePALType ? 288 : 240;
}
const unsigned int FirstVisibleLine = FirstVisibleLineTemp;
const unsigned int VisibleLineCount = VisibleLineCountTemp;
TIMER_SetHRetrace(false);
if(GPU.DisplayMode & DISP_PAL)
......
......@@ -824,7 +824,7 @@ Renderer::DisplayRect Renderer::compute_display_rect()
upper_offset = 0 - render_state.slstart;
}
}
else
if (render_state.crop_overscan != 2 || display_height > (render_state.is_pal ? 288 : 240))
{
if (render_state.is_pal)
{
......
......@@ -1622,7 +1622,7 @@ static GlDisplayRect compute_gl_display_rect(GlRenderer *renderer)
y = renderer->last_scanline - 239;
}
}
else
if (renderer->crop_overscan != 2 || height > (renderer->config.is_pal? 288 : 240))
{
if (renderer->config.is_pal)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment