Tidied up pin management to be synchronised with the .Net code.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2019-09-06 23:55:57 +01:00
parent e1f22f6903
commit 254cfbe342
12 changed files with 50 additions and 61 deletions

View File

@@ -5,16 +5,18 @@ EightBit::IntelProcessor::IntelProcessor(Bus& bus)
: LittleEndianProcessor(bus) {
for (int i = 0; i < 0x100; ++i)
m_decodedOpcodes[i] = i;
LoweredHALT.connect([this](EventArgs) { --PC(); });
RaisedHALT.connect([this](EventArgs) { ++PC(); });
RaisedPOWER.connect([this](EventArgs) {
raiseHALT();
SP() = AF() = BC() = DE() = HL() = Mask16;
});
}
DEFINE_PIN_LEVEL_CHANGERS(HALT, IntelProcessor);
void EightBit::IntelProcessor::raisePOWER() {
Processor::raisePOWER();
raiseHALT();
SP() = AF() = BC() = DE() = HL() = Mask16;
}
void EightBit::IntelProcessor::handleRESET() {
Processor::handleRESET();
PC() = 0;