(mouse.c) Do not use POKE2 macro

This commit is contained in:
neauoire 2023-08-30 11:25:15 -07:00
parent 1adb6a8cf0
commit 107a25295b
1 changed files with 12 additions and 6 deletions

View File

@ -29,17 +29,23 @@ mouse_up(Uxn *u, Uint8 *d, Uint8 mask)
void
mouse_pos(Uxn *u, Uint8 *d, Uint16 x, Uint16 y)
{
POKE2(d + 0x2, x);
POKE2(d + 0x4, y);
*(d + 2) = x >> 8;
*(d + 3) = x;
*(d + 4) = y >> 8;
*(d + 5) = y;
uxn_eval(u, PEEK2(d));
}
void
mouse_scroll(Uxn *u, Uint8 *d, Uint16 x, Uint16 y)
{
POKE2(d + 0xa, x);
POKE2(d + 0xc, -y);
*(d + 0xa) = x >> 8;
*(d + 0xb) = x;
*(d + 0xc) = -y >> 8;
*(d + 0xd) = -y;
uxn_eval(u, PEEK2(d));
POKE2(d + 0xa, 0);
POKE2(d + 0xc, 0);
*(d + 0xa) = 0;
*(d + 0xb) = 0;
*(d + 0xc) = 0;
*(d + 0xd) = 0;
}