(mouse) Ported to POKE2 macro

This commit is contained in:
Devine Lu Linvega 2023-04-10 10:41:04 -07:00
parent 02f2769153
commit a60a2a05d9
1 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@
#include "mouse.h" #include "mouse.h"
/* /*
Copyright (c) 2021 Devine Lu Linvega, Andrew Alderwick Copyright (c) 2021-2023 Devine Lu Linvega, Andrew Alderwick
Permission to use, copy, modify, and distribute this software for any Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above purpose with or without fee is hereby granted, provided that the above
@ -29,17 +29,17 @@ mouse_up(Uxn *u, Uint8 *d, Uint8 mask)
void void
mouse_pos(Uxn *u, Uint8 *d, Uint16 x, Uint16 y) mouse_pos(Uxn *u, Uint8 *d, Uint16 x, Uint16 y)
{ {
POKDEV(0x2, x); POKE2(d + 0x2, x);
POKDEV(0x4, y); POKE2(d + 0x4, y);
uxn_eval(u, PEEK2(d)); uxn_eval(u, PEEK2(d));
} }
void void
mouse_scroll(Uxn *u, Uint8 *d, Uint16 x, Uint16 y) mouse_scroll(Uxn *u, Uint8 *d, Uint16 x, Uint16 y)
{ {
POKDEV(0xa, x); POKE2(d + 0xa, x);
POKDEV(0xc, -y); POKE2(d + 0xc, -y);
uxn_eval(u, PEEK2(d)); uxn_eval(u, PEEK2(d));
POKDEV(0xa, 0); POKE2(d + 0xa, 0);
POKDEV(0xc, 0); POKE2(d + 0xc, 0);
} }