From dca2e1bb8eda2d74bfb0a080dc85b4a31d11f0a2 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Sun, 2 Jun 2019 12:12:04 +0100 Subject: [PATCH] Bring the C++ code a little closer to the C# code. Signed-off-by: Adrian Conlon --- M6532/src/M6532.cpp | 2 +- MC6809/test/Board.cpp | 8 ++++---- MC6850/inc/MC6850.h | 2 +- MC6850/src/MC6850.cpp | Bin 8042 -> 7808 bytes inc/Device.h | 8 ++++++++ 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/M6532/src/M6532.cpp b/M6532/src/M6532.cpp index 35d5aef..ab2dc55 100644 --- a/M6532/src/M6532.cpp +++ b/M6532/src/M6532.cpp @@ -44,7 +44,7 @@ void EightBit::M6532::step() { if (interruptTimer) setFlag(IF(), Bit7); - interruptPA7 || interruptTimer ? lower(IRQ()) : raise(IRQ()); + match(IRQ(), !(interruptPA7 || interruptTimer)); const auto read = raised(RW()); const auto write = lowered(RW()); diff --git a/MC6809/test/Board.cpp b/MC6809/test/Board.cpp index 16e976c..ab49b05 100644 --- a/MC6809/test/Board.cpp +++ b/MC6809/test/Board.cpp @@ -113,10 +113,10 @@ EightBit::MemoryMapping Board::mapping(uint16_t address) { void Board::updateAciaPins() { ACIA().DATA() = DATA(); - ADDRESS().word & EightBit::Chip::Bit0 ? ACIA().raise(ACIA().RS()) : ACIA().lower(ACIA().RS()); - ADDRESS().word & EightBit::Chip::Bit15 ? ACIA().raise(ACIA().CS0()) : ACIA().lower(ACIA().CS0()); - ADDRESS().word & EightBit::Chip::Bit13 ? ACIA().raise(ACIA().CS1()) : ACIA().lower(ACIA().CS1()); - ADDRESS().word & EightBit::Chip::Bit14 ? ACIA().raise(ACIA().CS2()) : ACIA().lower(ACIA().CS2()); + 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); + EightBit::Device::match(ACIA().CS2(), ADDRESS().word & EightBit::Chip::Bit14); } bool Board::accessAcia() { diff --git a/MC6850/inc/MC6850.h b/MC6850/inc/MC6850.h index 47f2e02..a5f7c08 100644 --- a/MC6850/inc/MC6850.h +++ b/MC6850/inc/MC6850.h @@ -205,7 +205,7 @@ namespace EightBit { auto& RDR() { return m_RDR; } bool activated() { return powered() && raised(E()) && selected(); } - bool selected(); + bool selected() { return raised(CS0()) && raised(CS1()) && lowered(CS2()); } void markTransmitComplete(); void markReceiveStarting(); diff --git a/MC6850/src/MC6850.cpp b/MC6850/src/MC6850.cpp index 86d68b33929d45f646805a54be8317732b66ad64..c48ef131137ce1e3e51a5caf9e034ace11dec294 100644 GIT binary patch delta 51 zcmaE5*I>Kh3hU$_QhJ-uux(?P%w