Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement iobyte for TTY #194

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion RunCPM/RunCPM.ino
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ void setup(void) {
pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);
Serial.begin(SERIALSPD);
Serial1.begin(SERIALSPD);
Serial2.begin(SERIALSPD);
while (!Serial) { // Wait until serial is connected
digitalWrite(LED, HIGH^LEDinv);
delay(sDELAY);
Expand Down Expand Up @@ -79,10 +81,25 @@ void setup(void) {
_PatchCPM();
Status = 0;
#ifndef CCP_INTERNAL
if (!_RamLoad((char *)CCPname, CCPaddr)) {
if (!_RamLoad((uint8 *)CCPname, CCPaddr)) {
_puts("Unable to load the CCP.\r\nCPU halted.\r\n");
break;
}
// 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 (_sys_exists((uint8*)AUTOEXEC)) {
uint16 cmd = CCPaddr + 8;
uint8 bytesread = (uint8)_RamLoadSz((uint8*)AUTOEXEC, cmd, 125);
uint8 blen = 0;
while (blen < bytesread && _RamRead(cmd + blen) > 31)
blen++;
_RamWrite(cmd + blen, 0x00);
_RamWrite(--cmd, blen);
}
if (BOOTONLY)
firstBoot = FALSE;
}
Z80reset();
SET_LOW_REGISTER(BC, _RamRead(DSKByte));
PC = CCPaddr;
Expand Down
Loading