commit 8ca86ea

neauoire  ·  2022-04-05 16:29:06 +0000 UTC
parent b0c8404
Removed console as Device
2 files changed,  +6, -6
+1, -1
1@@ -23,4 +23,4 @@ fi
2 echo "Done."
3 
4 # echo "Running.."
5-bin/uxn11 ~/roms/left.rom
6+bin/uxn11 ~/roms/left.rom README.md
+5, -5
 1@@ -44,16 +44,16 @@ console_input(Uxn *u, char c)
 2 {
 3 	Device *d = &u->dev[1];
 4 	d->dat[0x2] = c;
 5-	return uxn_eval(u, GETVECTOR(d));
 6+	return uxn_eval(u, GETVEC(d->dat));
 7 }
 8 
 9 static void
10-console_deo(Device *d, Uint8 port)
11+console_deo(Uint8 *d, Uint8 port)
12 {
13 	FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr
14 												  : 0;
15 	if(fd) {
16-		fputc(d->dat[port], fd);
17+		fputc(d[port], fd);
18 		fflush(fd);
19 	}
20 }
21@@ -80,7 +80,7 @@ uxn11_deo(Uxn *u, Uint8 addr, Uint8 v)
22 	d->dat[p] = v;
23 	switch(addr & 0xf0) {
24 	case 0x00: system_deo(d, p); break;
25-	case 0x10: console_deo(d, p); break;
26+	case 0x10: console_deo(d->dat, p); break;
27 	case 0x20: screen_deo(u->ram, d->dat, p); break;
28 	case 0xa0: file_deo(d, p); break;
29 	case 0xb0: file_deo(d, p); break;
30@@ -193,7 +193,7 @@ start(Uxn *u, char *rom)
31 	u->deo = uxn11_deo;
32 
33 	/* system   */ uxn_port(u, 0x0, nil_dei, system_deo);
34-	/* console  */ uxn_port(u, 0x1, nil_dei, console_deo);
35+	/* console  */ uxn_port(u, 0x1, nil_dei, nil_deo);
36 	/* screen   */ devscreen = uxn_port(u, 0x2, nil_dei, nil_deo);
37 	/* empty    */ uxn_port(u, 0x3, nil_dei, nil_deo);
38 	/* empty    */ uxn_port(u, 0x4, nil_dei, nil_deo);