Removed unused hor/ver values

This commit is contained in:
neauoire 2021-08-01 11:38:04 -07:00
parent be85023831
commit 98f773c652
3 changed files with 7 additions and 9 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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();