Allow BIC-files to be terminated with ^e.

This commit is contained in:
folkert van heusden 2023-03-26 11:15:03 +02:00
parent 0300738cbd
commit c282d1dcdd
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
3 changed files with 4 additions and 16 deletions

View file

@ -505,9 +505,9 @@ void run_bic(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop
c->setRegister(7, start_addr); c->setRegister(7, start_addr);
tty *const t = b->getTty(); *cnsl->get_running_flag() = true;
while(*stop_event == EVENT_NONE && t->get_reset_0x0a() == false) { while(*stop_event == EVENT_NONE) {
c->step_a(); c->step_a();
if (tracing) if (tracing)
@ -515,4 +515,6 @@ void run_bic(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop
c->step_b(); c->step_b();
} }
*cnsl->get_running_flag() = false;
} }

11
tty.cpp
View file

@ -26,15 +26,6 @@ tty::~tty()
{ {
} }
bool tty::get_reset_0x0a()
{
bool temp = had_0x0a;
had_0x0a = false;
return temp;
}
uint8_t tty::readByte(const uint16_t addr) uint8_t tty::readByte(const uint16_t addr)
{ {
uint16_t v = readWord(addr & ~1); uint16_t v = readWord(addr & ~1);
@ -112,8 +103,6 @@ void tty::writeWord(const uint16_t addr, uint16_t v)
DOLOG(debug, true, "PDP11TTY print '%c'", ch); DOLOG(debug, true, "PDP11TTY print '%c'", ch);
c->put_char(ch); c->put_char(ch);
had_0x0a |= ch == 0x0a; // for diagnostics
} }
DOLOG(debug, true, "set register %o to %o", addr, v); DOLOG(debug, true, "set register %o to %o", addr, v);

3
tty.h
View file

@ -25,14 +25,11 @@ private:
bool have_char_1 { false }; // RCVR BUSY bit high (11) bool have_char_1 { false }; // RCVR BUSY bit high (11)
bool have_char_2 { false }; // RCVR DONE bit high (7) bool have_char_2 { false }; // RCVR DONE bit high (7)
uint16_t registers[4] { 0 }; uint16_t registers[4] { 0 };
bool had_0x0a { false }; // used for diagnostics
public: public:
tty(console *const c); tty(console *const c);
virtual ~tty(); virtual ~tty();
bool get_reset_0x0a();
uint8_t readByte(const uint16_t addr); uint8_t readByte(const uint16_t addr);
uint16_t readWord(const uint16_t addr); uint16_t readWord(const uint16_t addr);