tui usability fixes

This commit is contained in:
folkert van heusden 2022-03-19 23:35:07 +01:00
parent 692404c1d6
commit 33dfee8c23
3 changed files with 37 additions and 8 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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)