mirror of
https://github.com/sethm/symon.git
synced 2025-04-13 14:40:08 +00:00
implement overrun flag for 6850 ACIA
This commit is contained in:
parent
0d0fddc365
commit
8f52e1da1e
@ -86,6 +86,20 @@ public class Acia6850 extends Acia {
|
||||
throw new MemoryAccessException("No register.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized int rxRead() {
|
||||
overrun = false;
|
||||
return super.rxRead();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void rxWrite(int data) {
|
||||
if(rxFull) {
|
||||
overrun = true;
|
||||
}
|
||||
super.rxWrite(data);
|
||||
}
|
||||
|
||||
|
||||
private void setCommandRegister(int data) {
|
||||
|
@ -125,6 +125,24 @@ public class AciaTest6850 {
|
||||
|
||||
assertEquals(0x01, acia.read(CMD_STAT_REG) & 0x03);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aciaShouldOverrunAndReadShouldReset()
|
||||
throws Exception {
|
||||
|
||||
Acia acia = newAcia();
|
||||
|
||||
// overrun ACIA
|
||||
acia.rxWrite('a');
|
||||
acia.rxWrite('b');
|
||||
|
||||
assertEquals(0x20, acia.read(CMD_STAT_REG) & 0x20);
|
||||
|
||||
// read should reset
|
||||
acia.rxRead();
|
||||
assertEquals(0x00, acia.read(CMD_STAT_REG) & 0x20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readingBuffersShouldResetStatus()
|
||||
|
Loading…
x
Reference in New Issue
Block a user