commit e26a48e

Devine Lu Linvega  ·  2025-01-21 00:04:03 +0000 UTC
parent ea0a058
Cache console vector
1 files changed,  +6, -1
+6, -1
 1@@ -191,12 +191,16 @@ close_console(void)
 2 	kill_child();
 3 }
 4 
 5+/* console registers */
 6+
 7+static int rVECTOR;
 8+
 9 int
10 console_input(int c, int type)
11 {
12 	if(c == EOF) c = 0, type = 4;
13 	uxn.dev[0x12] = c, uxn.dev[0x17] = type;
14-	uxn_eval(uxn.dev[0x10] << 8 | uxn.dev[0x11]);
15+	uxn_eval(rVECTOR);
16 	return type != 4;
17 }
18 
19@@ -226,6 +230,7 @@ console_deo(Uint8 addr)
20 {
21 	FILE *fd;
22 	switch(addr) {
23+	case 0x11: rV = PEEK2(&uxn.dev[0x10]); return;
24 	case 0x18: fd = stdout, fputc(uxn.dev[0x18], fd), fflush(fd); break;
25 	case 0x19: fd = stderr, fputc(uxn.dev[0x19], fd), fflush(fd); break;
26 	case CMD_EXEC: start_fork(); break;