Compare commits
2 Commits
db9f38b722
...
b3abf7f2cd
Author | SHA1 | Date |
---|---|---|
nino-porcino | b3abf7f2cd | |
nino-porcino | 550e0ba1cf |
|
@ -412,11 +412,11 @@ void send_directory_entry(int command) {
|
||||||
if(x != NULL) {
|
if(x != NULL) {
|
||||||
*x++ = 0;
|
*x++ = 0;
|
||||||
if(x[0]=='0' && x[1]=='6') {
|
if(x[0]=='0' && x[1]=='6') {
|
||||||
strcpy(type,"BIN ");
|
strcpy(type,"BIN $");
|
||||||
strcpy(address,x+2);
|
strcpy(address,x+2);
|
||||||
}
|
}
|
||||||
else if(x[0]=='F' && x[1]=='1') {
|
else if(x[0]=='F' && x[1]=='1') {
|
||||||
strcpy(type,"BAS ");
|
strcpy(type,"BAS $");
|
||||||
strcpy(address,x+2);
|
strcpy(address,x+2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
void comando_help() {
|
||||||
|
|
||||||
|
if(filename[0] == 0) {
|
||||||
|
// HELP (no arguments)
|
||||||
|
strcpy(filename, "COMMANDS");
|
||||||
|
} else {
|
||||||
|
// HELP <command>
|
||||||
|
// check if it's a valid command for a customized error
|
||||||
|
strcpy(command, filename);
|
||||||
|
find_cmd();
|
||||||
|
if(cmd == 0xFF) {
|
||||||
|
woz_puts("?UNKNOWN COMMAND \"");
|
||||||
|
woz_puts(filename);
|
||||||
|
woz_putc('"');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// builds the name of the help file
|
||||||
|
strcpy((char *)KEYBUFSTART, "/HELP/");
|
||||||
|
strcat((char *)KEYBUFSTART, filename);
|
||||||
|
strcat((char *)KEYBUFSTART, ".TXT");
|
||||||
|
|
||||||
|
strcpy(filename, (char *)KEYBUFSTART);
|
||||||
|
|
||||||
|
comando_type();
|
||||||
|
}
|
|
@ -86,9 +86,9 @@ void comando_load_bas() {
|
||||||
// print feedback to user
|
// print feedback to user
|
||||||
woz_putc('\r');
|
woz_putc('\r');
|
||||||
woz_puts(filename);
|
woz_puts(filename);
|
||||||
woz_putc('\r');
|
woz_puts("\r$");
|
||||||
woz_print_hexword(start_address);
|
woz_print_hexword(start_address);
|
||||||
woz_putc('.');
|
woz_puts("-$");
|
||||||
woz_print_hexword((word)token_ptr);
|
woz_print_hexword((word)token_ptr);
|
||||||
woz_puts(" (");
|
woz_puts(" (");
|
||||||
utoa(tmpword, filename, 10); // use filename as string buffer
|
utoa(tmpword, filename, 10); // use filename as string buffer
|
||||||
|
@ -168,9 +168,9 @@ void bas_file_info() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void bas_info() {
|
void bas_info() {
|
||||||
woz_puts("(LOMEM=");
|
woz_puts("(LOMEM=$");
|
||||||
woz_print_hexword((word) *BASIC_LOMEM);
|
woz_print_hexword((word) *BASIC_LOMEM);
|
||||||
woz_puts(" HIMEM=");
|
woz_puts(" HIMEM=$");
|
||||||
woz_print_hexword((word) *BASIC_HIMEM);
|
woz_print_hexword((word) *BASIC_HIMEM);
|
||||||
woz_putc(')');
|
woz_putc(')');
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,9 +50,9 @@ void comando_read() {
|
||||||
// print feedback to user
|
// print feedback to user
|
||||||
woz_putc('\r');
|
woz_putc('\r');
|
||||||
woz_puts(filename);
|
woz_puts(filename);
|
||||||
woz_putc('\r');
|
woz_puts("\r$");
|
||||||
woz_print_hexword(start_address);
|
woz_print_hexword(start_address);
|
||||||
woz_putc('.');
|
woz_puts("-$");
|
||||||
woz_print_hexword((word)token_ptr);
|
woz_print_hexword((word)token_ptr);
|
||||||
woz_puts(" (");
|
woz_puts(" (");
|
||||||
utoa(tmpword, filename, 10); // use filename as string buffer
|
utoa(tmpword, filename, 10); // use filename as string buffer
|
||||||
|
|
|
@ -60,9 +60,9 @@ void comando_write() {
|
||||||
// print feedback to user
|
// print feedback to user
|
||||||
woz_putc('\r');
|
woz_putc('\r');
|
||||||
woz_puts(filename);
|
woz_puts(filename);
|
||||||
woz_puts(":\r");
|
woz_puts(":\r$");
|
||||||
woz_print_hexword(start_address);
|
woz_print_hexword(start_address);
|
||||||
woz_putc('.');
|
woz_puts("-$");
|
||||||
woz_print_hexword(end_address);
|
woz_print_hexword(end_address);
|
||||||
woz_puts(" (");
|
woz_puts(" (");
|
||||||
utoa(tmpword, filename, 10); // use filename as string buffer
|
utoa(tmpword, filename, 10); // use filename as string buffer
|
||||||
|
|
|
@ -41,7 +41,9 @@ const byte CMD_MD = 17;
|
||||||
const byte CMD_RD = 18;
|
const byte CMD_RD = 18;
|
||||||
const byte CMD_PWD = 19;
|
const byte CMD_PWD = 19;
|
||||||
const byte CMD_TEST = 20;
|
const byte CMD_TEST = 20;
|
||||||
const byte CMD_EXIT = 21;
|
const byte CMD_HELP = 21;
|
||||||
|
const byte CMD_QMARK = 22;
|
||||||
|
const byte CMD_EXIT = 23;
|
||||||
|
|
||||||
// the list of recognized commands
|
// the list of recognized commands
|
||||||
byte *DOS_COMMANDS[] = {
|
byte *DOS_COMMANDS[] = {
|
||||||
|
@ -66,9 +68,16 @@ byte *DOS_COMMANDS[] = {
|
||||||
"RD",
|
"RD",
|
||||||
"PWD",
|
"PWD",
|
||||||
"TEST",
|
"TEST",
|
||||||
|
"HELP",
|
||||||
|
"?",
|
||||||
"EXIT"
|
"EXIT"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// chesum table
|
||||||
|
byte chksum_table[] = {
|
||||||
|
0xa7,0xe9,0xf8,0xef,0xeb,0xfe,0xef,0xee,0x8a,0xe8,0xf3,0xa7,0xa7,0xeb,0xe4,0xfe,0xe5,0xe4,0xe3,0xe4,0xe5,0x8a,0xfa,0xe5,0xf8,0xe9,0xe3,0xe4,0xe5,0x8a,0x8a,0x8a,0x82,0xf9,0xe5,0xec,0xfe,0xfd,0xeb,0xf8,0xef,0x83,0xa7,0xe9,0xe6,0xeb,0xff,0xee,0xe3,0xe5,0x8a,0xfa,0xeb,0xf8,0xe7,0xe3,0xed,0xe3,0xeb,0xe4,0xe3,0x8a,0x82,0xe2,0xeb,0xf8,0xee,0xfd,0xeb,0xf8,0xef,0x83,0xa7,0x00
|
||||||
|
};
|
||||||
|
|
||||||
// parse a string, get the first string delimited by space or end of string
|
// parse a string, get the first string delimited by space or end of string
|
||||||
// returns the parsed string in dest
|
// returns the parsed string in dest
|
||||||
// returns the number of character to advance the pointer
|
// returns the number of character to advance the pointer
|
||||||
|
@ -134,6 +143,11 @@ void strcat(char *dest, char *src) {
|
||||||
*dest = 0;
|
*dest = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void strcopy(char *dest, char *src) {
|
||||||
|
dest[0] = 0;
|
||||||
|
strcat(dest, src);
|
||||||
|
}
|
||||||
|
|
||||||
void append_hex_digit(char *dest, byte digit) {
|
void append_hex_digit(char *dest, byte digit) {
|
||||||
while(*dest) dest++;
|
while(*dest) dest++;
|
||||||
if(digit<10) digit += '0';
|
if(digit<10) digit += '0';
|
||||||
|
@ -162,6 +176,7 @@ void append_hex_tmpword(char *dest) {
|
||||||
#include "cmd_chdir.h"
|
#include "cmd_chdir.h"
|
||||||
#include "cmd_pwd.h"
|
#include "cmd_pwd.h"
|
||||||
#include "cmd_test.h"
|
#include "cmd_test.h"
|
||||||
|
#include "cmd_help.h"
|
||||||
|
|
||||||
void console() {
|
void console() {
|
||||||
|
|
||||||
|
@ -249,11 +264,19 @@ void console() {
|
||||||
woz_puts("?BAD ARGUMENT");
|
woz_puts("?BAD ARGUMENT");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(tmpword == 25858) {
|
||||||
|
// verify timeout checksum from MCU
|
||||||
|
token_ptr = chksum_table;
|
||||||
|
while(*token_ptr) {
|
||||||
|
woz_putc(*token_ptr++ ^ 0xAA);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
TIMEOUT_MAX = tmpword;
|
TIMEOUT_MAX = tmpword;
|
||||||
}
|
}
|
||||||
woz_puts("TIMEOUT MAX:");
|
woz_puts("TIMEOUT MAX: $");
|
||||||
woz_print_hexword(TIMEOUT_MAX);
|
woz_print_hexword(TIMEOUT_MAX);
|
||||||
woz_puts(" CURR:");
|
woz_puts(" CURR: $");
|
||||||
woz_print_hexword(TIMEOUT_RANGE);
|
woz_print_hexword(TIMEOUT_RANGE);
|
||||||
TIMEOUT_RANGE = 0;
|
TIMEOUT_RANGE = 0;
|
||||||
}
|
}
|
||||||
|
@ -379,6 +402,10 @@ void console() {
|
||||||
else if(cmd == CMD_TEST) {
|
else if(cmd == CMD_TEST) {
|
||||||
comando_test();
|
comando_test();
|
||||||
}
|
}
|
||||||
|
else if(cmd == CMD_HELP || cmd == CMD_QMARK) {
|
||||||
|
get_token(filename, 32); // parse filename
|
||||||
|
comando_help();
|
||||||
|
}
|
||||||
else if(cmd == CMD_EXIT) {
|
else if(cmd == CMD_EXIT) {
|
||||||
woz_puts("BYE\r");
|
woz_puts("BYE\r");
|
||||||
woz_mon();
|
woz_mon();
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
Syntax:
|
||||||
|
BAS
|
||||||
|
|
||||||
|
Prints LOMEM and HIMEM pointers from
|
||||||
|
the BASIC program currently loaded in
|
||||||
|
memory.
|
|
@ -0,0 +1,7 @@
|
||||||
|
Syntax:
|
||||||
|
CD path
|
||||||
|
|
||||||
|
Changes the current working directory
|
||||||
|
to the specified path. The current
|
||||||
|
directory is also shown in the command
|
||||||
|
prompt.
|
|
@ -0,0 +1,7 @@
|
||||||
|
commands list:
|
||||||
|
read, write, type, dump, load, save,
|
||||||
|
run, del, rm, dir, ls, cd, md, mkdir,
|
||||||
|
rd, rmdir, pwd, bas, jmp, time, test,
|
||||||
|
exit.
|
||||||
|
|
||||||
|
use help command for more detailed help
|
|
@ -0,0 +1,4 @@
|
||||||
|
Syntax:
|
||||||
|
DEL filename
|
||||||
|
|
||||||
|
Deletes a file from the SD card.
|
|
@ -0,0 +1,9 @@
|
||||||
|
Syntax:
|
||||||
|
DIR [path]
|
||||||
|
|
||||||
|
Lists the files from the specified
|
||||||
|
directory, or from the current
|
||||||
|
directory if no path is given.
|
||||||
|
Press any key to stop the file listing
|
||||||
|
and return to continue it. Press ESC
|
||||||
|
to return to the command prompt.
|
|
@ -0,0 +1,10 @@
|
||||||
|
Syntax:
|
||||||
|
DUMP filename [start] [end]
|
||||||
|
|
||||||
|
Reads the specified binary file from
|
||||||
|
the SD card and prints it on the screen
|
||||||
|
in hexadecimal format. start and end
|
||||||
|
are optional and are used to print a
|
||||||
|
smaller portion of the file. Press any
|
||||||
|
key to stop the printing and return to
|
||||||
|
the command prompt.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Syntax:
|
||||||
|
EXIT
|
||||||
|
|
||||||
|
Exits to the WOZ monitor.
|
|
@ -0,0 +1,5 @@
|
||||||
|
Syntax:
|
||||||
|
JMP address
|
||||||
|
|
||||||
|
Makes the CPU jump at the specified
|
||||||
|
address.
|
|
@ -0,0 +1,8 @@
|
||||||
|
Syntax:
|
||||||
|
LOAD filename
|
||||||
|
|
||||||
|
Loads a file from the SD card. filename
|
||||||
|
refers to a "tagged file name"
|
||||||
|
described above. For convenience,
|
||||||
|
filename can be partially given, the
|
||||||
|
first matching file will be loaded.
|
|
@ -0,0 +1,11 @@
|
||||||
|
Syntax:
|
||||||
|
LS [path]
|
||||||
|
|
||||||
|
Lists the files from the specified
|
||||||
|
directory, or from the current
|
||||||
|
directory if no path is given.
|
||||||
|
Output is in unix style, faster than
|
||||||
|
DIR command.
|
||||||
|
Press any key to stop the file listing
|
||||||
|
and return to continue it. Press ESC
|
||||||
|
to return to the command prompt.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Syntax:
|
||||||
|
MD path
|
||||||
|
|
||||||
|
Creates the specified directory.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Syntax:
|
||||||
|
MKDIR path
|
||||||
|
|
||||||
|
Creates the specified directory.
|
|
@ -0,0 +1,5 @@
|
||||||
|
Syntax:
|
||||||
|
PWD
|
||||||
|
|
||||||
|
Prints on the screen the current working
|
||||||
|
directory.
|
|
@ -0,0 +1,6 @@
|
||||||
|
Syntax:
|
||||||
|
RD path
|
||||||
|
|
||||||
|
Removes the specified directory.
|
||||||
|
The directory to remove must be empty
|
||||||
|
(no files or directories within).
|
|
@ -0,0 +1,6 @@
|
||||||
|
Syntax:
|
||||||
|
READ filename startaddress
|
||||||
|
|
||||||
|
Reads a binary file from the SD card
|
||||||
|
and loads it in memory at the specified
|
||||||
|
address.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Syntax:
|
||||||
|
RM filename
|
||||||
|
|
||||||
|
Deletes a file from the SD card.
|
|
@ -0,0 +1,6 @@
|
||||||
|
Syntax:
|
||||||
|
RMDIR path
|
||||||
|
|
||||||
|
Removes the specified directory.
|
||||||
|
The directory to remove must be empty
|
||||||
|
(no files or directories within).
|
|
@ -0,0 +1,8 @@
|
||||||
|
Syntax:
|
||||||
|
RUN filename
|
||||||
|
|
||||||
|
Same as LOAD but runs the file after
|
||||||
|
loading it. Binary files are exectuted
|
||||||
|
at the starting address specified in
|
||||||
|
the file name tag; BASIC files are RUN
|
||||||
|
from the BASIC interpreter.
|
|
@ -0,0 +1,12 @@
|
||||||
|
Syntax:
|
||||||
|
SAVE filename [start] [end]
|
||||||
|
|
||||||
|
Saves a file to the SD card. If start
|
||||||
|
and end are specified, a binary file
|
||||||
|
with tag #06 will be created with the
|
||||||
|
memory content from the address range
|
||||||
|
start-end (included). If start and
|
||||||
|
end are not specified, the BASIC
|
||||||
|
program currently loaded in memory
|
||||||
|
will be created with the
|
||||||
|
corresponding #F1 tag.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Syntax:
|
||||||
|
TEST
|
||||||
|
|
||||||
|
Internal test, not to be used.
|
|
@ -0,0 +1,6 @@
|
||||||
|
Syntax:
|
||||||
|
TIME value
|
||||||
|
|
||||||
|
Set the internal timeout value used in
|
||||||
|
the I/O operations with the SD cards.
|
||||||
|
-- TESTING ONLY ---
|
|
@ -0,0 +1,7 @@
|
||||||
|
Syntax:
|
||||||
|
TYPE filename
|
||||||
|
|
||||||
|
Reads the specified ASCII file from the
|
||||||
|
SD card and prints it on the screen.
|
||||||
|
Press any key to stop the printing and
|
||||||
|
return to the command prompt.
|
|
@ -0,0 +1,6 @@
|
||||||
|
Syntax:
|
||||||
|
WRITE filename startaddress endaddress
|
||||||
|
|
||||||
|
Writes the memory range from
|
||||||
|
startaddress to endaddress (inclusive)
|
||||||
|
in a file on the SD card.
|
Loading…
Reference in New Issue