From 685c14f1f9673842ab92ec00c3542e61c4be9cd2 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 19 Mar 2026 04:29:39 -0400 Subject: Add /reboot command. --- doc/commands.txt | 6 ++++++ src/cmd.c | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/commands.txt b/doc/commands.txt index da820d4..7635ecd 100644 --- a/doc/commands.txt +++ b/doc/commands.txt @@ -154,3 +154,9 @@ in a channel. 0 = none, 1 = beep, 2 = flash, 3 = beep and flash. Send a SIO command to the FujiNet to reset it. This does the same thing as pressing the FujiNet's reset button. This command is for testing, and may be removed at some point. + +-------------------------------------------------------------------- +/reboot + +Quits IRC, resets the FujiNet (as /reset does), then reboots +the Atari. diff --git a/src/cmd.c b/src/cmd.c index 1042197..106eda8 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -34,6 +34,7 @@ static void do_quote(void); static void do_topic(void); static void do_ver(void); static void do_reset(void); +static void do_reboot(void); typedef struct { char *cmd; @@ -67,6 +68,7 @@ cmd_t command_defs[] = { { "QUIT", do_quit, 0 }, { "QUOTE", do_quote, 1 }, { "TOPIC", do_topic, 0 }, + { "REBOOT", do_reboot, 0 }, { "RESET", do_reset, 0 }, { "VER", do_ver, 0 }, { "VERSION", do_ver, 0 }, @@ -194,11 +196,27 @@ static void do_j(void) { static void do_quit(void) { reconnect_timeout = 0; /* do not reconnect on /quit */ txbuf_set_str("QUIT"); - if(arg1) + if(arg1) { txbuf_append_str2(" :", arg1); + } txbuf_send(); } +static void pause(void) { + OS.rtclok[2] = 0; + while(OS.rtclok[2] < hz) + /* NOP */; +} + +static void do_reboot(void) { + arg1 = "Rebooting again..."; + do_quit(); + pause(); + do_reset(); + pause(); + asm("jmp $e477"); +} + static void do_part(void) { if(arg1[0] == '#') { target = arg1; -- cgit v1.2.3