Use macros to define our device pins.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2019-01-14 23:17:54 +00:00
parent 4d08487513
commit f0376fa81e
14 changed files with 92 additions and 287 deletions
+1 -9
View File
@@ -1,12 +1,4 @@
#include "stdafx.h"
#include "Device.h"
void EightBit::Device::raisePOWER() {
raise(POWER());
RaisedPOWER.fire(EventArgs::empty());
}
void EightBit::Device::lowerPOWER() {
lower(POWER());
LoweredPOWER.fire(EventArgs::empty());
}
DEFINE_PIN_LEVEL_CHANGERS(POWER, Device);
+2 -10
View File
@@ -7,22 +7,14 @@ EightBit::IntelProcessor::IntelProcessor(Bus& bus)
m_decodedOpcodes[i] = i;
}
DEFINE_PIN_LEVEL_CHANGERS(HALT, IntelProcessor);
void EightBit::IntelProcessor::raisePOWER() {
Processor::raisePOWER();
raiseHALT();
SP() = AF() = BC() = DE() = HL() = Mask16;
}
void EightBit::IntelProcessor::lowerHALT() {
lower(HALT());
LoweredHALT.fire(EventArgs::empty());
}
void EightBit::IntelProcessor::raiseHALT() {
raise(HALT());
RaisedHALT.fire(EventArgs::empty());
}
void EightBit::IntelProcessor::handleRESET() {
Processor::handleRESET();
PC() = 0;
+2 -19
View File
@@ -5,25 +5,8 @@ EightBit::Processor::Processor(Bus& bus)
: m_bus(bus) {
}
void EightBit::Processor::lowerRESET() {
lower(RESET());
LoweredRESET.fire(EventArgs::empty());
}
void EightBit::Processor::raiseRESET() {
raise(RESET());
RaisedRESET.fire(EventArgs::empty());
}
void EightBit::Processor::lowerINT() {
lower(INT());
LoweredINT.fire(EventArgs::empty());
}
void EightBit::Processor::raiseINT() {
raise(INT());
RaisedINT.fire(EventArgs::empty());
}
DEFINE_PIN_LEVEL_CHANGERS(RESET, Processor);
DEFINE_PIN_LEVEL_CHANGERS(INT, Processor);
void EightBit::Processor::handleRESET() {
raiseRESET();