Removed unused hor/ver values
This commit is contained in:
parent
be85023831
commit
98f773c652
|
@ -66,9 +66,7 @@ ppu_2bpp(Ppu *p, Uint8 layer, Uint16 x, Uint16 y, Uint8 *sprite, Uint8 color, Ui
|
||||||
int
|
int
|
||||||
ppu_init(Ppu *p, Uint8 hor, Uint8 ver)
|
ppu_init(Ppu *p, Uint8 hor, Uint8 ver)
|
||||||
{
|
{
|
||||||
p->hor = hor;
|
p->width = 8 * hor;
|
||||||
p->ver = ver;
|
p->height = 8 * ver;
|
||||||
p->width = 8 * p->hor;
|
|
||||||
p->height = 8 * p->ver;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ typedef unsigned short Uint16;
|
||||||
typedef unsigned int Uint32;
|
typedef unsigned int Uint32;
|
||||||
|
|
||||||
typedef struct Ppu {
|
typedef struct Ppu {
|
||||||
Uint16 hor, ver, width, height;
|
Uint16 width, height;
|
||||||
Uint8 *pixels;
|
Uint8 *pixels;
|
||||||
} Ppu;
|
} Ppu;
|
||||||
|
|
||||||
|
|
|
@ -213,8 +213,8 @@ static void
|
||||||
domouse(SDL_Event *event)
|
domouse(SDL_Event *event)
|
||||||
{
|
{
|
||||||
Uint8 flag = 0x00;
|
Uint8 flag = 0x00;
|
||||||
Uint16 x = clamp(event->motion.x - PAD, 0, ppu.hor * 8 - 1);
|
Uint16 x = clamp(event->motion.x - PAD, 0, ppu.width - 1);
|
||||||
Uint16 y = clamp(event->motion.y - PAD, 0, ppu.ver * 8 - 1);
|
Uint16 y = clamp(event->motion.y - PAD, 0, ppu.height - 1);
|
||||||
mempoke16(devmouse->dat, 0x2, x);
|
mempoke16(devmouse->dat, 0x2, x);
|
||||||
mempoke16(devmouse->dat, 0x4, y);
|
mempoke16(devmouse->dat, 0x4, y);
|
||||||
switch(event->button.button) {
|
switch(event->button.button) {
|
||||||
|
@ -500,8 +500,8 @@ main(int argc, char **argv)
|
||||||
portuxn(&u, 0xf, "---", nil_talk);
|
portuxn(&u, 0xf, "---", nil_talk);
|
||||||
|
|
||||||
/* Write screen size to dev/screen */
|
/* Write screen size to dev/screen */
|
||||||
mempoke16(devscreen->dat, 2, ppu.hor * 8);
|
mempoke16(devscreen->dat, 2, ppu.width);
|
||||||
mempoke16(devscreen->dat, 4, ppu.ver * 8);
|
mempoke16(devscreen->dat, 4, ppu.height);
|
||||||
|
|
||||||
run(&u);
|
run(&u);
|
||||||
quit();
|
quit();
|
||||||
|
|
Loading…
Reference in New Issue