From 9b9aae555e6c028915e144645aa24a07d323f2e3 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 30 Jun 2024 21:26:47 -0800 Subject: [PATCH] Do not pass memory to file_deo --- src/devices/controller.h | 2 -- src/devices/datetime.h | 2 -- src/devices/file.c | 3 ++- src/devices/file.h | 4 +--- src/uxn11.c | 4 ++-- src/uxncli.c | 4 ++-- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/devices/controller.h b/src/devices/controller.h index 2d4fa7f..376d2ff 100644 --- a/src/devices/controller.h +++ b/src/devices/controller.h @@ -9,8 +9,6 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ -#define CONTROL_VERSION 1 - void controller_down(Uint8 mask); void controller_up(Uint8 mask); void controller_key(Uint8 key); diff --git a/src/devices/datetime.h b/src/devices/datetime.h index cc56e66..315389b 100644 --- a/src/devices/datetime.h +++ b/src/devices/datetime.h @@ -9,6 +9,4 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ -#define DATETIME_VERSION 1 - Uint8 datetime_dei(Uint8 addr); diff --git a/src/devices/file.c b/src/devices/file.c index 933ae73..daa2814 100644 --- a/src/devices/file.c +++ b/src/devices/file.c @@ -245,10 +245,11 @@ file_delete(UxnFile *c) /* IO */ void -file_deo(Uint8 id, Uint8 *d, Uint8 port) +file_deo(Uint8 id, Uint8 port) { UxnFile *c = &uxn_file[id]; Uint16 addr, len, res; + Uint8 *d = id ? &uxn.dev[0xb0] : &uxn.dev[0xa0]; switch(port) { case 0x5: addr = PEEK2(d + 0x4); diff --git a/src/devices/file.h b/src/devices/file.h index 22ec544..ac6b05d 100644 --- a/src/devices/file.h +++ b/src/devices/file.h @@ -9,9 +9,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ -#define FILE_VERSION 1 - #define POLYFILEY 2 #define DEV_FILE0 0xa -void file_deo(Uint8 id, Uint8 *d, Uint8 port); +void file_deo(Uint8 id, Uint8 port); diff --git a/src/uxn11.c b/src/uxn11.c index 37710f1..056824e 100644 --- a/src/uxn11.c +++ b/src/uxn11.c @@ -69,8 +69,8 @@ emu_deo(Uint8 addr, Uint8 value) break; case 0x10: console_deo(p); break; case 0x20: screen_deo(p); break; - case 0xa0: file_deo(0, &uxn.dev[d], p); break; - case 0xb0: file_deo(1, &uxn.dev[d], p); break; + case 0xa0: file_deo(0, p); break; + case 0xb0: file_deo(1, p); break; } } diff --git a/src/uxncli.c b/src/uxncli.c index 80f3640..d950c9e 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -39,8 +39,8 @@ emu_deo(Uint8 addr, Uint8 value) switch(d) { case 0x00: system_deo(p); break; case 0x10: console_deo(p); break; - case 0xa0: file_deo(0, &uxn.dev[d], p); break; - case 0xb0: file_deo(1, &uxn.dev[d], p); break; + case 0xa0: file_deo(0, p); break; + case 0xb0: file_deo(1, p); break; } }