commit 163d48ec343ab373182ee9075667c2e5f0185a5f
parent 6ba21f8470bd1f3341943463524cfb6748dfabb1
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date: Wed, 3 Jan 2024 08:44:31 -0800
Removed extra variable
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/devices/screen.c b/src/devices/screen.c
@@ -271,7 +271,6 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port)
Uint8 twobpp = !!(ctrl & 0x80);
Uint8 color = ctrl & 0xf;
Uint8 *layer = ctrl & 0x40 ? uxn_screen.fg : uxn_screen.bg;
- Uint16 addr = rA;
int fx = ctrl & 0x10 ? -1 : 1;
int fy = ctrl & 0x20 ? -1 : 1;
dx = (move & 0x1) << 3, dxy = dx * fy;
@@ -279,19 +278,18 @@ screen_deo(Uint8 *ram, Uint8 *d, Uint8 port)
addr_incr = (move & 0x4) << (1 + twobpp);
if(twobpp) {
for(i = 0; i <= length; i++) {
- screen_2bpp(layer, &ram[addr], rX + dyx * i, rY + dxy * i, color, fx, fy);
- addr += addr_incr;
+ screen_2bpp(layer, &ram[rA], rX + dyx * i, rY + dxy * i, color, fx, fy);
+ rA += addr_incr;
}
} else {
for(i = 0; i <= length; i++) {
- screen_1bpp(layer, &ram[addr], rX + dyx * i, rY + dxy * i, color, fx, fy);
- addr += addr_incr;
+ screen_1bpp(layer, &ram[rA], rX + dyx * i, rY + dxy * i, color, fx, fy);
+ rA += addr_incr;
}
}
screen_change(rX, rY, rX + dyx * length + 8, rY + dxy * length + 8);
if(move & 0x1) rX += dx * fx;
if(move & 0x2) rY += dy * fy;
- if(move & 0x4) rA = addr; /* auto addr+length */
break;
}
}