... | ... |
@@ -242,16 +242,16 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port) |
242 | 242 |
if(len > 0x10000 - addr) |
243 | 243 |
len = 0x10000 - addr; |
244 | 244 |
res = file_stat(c, &ram[addr], len); |
245 |
- POKDEV(0x2, res); |
|
245 |
+ POKE16(d + 0x2, res); |
|
246 | 246 |
break; |
247 | 247 |
case 0x6: |
248 | 248 |
res = file_delete(c); |
249 |
- POKDEV(0x2, res); |
|
249 |
+ POKE16(d + 0x2, res); |
|
250 | 250 |
break; |
251 | 251 |
case 0x9: |
252 | 252 |
addr = PEEK16(d + 0x8); |
253 | 253 |
res = file_init(c, (char *)&ram[addr], 0x10000 - addr, 0); |
254 |
- POKDEV(0x2, res); |
|
254 |
+ POKE16(d + 0x2, res); |
|
255 | 255 |
break; |
256 | 256 |
case 0xd: |
257 | 257 |
addr = PEEK16(d + 0xc); |
... | ... |
@@ -259,7 +259,7 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port) |
259 | 259 |
if(len > 0x10000 - addr) |
260 | 260 |
len = 0x10000 - addr; |
261 | 261 |
res = file_read(c, &ram[addr], len); |
262 |
- POKDEV(0x2, res); |
|
262 |
+ POKE16(d + 0x2, res); |
|
263 | 263 |
break; |
264 | 264 |
case 0xf: |
265 | 265 |
addr = PEEK16(d + 0xe); |
... | ... |
@@ -267,7 +267,7 @@ file_deo(Uint8 id, Uint8 *ram, Uint8 *d, Uint8 port) |
267 | 267 |
if(len > 0x10000 - addr) |
268 | 268 |
len = 0x10000 - addr; |
269 | 269 |
res = file_write(c, &ram[addr], len, d[0x7]); |
270 |
- POKDEV(0x2, res); |
|
270 |
+ POKE16(d + 0x2, res); |
|
271 | 271 |
break; |
272 | 272 |
} |
273 | 273 |
} |
... | ... |
@@ -281,7 +281,7 @@ file_dei(Uint8 id, Uint8 *d, Uint8 port) |
281 | 281 |
case 0xc: |
282 | 282 |
case 0xd: |
283 | 283 |
res = file_read(c, &d[port], 1); |
284 |
- POKDEV(0x2, res); |
|
284 |
+ POKE16(d + 0x2, res); |
|
285 | 285 |
break; |
286 | 286 |
} |
287 | 287 |
return d[port]; |
... | ... |
@@ -29,17 +29,17 @@ mouse_up(Uxn *u, Uint8 *d, Uint8 mask) |
29 | 29 |
void |
30 | 30 |
mouse_pos(Uxn *u, Uint8 *d, Uint16 x, Uint16 y) |
31 | 31 |
{ |
32 |
- POKDEV(0x2, x); |
|
33 |
- POKDEV(0x4, y); |
|
32 |
+ POKE16(d + 0x2, x); |
|
33 |
+ POKE16(d + 0x4, y); |
|
34 | 34 |
uxn_eval(u, PEEK16(d)); |
35 | 35 |
} |
36 | 36 |
|
37 | 37 |
void |
38 | 38 |
mouse_scroll(Uxn *u, Uint8 *d, Uint16 x, Uint16 y) |
39 | 39 |
{ |
40 |
- POKDEV(0xa, x); |
|
41 |
- POKDEV(0xc, -y); |
|
40 |
+ POKE16(d + 0xa, x); |
|
41 |
+ POKE16(d + 0xc, -y); |
|
42 | 42 |
uxn_eval(u, PEEK16(d)); |
43 |
- POKDEV(0xa, 0); |
|
44 |
- POKDEV(0xc, 0); |
|
43 |
+ POKE16(d + 0xa, 0); |
|
44 |
+ POKE16(d + 0xc, 0); |
|
45 | 45 |
} |
... | ... |
@@ -16,8 +16,6 @@ WITH REGARD TO THIS SOFTWARE. |
16 | 16 |
#define POKE16(d, v) { (d)[0] = (v) >> 8; (d)[1] = (v); } |
17 | 17 |
#define PEEK16(d) ((d)[0] << 8 | (d)[1]) |
18 | 18 |
|
19 |
-#define POKDEV(x, y) { d[(x)] = (y) >> 8; d[(x) + 1] = (y); } |
|
20 |
- |
|
21 | 19 |
/* clang-format on */ |
22 | 20 |
|
23 | 21 |
typedef unsigned char Uint8; |