Z80: remove special command as it caused code overflow

Change-Id: If3a71ea55503ac0edb8d476c05f4f909f0e3c605
This commit is contained in:
David Banks 2019-08-20 09:39:49 +01:00
parent efdd41a239
commit e66b0b51c2

View File

@ -10,7 +10,7 @@
* VERSION and NAME are used in the start-up message * VERSION and NAME are used in the start-up message
********************************************************/ ********************************************************/
#define VERSION "0.74" #define VERSION "0.75"
#if (CPU == Z80) #if (CPU == Z80)
#define NAME "ICE-T80" #define NAME "ICE-T80"
@ -26,21 +26,13 @@
* User Command Definitions * User Command Definitions
********************************************************/ ********************************************************/
#ifdef CPUEMBEDDED #define NUM_CMDS (sizeof(cmdStrings) / sizeof (char *))
#if (CPU == Z80)
#define NUM_CMDS 31
#else
#define NUM_CMDS 24
#endif
#else
#define NUM_CMDS 14
#endif
// The command process accepts abbreviated forms, for example // The command process accepts abbreviated forms, for example
// if h is entered, then help will match. // if h is entered, then help will match.
// Must be kept in step with cmdFuncs (just below) // Must be kept in step with cmdFuncs (just below)
char *cmdStrings[NUM_CMDS] = { char *cmdStrings[] = {
"help", "help",
"continue", "continue",
"step", "step",
@ -59,7 +51,9 @@ char *cmdStrings[NUM_CMDS] = {
#endif #endif
"test", "test",
"srec", "srec",
#if (CPU == 6502)
"special", "special",
#endif
#endif #endif
"reset", "reset",
"trace", "trace",
@ -81,7 +75,7 @@ char *cmdStrings[NUM_CMDS] = {
}; };
// Must be kept in step with cmdStrings (just above) // Must be kept in step with cmdStrings (just above)
void (*cmdFuncs[NUM_CMDS])(char *params) = { void (*cmdFuncs[])(char *params) = {
doCmdHelp, doCmdHelp,
doCmdContinue, doCmdContinue,
doCmdStep, doCmdStep,
@ -100,7 +94,9 @@ void (*cmdFuncs[NUM_CMDS])(char *params) = {
#endif #endif
doCmdTest, doCmdTest,
doCmdSRec, doCmdSRec,
#if (CPU == 6502)
doCmdSpecial, doCmdSpecial,
#endif
#endif #endif
doCmdReset, doCmdReset,
doCmdTrace, doCmdTrace,
@ -1164,6 +1160,7 @@ void doCmdSRec(char *params) {
} }
#if (CPU == 6502)
void logSpecial(char *function, int value) { void logSpecial(char *function, int value) {
log0("%s", function); log0("%s", function);
if (value) { if (value) {
@ -1174,7 +1171,6 @@ void logSpecial(char *function, int value) {
} }
void doCmdSpecial(char *params) { void doCmdSpecial(char *params) {
#if (CPU == 6502)
int special = -1; int special = -1;
sscanf(params, "%x", &special); sscanf(params, "%x", &special);
if (special >= 0 && special <= 3) { if (special >= 0 && special <= 3) {
@ -1183,10 +1179,8 @@ void doCmdSpecial(char *params) {
} }
logSpecial("NMI", CTRL_PORT & (1 << SPECIAL_1)); logSpecial("NMI", CTRL_PORT & (1 << SPECIAL_1));
logSpecial("IRQ", CTRL_PORT & (1 << SPECIAL_0)); logSpecial("IRQ", CTRL_PORT & (1 << SPECIAL_0));
#else
log0("Special functions not implemented\n");
#endif
} }
#endif
#endif // CPUEMBEDDED #endif // CPUEMBEDDED