aboutsummaryrefslogtreecommitdiff
path: root/src/nio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nio.c')
-rw-r--r--src/nio.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/nio.c b/src/nio.c
index cdececb..399b06d 100644
--- a/src/nio.c
+++ b/src/nio.c
@@ -148,6 +148,22 @@ unsigned char nwrite(char* devicespec, unsigned char* buf, unsigned short len)
return OS.dcb.dstats; // Return SIO error or success.
}
+/* https://fujinet.online/wiki/?p=SIO-Command-%24FF-Reset-FujiNet */
+unsigned char nreset(void) {
+ OS.dcb.ddevic = 0x70;
+ OS.dcb.dunit = 1;
+ OS.dcb.dcomnd = 0xff; /* reset */
+ OS.dcb.dstats = DWRITE;
+ OS.dcb.dbuf = 0;
+ OS.dcb.dtimlo = TIMEOUT;
+ OS.dcb.dbyt = 0;
+ OS.dcb.daux = 0;
+ siov();
+
+ return OS.dvstat[DVSTAT_EXTENDED_ERROR]; // return extended status
+}
+
+
/* IRC doesn't need this */
#if 0
unsigned char nlogin(char* devicespec, char *login, char *password)