diff options
author | Michael Pavone <pavone@retrodev.com> | 2019-08-19 19:06:22 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2019-08-19 19:06:22 -0700 |
commit | 6ca5e29f7272be7dfd245416b7f55c0457209210 (patch) | |
tree | 80c316e78a3100b323b032df6a9ac4b42a1cb04f | |
parent | b8be517b111e65365cd37957f9d967dee4278bfd (diff) |
Small optimization to render_map in VDP code
-rw-r--r-- | vdp.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -1197,28 +1197,25 @@ static void render_map(uint16_t col, uint8_t * tmp_buf, uint8_t offset, vdp_cont } 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; } } } |