From 27703ad7065fcc1a74eb956a2efce79eacb8c7ae Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sun, 20 Mar 2022 14:05:05 +0100 Subject: [PATCH] Handle "HALT" correctly --- ESP32/main.ino | 4 ++-- cpu.cpp | 4 ++-- cpu.h | 6 ++---- tty.cpp | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ESP32/main.ino b/ESP32/main.ino index 409e32c..e1aadb9 100644 --- a/ESP32/main.ino +++ b/ESP32/main.ino @@ -254,8 +254,8 @@ void setup_wifi_stations() std::string password = read_terminal_line("password: "); WiFi.begin(ssid.c_str(), password.c_str()); #else - //WiFi.begin("www.vanheusden.com", "Ditiseentest31415926"); - WiFi.begin("NURDspace-guest", "harkharkhark"); + WiFi.begin("www.vanheusden.com", "Ditiseentest31415926"); + //WiFi.begin("NURDspace-guest", "harkharkhark"); #endif while (WiFi.status() != WL_CONNECTED) { diff --git a/cpu.cpp b/cpu.cpp index d27a4a3..93cc601 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -27,7 +27,7 @@ void cpu::reset() pc = 0; psw = 7 << 5; fpsr = 0; - runMode = resetFlag = haltFlag = false; + runMode = resetFlag = false; } void cpu::setDisassemble(const bool state) @@ -1007,7 +1007,7 @@ bool cpu::misc_operations(const uint16_t instr) switch(instr) { case 0b0000000000000000: // HALT // pretend HALT is not executed, proceed - haltFlag = true; + *event = 1; return true; case 0b0000000000000001: // WAIT diff --git a/cpu.h b/cpu.h index 0ece491..47075f6 100644 --- a/cpu.h +++ b/cpu.h @@ -16,9 +16,8 @@ private: uint16_t pc { 0 }; uint16_t psw { 0 }, fpsr { 0 }; uint16_t stackLimitRegister { 0 }; - bool haltFlag { false }, resetFlag { false }; - bool runMode { false }; - + bool resetFlag { false }; + bool runMode { false }; bool emulateMFPT { false }; bus *const b { nullptr }; @@ -54,7 +53,6 @@ public: void reset(); void step(); - void resetHalt() { haltFlag = false; } void resetReset() { resetFlag = false; } void pushStack(const uint16_t v); diff --git a/tty.cpp b/tty.cpp index 8d6575e..af6a4f3 100644 --- a/tty.cpp +++ b/tty.cpp @@ -66,7 +66,7 @@ uint16_t tty::readWord(const uint16_t addr) } else if (addr == PDP11TTY_TKB) { if (have_char) { - char c = get_char(); + uint8_t c = get_char(); vtemp = c | (parity(c) << 7);