summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2019-08-19 19:06:22 -0700
committerMichael Pavone <pavone@retrodev.com>2019-08-19 19:06:22 -0700
commit6ca5e29f7272be7dfd245416b7f55c0457209210 (patch)
tree80c316e78a3100b323b032df6a9ac4b42a1cb04f
parentb8be517b111e65365cd37957f9d967dee4278bfd (diff)
Small optimization to render_map in VDP code
-rw-r--r--vdp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/vdp.c b/vdp.c
index 3b6375b..65f2066 100644
--- a/vdp.c
+++ b/vdp.c
@@ -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;
}
}
}