code clean-up
This commit is contained in:
parent
8eb01e558d
commit
237a7c482a
2 changed files with 13 additions and 10 deletions
21
tty.cpp
21
tty.cpp
|
@ -45,6 +45,14 @@ uint8_t tty::readByte(const uint16_t addr)
|
|||
return v;
|
||||
}
|
||||
|
||||
void tty::notify_rx()
|
||||
{
|
||||
registers[(PDP11TTY_TKS - PDP11TTY_BASE) / 2] |= 128;
|
||||
|
||||
if (registers[(PDP11TTY_TKS - PDP11TTY_BASE) / 2] & 64)
|
||||
b->getCpu()->queue_interrupt(4, 060);
|
||||
}
|
||||
|
||||
uint16_t tty::readWord(const uint16_t addr)
|
||||
{
|
||||
const int reg = (addr - PDP11TTY_BASE) / 2;
|
||||
|
@ -69,12 +77,8 @@ uint16_t tty::readWord(const uint16_t addr)
|
|||
|
||||
vtemp = ch | (parity(ch) << 7);
|
||||
|
||||
if (chars.empty() == false) {
|
||||
registers[(PDP11TTY_TKS - PDP11TTY_BASE) / 2] |= 128;
|
||||
|
||||
if (registers[(PDP11TTY_TKS - PDP11TTY_BASE) / 2] & 64)
|
||||
b->getCpu()->queue_interrupt(4, 060);
|
||||
}
|
||||
if (chars.empty() == false)
|
||||
notify_rx();
|
||||
}
|
||||
}
|
||||
else if (addr == PDP11TTY_TPS) {
|
||||
|
@ -96,10 +100,7 @@ void tty::operator()()
|
|||
|
||||
chars.push_back(c->get_char());
|
||||
|
||||
registers[(PDP11TTY_TKS - PDP11TTY_BASE) / 2] |= 128;
|
||||
|
||||
if (registers[(PDP11TTY_TKS - PDP11TTY_BASE) / 2] & 64)
|
||||
b->getCpu()->queue_interrupt(4, 060);
|
||||
notify_rx();
|
||||
}
|
||||
else {
|
||||
myusleep(100000);
|
||||
|
|
2
tty.h
2
tty.h
|
@ -35,6 +35,8 @@ private:
|
|||
std::thread *th { nullptr };
|
||||
std::atomic_bool stop_flag { false };
|
||||
|
||||
void notify_rx();
|
||||
|
||||
public:
|
||||
tty(console *const c, bus *const b);
|
||||
virtual ~tty();
|
||||
|
|
Loading…
Add table
Reference in a new issue