Skip to content

Commit

Permalink
Improve "no internals" option.
Browse files Browse the repository at this point in the history
  • Loading branch information
MockbaTheBorg committed Nov 17, 2024
1 parent 5b7ddbf commit 69b7d6f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions RunCPM/ccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ uint8 blen = 0; // Actual size of the typed command line (size o

static const char *Commands[] =
{
#ifdef Internals
// Standard CP/M commands
"DIR",
"ERA",
Expand All @@ -43,6 +44,7 @@ static const char *Commands[] =
"DEL",
"EXIT",
"PAGE",
#endif
"VOL",
"?",
NULL
Expand Down Expand Up @@ -71,8 +73,7 @@ uint8 _ccp_cnum(void) {
uint8 result = 255;
uint8 command[9];
uint8 i = 0;

#ifdef Internals

if (!_RamRead(CmdFCB)) { // If a drive was set, then the command is external
while (i < 8 && _RamRead(CmdFCB + i + 1) != ' ') {
command[i] = _RamRead(CmdFCB + i + 1);
Expand All @@ -89,6 +90,9 @@ uint8 _ccp_cnum(void) {
++i;
}
}
#ifndef Internals
if (result != 255)
result += 10;
#endif
return (result);
} // _ccp_cnum
Expand Down Expand Up @@ -369,6 +373,7 @@ uint8 _ccp_page(void) {
}
return (error);
} // _ccp_page
#endif

// VOL command
uint8 _ccp_vol(void) {
Expand Down Expand Up @@ -417,7 +422,6 @@ uint8 _ccp_hlp(void) {
_puts("\t which comes from each volume's INFO.TXT");
return(FALSE);
}
#endif

// External (.COM) command
uint8 _ccp_ext(void) {
Expand Down Expand Up @@ -833,6 +837,7 @@ void _ccp(void) {
i = _ccp_page();
break;
}
#endif

case 10: { // VOL
i = _ccp_vol();
Expand All @@ -843,7 +848,6 @@ void _ccp(void) {
i = _ccp_hlp();
break;
}
#endif

// External commands
case 255: { // It is an external command
Expand Down

0 comments on commit 69b7d6f

Please sign in to comment.