mirror of
https://github.com/sethm/symon.git
synced 2025-08-08 20:25:01 +00:00
implement overrun flag for 6850 ACIA
This commit is contained in:
@@ -86,6 +86,20 @@ public class Acia6850 extends Acia {
|
|||||||
throw new MemoryAccessException("No register.");
|
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) {
|
private void setCommandRegister(int data) {
|
||||||
|
@@ -125,6 +125,24 @@ public class AciaTest6850 {
|
|||||||
|
|
||||||
assertEquals(0x01, acia.read(CMD_STAT_REG) & 0x03);
|
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
|
@Test
|
||||||
public void readingBuffersShouldResetStatus()
|
public void readingBuffersShouldResetStatus()
|
||||||
|
Reference in New Issue
Block a user