# HG changeset patch # User Michael Pavone # Date 1566266782 25200 # Node ID 3457d338ae2512b1bff45e420662914b391e669b # Parent cae2b55d683ffc00ae8968c099092e4b4f758f4f Small optimization to render_map in VDP code diff -r cae2b55d683f -r 3457d338ae25 vdp.c --- a/vdp.c Sat Aug 17 18:44:15 2019 -0700 +++ b/vdp.c Mon Aug 19 19:06:22 2019 -0700 @@ -1197,28 +1197,25 @@ } uint8_t pal_priority = (col >> 9) & 0x70; uint32_t bits = *((uint32_t *)(&context->vdpmem[address])); + tmp_buf += offset; if (col & MAP_BIT_H_FLIP) { uint32_t shift = 28; for (int i = 0; i < 4; i++) { uint8_t right = pal_priority | ((bits >> shift) & 0xF); shift -= 4; - tmp_buf[offset++] = pal_priority | ((bits >> shift) & 0xF); + *(tmp_buf++) = pal_priority | ((bits >> shift) & 0xF); shift -= 4; - offset &= SCROLL_BUFFER_MASK; - tmp_buf[offset++] = right; - offset &= SCROLL_BUFFER_MASK; + *(tmp_buf++) = right; } } else { for (int i = 0; i < 4; i++) { uint8_t right = pal_priority | (bits & 0xF); bits >>= 4; - tmp_buf[offset++] = pal_priority | (bits & 0xF); - offset &= SCROLL_BUFFER_MASK; + *(tmp_buf++) = pal_priority | (bits & 0xF); bits >>= 4; - tmp_buf[offset++] = right; - offset &= SCROLL_BUFFER_MASK; + *(tmp_buf++) = right; } } }