Skip to content

Commit

Permalink
Fix loop when running SUBMIT and autoexec together
Browse files Browse the repository at this point in the history
  • Loading branch information
MockbaTheBorg committed May 7, 2024
1 parent 094b66a commit 3771101
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions RunCPM/ccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,10 @@ void _ccp(void) {
for (i = 0; i < 36; ++i) {
_RamWrite(BatchFCB + i, _RamRead(tmpFCB + i));
}

// Loads an autoexec file if it exists and this is the first boot
// The file contents are loaded at ccpAddr+8 up to 126 bytes then the size loaded is stored at ccpAddr+7
if (firstBoot) {
if (firstBoot && !sFlag) {
uint8 dmabuf[128];
uint16 cmd = inBuf + 1;
if (_sys_exists((uint8*)AUTOEXEC)) {
Expand All @@ -718,7 +718,7 @@ void _ccp(void) {
_RamWrite(inBuf + 1, 0); // Clears the buffer
blen = 0;
}

while (TRUE) {
curDrive = (uint8)_ccp_bdos(DRV_GET, 0x0000); // Get current drive
curUser = (uint8)_ccp_bdos(F_USERNUM, 0x00FF); // Get current user
Expand Down
3 changes: 2 additions & 1 deletion RunCPM/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int main(int argc, char* argv[]) {

// Loads an autoexec file if it exists and this is the first boot
// The file contents are loaded at ccpAddr+8 up to 126 bytes then the size loaded is stored at ccpAddr+7
if (firstBoot) {
if (firstBoot an not sFlag) {
uint8 dmabuf[128];
uint8 bytesread;
uint16 cmd = CCPaddr + 7;
Expand All @@ -123,6 +123,7 @@ int main(int argc, char* argv[]) {
if (BOOTONLY)
firstBoot = FALSE;
}

Z80reset(); // Resets the Z80 CPU
SET_LOW_REGISTER(BC, _RamRead(DSKByte)); // Sets C to the current drive/user
PC = CCPaddr; // Sets CP/M application jump point
Expand Down

0 comments on commit 3771101

Please sign in to comment.