val &= 0x38;
switch (val) {
case 8:
- s->reg |= 0x8;
+ newreg |= 0x8;
break;
case 0x20:
s->rxint = 0;
handle_kbd_command(s, val);
}
s->txint = 1;
- s->rregs[0] |= 4;
+ s->rregs[0] |= 4; // Tx buffer empty
+ s->rregs[1] |= 1; // All sent
// Interrupts reported only on channel A
if (s->chn == 0)
s->rregs[3] |= 0x10;
s->reg = 0;
return ret;
case 1:
- SER_DPRINTF("Read channel %c, ch %d\n", channel? 'b' : 'a', s->rx);
s->rregs[0] &= ~1;
if (s->type == kbd)
ret = get_queue(s);
else
ret = s->rx;
+ SER_DPRINTF("Read channel %c, ch %d\n", channel? 'b' : 'a', ret);
return ret;
default:
break;
switch (val) {
case 1: // Reset, return type code
put_queue(s, 0xff);
- put_queue(s, 0xff);
put_queue(s, 5); // Type 5
break;
case 7: // Query layout