commit 0ed2617
neauoire
·
2023-08-25 04:25:11 +0000 UTC
parent b3c68a1
Setting the stage for link device
6 files changed,
+53,
-4
M
makefile
+3,
-3
1@@ -1,5 +1,5 @@
2
3-CLI_src=src/uxn.c src/devices/system.c src/devices/console.c src/devices/file.c src/devices/datetime.c
4+CLI_src=src/uxn.c src/devices/system.c src/devices/console.c src/devices/file.c src/devices/datetime.c src/devices/link.c
5 EMU_src=${CLI_src} src/devices/screen.c src/devices/controller.c src/devices/mouse.c
6
7 RELEASE_flags=-DNDEBUG -O2 -g0 -s
8@@ -29,6 +29,6 @@ clean:
9 bin/uxnasm: src/uxnasm.c
10 @ cc ${RELEASE_flags} src/uxnasm.c -o bin/uxnasm
11 bin/uxncli: ${CLI_src} src/uxncli.c
12- @ cc ${RELEASE_flags} ${CLI_src} src/uxncli.c -o bin/uxncli
13+ @ cc ${RELEASE_flags} ${CLI_src} src/uxncli.c -pthread -o bin/uxncli
14 bin/uxn11: ${EMU_src} src/uxn11.c
15- @ cc ${RELEASE_flags} ${EMU_src} src/uxn11.c -lX11 -o bin/uxn11
16+ @ cc ${RELEASE_flags} ${EMU_src} src/uxn11.c -lX11 -pthread -o bin/uxn11
+27,
-0
1@@ -0,0 +1,27 @@
2+#include <stdlib.h>
3+#include <stdio.h>
4+#include <pthread.h>
5+
6+#include "../uxn.h"
7+
8+/*
9+Copyright (c) 2023 Devine Lu Linvega
10+
11+Permission to use, copy, modify, and distribute this software for any
12+purpose with or without fee is hereby granted, provided that the above
13+copyright notice and this permission notice appear in all copies.
14+
15+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16+WITH REGARD TO THIS SOFTWARE.
17+*/
18+
19+Uint8
20+link_dei(Uxn *u, Uint8 addr)
21+{
22+ return 0;
23+}
24+
25+void
26+link_deo(Uint8 *ram, Uint8 *d, Uint8 port)
27+{
28+}
+17,
-0
1@@ -0,0 +1,17 @@
2+/*
3+Copyright (c) 2022 Devine Lu Linvega, Andrew Alderwick
4+
5+Permission to use, copy, modify, and distribute this software for any
6+purpose with or without fee is hereby granted, provided that the above
7+copyright notice and this permission notice appear in all copies.
8+
9+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+WITH REGARD TO THIS SOFTWARE.
11+*/
12+
13+#define LINK_VERSION 1
14+#define LINK_DEIMASK 0x0000
15+#define LINK_DEOMASK 0xaaaa
16+
17+Uint8 link_dei(Uxn *u, Uint8 addr);
18+void link_deo(Uxn *u, Uint8 *d, Uint8 port);
+2,
-1
1@@ -89,7 +89,8 @@ system_version(Uxn *u, char *name, char *date)
2 }
3
4 void
5-system_boot(Uxn *u, int soft){
6+system_boot(Uxn *u, int soft)
7+{
8 int i;
9 for(i = 0x100 * soft; i < 0x10000; i++)
10 u->ram[i] = 0;
+2,
-0
1@@ -15,6 +15,7 @@
2 #include "devices/mouse.h"
3 #include "devices/file.h"
4 #include "devices/datetime.h"
5+#include "devices/link.h"
6
7 /*
8 Copyright (c) 2022 Devine Lu Linvega
9@@ -70,6 +71,7 @@ emu_deo(Uxn *u, Uint8 addr)
10 case 0x20: screen_deo(u->ram, &u->dev[d], p); break;
11 case 0xa0: file_deo(0, u->ram, &u->dev[d], p); break;
12 case 0xb0: file_deo(1, u->ram, &u->dev[d], p); break;
13+ case 0xf0: link_deo(u, &u->dev[d], p); break;
14 }
15 }
16
+2,
-0
1@@ -6,6 +6,7 @@
2 #include "devices/console.h"
3 #include "devices/file.h"
4 #include "devices/datetime.h"
5+#include "devices/link.h"
6
7 /*
8 Copyright (c) 2021-2023 Devine Lu Linvega, Andrew Alderwick
9@@ -39,6 +40,7 @@ emu_deo(Uxn *u, Uint8 addr)
10 case 0x10: console_deo(&u->dev[d], p); break;
11 case 0xa0: file_deo(0, u->ram, &u->dev[d], p); break;
12 case 0xb0: file_deo(1, u->ram, &u->dev[d], p); break;
13+ case 0xf0: link_deo(u, &u->dev[d], p); break;
14 }
15 }
16