Get the C++ version of the MC6850 synced with the C# version.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2019-05-27 10:57:02 +01:00
parent ca0a98d9a7
commit d37f130577
3 changed files with 8 additions and 17 deletions

View File

@ -19,8 +19,9 @@ void Board::raisePOWER() {
// Get the ACIA ready for action
ADDRESS() = 0b1010000000000000;
DATA() = EightBit::mc6850::CR0 | EightBit::mc6850::CR1; // Master reset
updateAciaPinsWrite();
ACIA().lower(ACIA().CTS());
ACIA().lower(ACIA().RW());
updateAciaPins();
ACIA().raisePOWER();
accessAcia();
}
@ -45,16 +46,17 @@ void Board::initialise() {
// Marshal data from memory -> ACIA
WrittenByte.connect([this] (EightBit::EventArgs&) {
updateAciaPinsWrite();
updateAciaPins();
if (ACIA().selected()) {
ACIA().DATA() = DATA();
ACIA().lower(ACIA().RW());
accessAcia();
}
});
// Marshal data from ACIA -> memory
ReadingByte.connect([this] (EightBit::EventArgs&) {
updateAciaPinsRead();
updateAciaPins();
ACIA().raise(ACIA().RW());
if (accessAcia())
poke(ACIA().DATA());
});

View File

@ -46,17 +46,6 @@ private:
EightBit::register16_t m_disassembleAt = 0x0000;
bool m_ignoreDisassembly = false;
// Use the bus data to update the ACIA access/address pins
void updateAciaPinsRead() {
ACIA().raise(ACIA().RW());
updateAciaPins();
}
void updateAciaPinsWrite() {
ACIA().lower(ACIA().RW());
updateAciaPins();
}
void updateAciaPins();
bool accessAcia();

View File

@ -204,8 +204,6 @@ namespace EightBit {
// Receive data register;
auto& RDR() { return m_RDR; }
void step();
bool activated() { return powered() && raised(E()) && selected(); }
bool selected();
@ -266,6 +264,8 @@ namespace EightBit {
DECLARE_PIN_OUTPUT(IRQ)
private:
void step();
uint8_t status();
void reset();