27 static inline void start_shell (
const char *reason,
int code )
31 conprintf(
"ABORT: %s %d\r\n", reason, code);
40 static void api_call (
Uint8 sysnum )
44 conputs(
"System RESET requested via API call.\r\n");
63 start_shell(
"Unknown/not-yet implemented API call C=",
Z80_C);
74 conputs(
"RESET, Xemu/RC2014 internal ROM\r\n(C)2020 LGB Gabor Lenart, part of the Xemu project.\r\n");
75 start_shell(NULL, -1);
86 start_shell(
"not implemented rst handler", n * 8);
89 start_shell(
"UNKNOWN rst handler", n);
97 static void shell_execute (
char *cmd )
103 static char command_buffer[127];
104 static int shell_mode;
108 command_buffer[0] = 0;
119 int command_size = strlen(command_buffer);
120 if ((
r == 8 ||
r == 127) && command_size) {
122 command_buffer[command_size - 1] = 0;
125 if (command_size < 30 && r >= 32 &&
r < 127) {
126 command_buffer[command_size] =
r;
127 command_buffer[command_size + 1] = 0;
131 if ((
r == 13 ||
r == 10) && command_size) {
133 shell_execute(command_buffer);
134 start_shell(NULL, -1);