mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 00:29:47 +00:00
Bring the C++ code a little closer to the C# code.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
90bfac83d5
commit
dca2e1bb8e
@ -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());
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
|
Binary file not shown.
@ -64,6 +64,14 @@ namespace EightBit {
|
||||
static constexpr auto lowered(const PinLevel line) { return line == PinLevel::Low; }
|
||||
static void lower(PinLevel& line) noexcept { line = PinLevel::Low; }
|
||||
|
||||
static void match(PinLevel& line, int condition) {
|
||||
match(line, condition != 0);
|
||||
}
|
||||
|
||||
static void match(PinLevel& line, bool condition) {
|
||||
condition ? raise(line) : lower(line);
|
||||
}
|
||||
|
||||
virtual ~Device() {};
|
||||
|
||||
[[nodiscard]] bool powered() noexcept { return raised(POWER()); }
|
||||
|
Loading…
Reference in New Issue
Block a user