Add shutdown command to PiSimple

This commit is contained in:
beeanyew
2021-07-29 17:33:12 +02:00
parent c9da0ea940
commit aa714f6f41
4 changed files with 12 additions and 0 deletions

View File

@@ -5,6 +5,10 @@ map type=rom address=0xF80000 size=0x80000 file=kick.rom ovl=0 id=kickstart
# Comment out the line above and uncomment the line below to automatically copy the ROM contents to Pi RAM if the file isn't found
#map type=rom address=0xF80000 size=0x80000 file=kick.rom ovl=0 id=kickstart autodump_mem
# "Blackhole" the detected slow RAM on the Amiga 600. This enables maprom to work without using specifically kick v40.63
# DO NOT ENABLE THIS UNLESS YOU ARE USING THE PISTORM ON AN AMIGA 600.
#map type=register address=0xC00000 size=0x80000 id=blackhole_slow_a600
# Want to map an extended ROM, such as CDTV or CD32?
#map type=rom address=0xF00000 size=0x80000 file=cdtv.rom id=extended

View File

@@ -81,6 +81,11 @@ int __stdargs main (int argc, char *argv[]) {
tmpshort = (unsigned short)atoi(argv[2]);
pi_reset_amiga(tmpshort);
break;
case PI_CMD_SHUTDOWN: {
unsigned short shutdown_confirm = pi_shutdown_pi(0);
pi_confirm_shutdown(shutdown_confirm);
break;
}
case PI_CMD_SWREV:
printf("PiStorm ----------------------------\n");
printf("Hardware revision: %d.%d\n", (pi_get_hw_rev() >> 8), (pi_get_hw_rev() & 0xFF));
@@ -197,6 +202,9 @@ int __stdargs main (int argc, char *argv[]) {
}
int get_command(char *cmd) {
if (strcmp(cmd, "--shutdown") == 0 || strcmp(cmd, "--safe-shutdown") == 0 || strcmp(cmd, "--:)") == 0) {
return PI_CMD_SHUTDOWN;
}
if (strcmp(cmd, "--restart") == 0 || strcmp(cmd, "--reboot") == 0 || strcmp(cmd, "--reset") == 0) {
return PI_CMD_RESET;
}