commit a60a2a0

Devine Lu Linvega  ·  2023-04-10 17:41:04 +0000 UTC
parent 02f2769
(mouse) Ported to POKE2 macro
1 files changed,  +7, -7
+7, -7
 1@@ -2,7 +2,7 @@
 2 #include "mouse.h"
 3 
 4 /*
 5-Copyright (c) 2021 Devine Lu Linvega, Andrew Alderwick
 6+Copyright (c) 2021-2023 Devine Lu Linvega, Andrew Alderwick
 7 
 8 Permission to use, copy, modify, and distribute this software for any
 9 purpose with or without fee is hereby granted, provided that the above
10@@ -29,17 +29,17 @@ mouse_up(Uxn *u, Uint8 *d, Uint8 mask)
11 void
12 mouse_pos(Uxn *u, Uint8 *d, Uint16 x, Uint16 y)
13 {
14-	POKDEV(0x2, x);
15-	POKDEV(0x4, y);
16+	POKE2(d + 0x2, x);
17+	POKE2(d + 0x4, y);
18 	uxn_eval(u, PEEK2(d));
19 }
20 
21 void
22 mouse_scroll(Uxn *u, Uint8 *d, Uint16 x, Uint16 y)
23 {
24-	POKDEV(0xa, x);
25-	POKDEV(0xc, -y);
26+	POKE2(d + 0xa, x);
27+	POKE2(d + 0xc, -y);
28 	uxn_eval(u, PEEK2(d));
29-	POKDEV(0xa, 0);
30-	POKDEV(0xc, 0);
31+	POKE2(d + 0xa, 0);
32+	POKE2(d + 0xc, 0);
33 }