diff --git a/ESP32/main.ino b/ESP32/main.ino index e5bad1f..55f5b1b 100644 --- a/ESP32/main.ino +++ b/ESP32/main.ino @@ -172,6 +172,16 @@ void wifi(void *p) { if (client != -1) { clients.push_back(client); + constexpr const uint8_t dont_auth[] = { 0xff, 0xf4, 0x25, // don't auth + 0xff, 0xfb, 0x03, // suppress goahead + 0xff, 0xfe, 0x22, // don't line-mode + 0xff, 0xfe, 0x27, // don't new envt0 + 0xff, 0xfb, 0x01, // will echo + 0xff, 0xfe, 0x01, // don't echo + 0xff, 0xfd, 0x2d }; // no echo + + write(client, dont_auth, sizeof(dont_auth)); + // send initial terminal stat write(client, "\033[2J", 4); diff --git a/main.cpp b/main.cpp index 4f3e568..019f095 100644 --- a/main.cpp +++ b/main.cpp @@ -314,6 +314,21 @@ int main(int argc, char *argv[]) for(;;) { if (c->step()) { +#if !defined(ESP32) + FILE *fh = fopen("halt.mac", "wb"); + if (fh) { + uint16_t pc = 024320; + fprintf(fh, "\t.LINK %06o\n", pc); + + for(int i=0; i<4096; i += 2) + fprintf(fh, "\t.DW %06o\n", b->readWord((pc + i) & 0xffff)); + + fprintf(fh, "\tmake_raw\n"); + + fclose(fh); + } +#endif + //c->setRegister(7, 01000); //c->resetHalt(); break; diff --git a/rk05.cpp b/rk05.cpp index d0338f6..54db119 100644 --- a/rk05.cpp +++ b/rk05.cpp @@ -44,18 +44,22 @@ rk05::rk05(const std::string & file, bus *const b) : b(b) if (!sd.begin(SS, SD_SCK_MHZ(15))) sd.initErrorHalt(); - sd.ls("/", LS_DATE | LS_SIZE | LS_R); + for(;;) { + sd.ls("/", LS_DATE | LS_SIZE | LS_R); - while(Serial.available()) - Serial.read(); + while(Serial.available()) + Serial.read(); - std::string selected_file = read_terminal_line("Enter filename: "); + std::string selected_file = read_terminal_line("Enter filename: "); - Serial.print(F("Opening file: ")); - Serial.println(selected_file.c_str()); + Serial.print(F("Opening file: ")); + Serial.println(selected_file.c_str()); - if (!fh.open(selected_file.c_str(), O_RDWR)) - sd.errorHalt(F("rk05: open failed")); + if (fh.open(selected_file.c_str(), O_RDWR)) + break; + + Serial.println(F("rk05: open failed")); + } #else fh = fopen(file.c_str(), "rb"); if (!fh)