uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 98f773c652bc5ada42183e5eda5271e4f6ddd3a8
parent be85023831969c4bf10ea36125aa5642144eadd0
Author: neauoire <aliceffekt@gmail.com>
Date:   Sun,  1 Aug 2021 11:38:04 -0700

Removed unused hor/ver values

Diffstat:
Msrc/devices/ppu.c | 6++----
Msrc/devices/ppu.h | 2+-
Msrc/uxnemu.c | 8++++----
3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/devices/ppu.c b/src/devices/ppu.c @@ -66,9 +66,7 @@ ppu_2bpp(Ppu *p, Uint8 layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Ui int ppu_init(Ppu *p, Uint8 hor, Uint8 ver) { - p->hor = hor; - p->ver = ver; - p->width = 8 * p->hor; - p->height = 8 * p->ver; + p->width = 8 * hor; + p->height = 8 * ver; return 1; } diff --git a/src/devices/ppu.h b/src/devices/ppu.h @@ -18,7 +18,7 @@ typedef unsigned short Uint16; typedef unsigned int Uint32; typedef struct Ppu { - Uint16 hor, ver, width, height; + Uint16 width, height; Uint8 *pixels; } Ppu; diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -213,8 +213,8 @@ static void domouse(SDL_Event *event) { Uint8 flag = 0x00; - Uint16 x = clamp(event->motion.x - PAD, 0, ppu.hor * 8 - 1); - Uint16 y = clamp(event->motion.y - PAD, 0, ppu.ver * 8 - 1); + Uint16 x = clamp(event->motion.x - PAD, 0, ppu.width - 1); + Uint16 y = clamp(event->motion.y - PAD, 0, ppu.height - 1); mempoke16(devmouse->dat, 0x2, x); mempoke16(devmouse->dat, 0x4, y); switch(event->button.button) { @@ -500,8 +500,8 @@ main(int argc, char **argv) portuxn(&u, 0xf, "---", nil_talk); /* Write screen size to dev/screen */ - mempoke16(devscreen->dat, 2, ppu.hor * 8); - mempoke16(devscreen->dat, 4, ppu.ver * 8); + mempoke16(devscreen->dat, 2, ppu.width); + mempoke16(devscreen->dat, 4, ppu.height); run(&u); quit();