mirror of
https://github.com/sethm/symon.git
synced 2025-03-13 13:30:37 +00:00
Make the emulated 6551's hardware reset state match the MOS datasheet.
This commit is contained in:
parent
b725fb5fdd
commit
d076046f57
@ -53,6 +53,14 @@ public class Acia6551 extends Acia {
|
||||
|
||||
public Acia6551(int address) throws MemoryRangeException {
|
||||
super(address, ACIA_SIZE, "ACIA");
|
||||
|
||||
// Figure 6 in the 6551 ACIA data sheet says the "hardware reset"
|
||||
// state of the Control Register is all zeros.
|
||||
setControlRegister(0b00000000);
|
||||
// Figure 7 of the 6551 ACIA data sheet says the "hardware reset"
|
||||
// state of the Command Register is zeros, but Transmitter Control
|
||||
// is set to "interrupt disabled, ready to send".
|
||||
setCommandRegister(0b00000010);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -254,4 +254,25 @@ public class AciaTest {
|
||||
|
||||
assertEquals(0x08, acia.read(0x0001, true));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void statusRegisterInitializedAtHardwareReset() throws Exception {
|
||||
Acia6551 acia = new Acia6551(0x0000);
|
||||
|
||||
assertEquals(0x10, acia.read(0x0001, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void commandRegisterInitializedAtHardwareReset() throws Exception {
|
||||
Acia6551 acia = new Acia6551(0x0000);
|
||||
|
||||
assertEquals(0x02, acia.read(0x0002, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void controlRegisterInitializedAtHardwareReset() throws Exception {
|
||||
Acia6551 acia = new Acia6551(0x0000);
|
||||
|
||||
assertEquals(0x00, acia.read(0x0003, false));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user