Don't override command extension if specified
Also: Bug fix(?) for DU: shortcut (wouldn't go back to drive A:).
@@ -489,14 +489,24 @@ uint8 _ccp_lua(void) {
// External (.COM) command
uint8 _ccp_ext(void) {
- bool error = TRUE, found;
+ bool error = TRUE, found = FALSE;
uint8 drive, user = 0;
uint16 loadAddr = defLoad;
+ bool wasBlank = (_RamRead(CmdFCB + 9) == ' ');
+ //printf("\n\rwasBlank: %s", wasBlank ? "True" : "False");
+ bool wasSUB = ((_RamRead(CmdFCB + 9) == 'S') &&
+ (_RamRead(CmdFCB + 10) == 'U') &&
+ (_RamRead(CmdFCB + 11) == 'B'));
+ //printf("\r\nwasSUB: %s", wasSUB ? "True" : "False");
+
+ if (!wasSUB) {
+ if (wasBlank) {
//first look for a .COM file
_RamWrite(CmdFCB + 9, 'C');
_RamWrite(CmdFCB + 10, 'O');
_RamWrite(CmdFCB + 11, 'M');
+ }
drive = _RamRead(CmdFCB); // Get the drive from the command FCB
found = !_ccp_bdos(F_OPEN, CmdFCB); // Look for the program on the FCB drive, current or specified
@@ -520,10 +530,11 @@ uint8 _ccp_ext(void) {
_RamWrite(CmdFCB, drive); // restore previous drive
_ccp_bdos(F_USERNUM, curUser); // restore to previous user
}
+ }
//if .COM not found then look for a .SUB file
- if (!found && !sFlag) { //don't auto-submit while executing a submit file
- //_puts(".COM file NOT found!\n");
+ if ((wasBlank || wasSUB) && !found && !sFlag) { //don't auto-submit while executing a submit file
+ //_puts("\n\rLooking for .SUB file");
_RamWrite(CmdFCB + 9, 'S');
_RamWrite(CmdFCB + 10, 'U');
@@ -746,7 +757,7 @@ void _ccp(void) {
errorFlag = TRUE;
break;
}
- if (tDrive != cDrive) {
+ if (tDrive != 0) {
cDrive = oDrive = tDrive - 1;
_RamWrite(DSKByte, (_RamRead(DSKByte) & 0xf0) | cDrive);
_ccp_bdos(DRV_SET, cDrive);
