Add R/W pins to the MC6809 and MOS6502 processors. Hoping it'll ease peripheral development.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2019-09-15 12:49:32 +01:00
parent 1ba238bfc7
commit ee3ecc682d
6 changed files with 72 additions and 52 deletions

View File

@@ -47,16 +47,13 @@ void Board::initialise() {
// Marshal data from memory -> ACIA
WrittenByte.connect([this] (EightBit::EventArgs&) {
updateAciaPins();
if (ACIA().selected()) {
ACIA().lower(ACIA().RW());
if (ACIA().selected())
accessAcia();
}
});
// Marshal data from ACIA -> memory
ReadingByte.connect([this] (EightBit::EventArgs&) {
updateAciaPins();
ACIA().raise(ACIA().RW());
if (accessAcia())
poke(ACIA().DATA());
});
@@ -113,6 +110,7 @@ EightBit::MemoryMapping Board::mapping(uint16_t address) {
void Board::updateAciaPins() {
ACIA().DATA() = DATA();
EightBit::Device::match(ACIA().RW(), CPU().RW());
EightBit::Device::match(ACIA().RS(), ADDRESS().word & EightBit::Chip::Bit0);
EightBit::Device::match(ACIA().CS0(), ADDRESS().word & EightBit::Chip::Bit15);
EightBit::Device::match(ACIA().CS1(), ADDRESS().word & EightBit::Chip::Bit13);