From 0e7a4d7ab72237fcc1c88565d4ff14b14171ad1b Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Mon, 16 May 2022 17:09:47 +0200 Subject: [PATCH] Update to latest core with multiple file devices --- src/main.c | 15 ++++++++++----- src/uxn | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 29c4d5e..8d19d95 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,11 @@ halt(int stub) { exit(EXIT_SUCCESS); } +int +uxn_interrupt(void) { + return 1; +} + Time time_now(){ struct timespec t; @@ -434,7 +439,7 @@ system_deo_special(Device *d, u8 port) { } void -load_rom(char *file_name) { +load_uxn_rom(char *file_name) { FILE *file = fopen(file_name, "r"); if (!file) { fprintf(stderr, "error: couldn't open file: %s\n", file_name); @@ -460,7 +465,7 @@ init_uxn(Uxn *u, char *file_name) { uxn_boot(u, calloc(0x10000, sizeof(u8))); // Copy rom to VM. - load_rom(file_name); + load_uxn_rom(file_name); // Initialize framebuffer. ppu_init(); @@ -484,9 +489,9 @@ init_uxn(Uxn *u, char *file_name) { /* unused */ uxn_port(u, 0x7, nil_dei, nil_deo); /* control */ devctrl = uxn_port(u, 0x8, nil_dei, nil_deo); /* mouse */ devmouse = uxn_port(u, 0x9, nil_dei, nil_deo); - /* file */ uxn_port(u, 0xa, nil_dei, file_deo); - /* datetime */ uxn_port(u, 0xb, datetime_dei, nil_deo); - /* unused */ uxn_port(u, 0xc, nil_dei, nil_deo); + /* file0 */ uxn_port(u, 0xa, file_dei, file_deo); + /* file1 */ uxn_port(u, 0xb, file_dei, file_deo); + /* datetime */ uxn_port(u, 0xc, datetime_dei, nil_deo); /* unused */ uxn_port(u, 0xd, nil_dei, nil_deo); /* unused */ uxn_port(u, 0xe, nil_dei, nil_deo); /* unused */ uxn_port(u, 0xf, nil_dei, nil_deo); diff --git a/src/uxn b/src/uxn index 5057dd1..e00e74b 160000 --- a/src/uxn +++ b/src/uxn @@ -1 +1 @@ -Subproject commit 5057dd160a8a1672f25d6fc73eeb2379b87b86e1 +Subproject commit e00e74b9d043fef03a3692251fb792eabfcb4cd9