comparison vdp.c @ 1899:789746b1a1b3

Fix crash in OD2 Titancade scene when border is completely cropped by overscan settings
author Mike Pavone <pavone@retrodev.com>
date Sun, 02 Feb 2020 22:38:49 -0800
parents 59a83c21d9d2
children 2d462aa78349
comparison
equal deleted inserted replaced
1898:ebf124803a93 1899:789746b1a1b3
2095 if (!(context->regs[REG_MODE_2] & BIT_MODE_5)) { 2095 if (!(context->regs[REG_MODE_2] & BIT_MODE_5)) {
2096 //vcounter increment occurs much later in Mode 4 2096 //vcounter increment occurs much later in Mode 4
2097 output_line++; 2097 output_line++;
2098 } 2098 }
2099 2099
2100 if (context->output_lines == lines_max || (!context->pushed_frame && output_line == context->inactive_start + context->border_top)) { 2100 if (context->output_lines >= lines_max || (!context->pushed_frame && output_line == context->inactive_start + context->border_top)) {
2101 //we've either filled up a full frame or we're at the bottom of screen in the current defined mode + border crop 2101 //we've either filled up a full frame or we're at the bottom of screen in the current defined mode + border crop
2102 if (!headless) { 2102 if (!headless) {
2103 render_framebuffer_updated(context->cur_buffer, context->h40_lines > (context->inactive_start + context->border_top) / 2 ? LINEBUF_SIZE : (256+HORIZ_BORDER)); 2103 render_framebuffer_updated(context->cur_buffer, context->h40_lines > (context->inactive_start + context->border_top) / 2 ? LINEBUF_SIZE : (256+HORIZ_BORDER));
2104 uint8_t is_even = context->flags2 & FLAG2_EVEN_FIELD; 2104 uint8_t is_even = context->flags2 & FLAG2_EVEN_FIELD;
2105 if (context->vcounter <= context->inactive_start && (context->regs[REG_MODE_4] & BIT_INTERLACE)) { 2105 if (context->vcounter <= context->inactive_start && (context->regs[REG_MODE_4] & BIT_INTERLACE)) {