commit 148549b
Devine Lu Linvega
·
2024-01-15 18:22:09 +0000 UTC
parent f4e3dc9
Removed macro use in screen vector
1 files changed,
+2,
-5
+2,
-5
1@@ -30,7 +30,6 @@ WITH REGARD TO THIS SOFTWARE.
2 static XImage *ximage;
3 static Display *display;
4 static Window window;
5-static char *loaded_rom;
6
7 #define WIDTH (64 * 8)
8 #define HEIGHT (40 * 8)
9@@ -231,8 +230,6 @@ emu_run(Uxn *u, char *rom)
10 char coninp[CONINBUFSIZE];
11 struct pollfd fds[3];
12 static const struct itimerspec screen_tspec = {{0, 16666666}, {0, 16666666}};
13- loaded_rom = rom;
14-
15 /* timer */
16 fds[0].fd = XConnectionNumber(display);
17 fds[1].fd = timerfd_create(CLOCK_MONOTONIC, 0);
18@@ -246,8 +243,8 @@ emu_run(Uxn *u, char *rom)
19 while(XPending(display))
20 emu_event(u);
21 if(poll(&fds[1], 1, 0)) {
22- read(fds[1].fd, expirations, 8); /* Indicate we handled the timer */
23- uxn_eval(u, PEEK2(u->dev + 0x20)); /* Call the vector once, even if the timer fired multiple times */
24+ read(fds[1].fd, expirations, 8); /* Indicate we handled the timer */
25+ uxn_eval(u, u->dev[0x20] << 8 | u->dev[0x21]); /* Call the vector once, even if the timer fired multiple times */
26 if(uxn_screen.x2) {
27 int s = uxn_screen.scale;
28 int x1 = uxn_screen.x1 * s, y1 = uxn_screen.y1 * s, x2 = uxn_screen.x2 * s, y2 = uxn_screen.y2 * s;