Start adding comparison operations to EightBit classes

This commit is contained in:
Adrian Conlon committed 2021-12-27 14:24:38 +00:00
1 parent af7679505c
commit 945fcefb36
16 files changed
+154 -34

No files matched your search

+18 -1
View File
@@ -13,11 +13,16 @@ EightBit::IntelProcessor::IntelProcessor(Bus& bus)
RaisedHALT.connect([this](EventArgs) noexcept { ++PC(); });
RaisedPOWER.connect([this](EventArgs) {
PC() = SP() = AF() = BC() = DE() = HL() = Mask16;
PC() = SP() = Mask16;
resetWorkingRegisters();
raiseHALT();
});
}
void EightBit::IntelProcessor::resetWorkingRegisters() {
AF() = BC() = DE() = HL() = Mask16;
}
DEFINE_PIN_LEVEL_CHANGERS(HALT, IntelProcessor);
void EightBit::IntelProcessor::handleRESET() {
@@ -85,3 +90,15 @@ void EightBit::IntelProcessor::ret() {
Processor::ret();
MEMPTR() = PC();
}
bool EightBit::IntelProcessor::operator==(const EightBit::IntelProcessor& rhs) const {
return
Processor::operator==(rhs)
&& HALT() == rhs.HALT()
&& MEMPTR() == rhs.MEMPTR()
&& SP() == rhs.SP()
&& AF() == rhs.AF()
&& BC() == rhs.BC()
&& DE() == rhs.DE()
&& HL() == rhs.HL();
}