From 84de8534b33c24de5ec8e9ed6313a3a32281733f Mon Sep 17 00:00:00 2001 From: "BADIM-PC\\Vadim" Date: Mon, 18 Dec 2017 16:36:27 +0300 Subject: [PATCH] Revert "Simplify loop." This reverts commit aa1cc5ae2b0321b51437e4e59252c7ca8425ff04. --- src/tic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tic.c b/src/tic.c index dfcce3a..eb749cf 100644 --- a/src/tic.c +++ b/src/tic.c @@ -221,9 +221,9 @@ static void drawHLineDma(tic_mem* memory, s32 xl, s32 xr, s32 y, u8 color) tic_tool_poke4(&memory->ram.vram.screen.data, y * TIC80_WIDTH + xl, color); xl++; } - s32 count = (xr - xl) >> 1; - u8 *screen = memory->ram.vram.screen.data + ((y * TIC80_WIDTH + xl) >> 1); - for(s32 i = 0; i < count; i++) *screen++ = color; + for(s32 x = xl; x + 1 < xr; x+=2) { + memory->ram.vram.screen.data[(y * TIC80_WIDTH + x) >> 1] = color; + } if (xr & 1) { tic_tool_poke4(&memory->ram.vram.screen.data, y * TIC80_WIDTH + xr - 1, color); }