# HG changeset patch # User Michael Pavone # Date 1542349269 28800 # Node ID 93518786f8824f6bd26802288ca190b4633ce72d # Parent f27142c485670f4e53e18b3a20b7bbbf6012d9cc Implemented left column blank register bit in mode 5 diff -r f27142c48567 -r 93518786f882 vdp.c --- a/vdp.c Wed Nov 14 22:16:35 2018 -0800 +++ b/vdp.c Thu Nov 15 22:21:09 2018 -0800 @@ -1329,28 +1329,31 @@ uint8_t pixel = context->regs[REG_BG_COLOR]; uint32_t *colors = context->colors; src = DBG_SRC_BG; - if (*plane_b & 0xF) { - pixel = *plane_b; - src = DBG_SRC_B; - } - uint8_t intensity = *plane_b & BUF_BIT_PRIORITY; - if (*plane_a & 0xF && (*plane_a & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { - pixel = *plane_a; - src = a_src; - } - intensity |= *plane_a & BUF_BIT_PRIORITY; - if (*sprite_buf & 0xF && (*sprite_buf & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { - if ((*sprite_buf & 0x3F) == 0x3E) { - intensity += BUF_BIT_PRIORITY; - } else if ((*sprite_buf & 0x3F) == 0x3F) { - intensity = 0; - } else { - pixel = *sprite_buf; - src = DBG_SRC_S; - if ((pixel & 0xF) == 0xE) { - intensity = BUF_BIT_PRIORITY; + uint8_t intensity = 0; + if (col || !(context->regs[REG_MODE_1] & BIT_COL0_MASK) || i >= 8) { + if (*plane_b & 0xF) { + pixel = *plane_b; + src = DBG_SRC_B; + } + intensity = *plane_b & BUF_BIT_PRIORITY; + if (*plane_a & 0xF && (*plane_a & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { + pixel = *plane_a; + src = a_src; + } + intensity |= *plane_a & BUF_BIT_PRIORITY; + if (*sprite_buf & 0xF && (*sprite_buf & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { + if ((*sprite_buf & 0x3F) == 0x3E) { + intensity += BUF_BIT_PRIORITY; + } else if ((*sprite_buf & 0x3F) == 0x3F) { + intensity = 0; } else { - intensity |= pixel & BUF_BIT_PRIORITY; + pixel = *sprite_buf; + src = DBG_SRC_S; + if ((pixel & 0xF) == 0xE) { + intensity = BUF_BIT_PRIORITY; + } else { + intensity |= pixel & BUF_BIT_PRIORITY; + } } } } @@ -1405,17 +1408,19 @@ if (output_disabled) { pixel = 0x3F; } else { - if (*plane_b & 0xF) { - pixel = *plane_b; - src = DBG_SRC_B; - } - if (*plane_a & 0xF && (*plane_a & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { - pixel = *plane_a; - src = a_src; - } - if (*sprite_buf & 0xF && (*sprite_buf & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { - pixel = *sprite_buf; - src = DBG_SRC_S; + if (col || !(context->regs[REG_MODE_1] & BIT_COL0_MASK) || i >= 8) { + if (*plane_b & 0xF) { + pixel = *plane_b; + src = DBG_SRC_B; + } + if (*plane_a & 0xF && (*plane_a & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { + pixel = *plane_a; + src = a_src; + } + if (*sprite_buf & 0xF && (*sprite_buf & BUF_BIT_PRIORITY) >= (pixel & BUF_BIT_PRIORITY)) { + pixel = *sprite_buf; + src = DBG_SRC_S; + } } } //TODO: Simulate CRAM corruption from bus fight