From 254cfbe342c68e4179ca557c6a643338ebff07a0 Mon Sep 17 00:00:00 2001 From: Adrian Conlon Date: Fri, 6 Sep 2019 23:55:57 +0100 Subject: [PATCH] Tidied up pin management to be synchronised with the .Net code. Signed-off-by: Adrian Conlon --- Intel8080/src/Intel8080.cpp | 1 - M6502/inc/mos6502.h | 1 - M6502/src/mos6502.cpp | 21 ++++++++++---------- MC6809/inc/mc6809.h | 2 -- MC6809/src/mc6809.cpp | 13 ++++++------- MC6850/inc/MC6850.h | 2 -- MC6850/src/MC6850.cpp | Bin 7816 -> 7776 bytes Z80/inc/Z80.h | 2 -- Z80/src/Z80.cpp | 37 ++++++++++++++++-------------------- inc/Device.h | 16 ++++++++++------ inc/IntelProcessor.h | 2 -- src/IntelProcessor.cpp | 14 ++++++++------ 12 files changed, 50 insertions(+), 61 deletions(-) diff --git a/Intel8080/src/Intel8080.cpp b/Intel8080/src/Intel8080.cpp index 3c70265..0292307 100644 --- a/Intel8080/src/Intel8080.cpp +++ b/Intel8080/src/Intel8080.cpp @@ -29,7 +29,6 @@ void EightBit::Intel8080::handleRESET() { tick(3); } - void EightBit::Intel8080::handleINT() { IntelProcessor::handleINT(); raiseHALT(); diff --git a/M6502/inc/mos6502.h b/M6502/inc/mos6502.h index 86257a0..a04696b 100644 --- a/M6502/inc/mos6502.h +++ b/M6502/inc/mos6502.h @@ -33,7 +33,6 @@ namespace EightBit { int execute() final; int step() final; - void raisePOWER() final; auto& X() { return x; } auto& Y() { return y; } diff --git a/M6502/src/mos6502.cpp b/M6502/src/mos6502.cpp index 13a7a67..9091fc8 100644 --- a/M6502/src/mos6502.cpp +++ b/M6502/src/mos6502.cpp @@ -2,23 +2,22 @@ #include "mos6502.h" EightBit::MOS6502::MOS6502(Bus& bus) -: LittleEndianProcessor(bus) {} +: LittleEndianProcessor(bus) { + RaisedPOWER.connect([this](EventArgs) { + X() = Bit7; + Y() = 0; + A() = 0; + P() = RF; + S() = Mask8; + lowerSYNC(); + }); +} DEFINE_PIN_LEVEL_CHANGERS(NMI, MOS6502); DEFINE_PIN_LEVEL_CHANGERS(SO, MOS6502); DEFINE_PIN_LEVEL_CHANGERS(SYNC, MOS6502); DEFINE_PIN_LEVEL_CHANGERS(RDY, MOS6502); -void EightBit::MOS6502::raisePOWER() { - LittleEndianProcessor::raisePOWER(); - X() = Bit7; - Y() = 0; - A() = 0; - P() = RF; - S() = Mask8; - lowerSYNC(); -} - int EightBit::MOS6502::step() { resetCycles(); ExecutingInstruction.fire(*this); diff --git a/MC6809/inc/mc6809.h b/MC6809/inc/mc6809.h index 7c5e595..a14edd3 100644 --- a/MC6809/inc/mc6809.h +++ b/MC6809/inc/mc6809.h @@ -60,8 +60,6 @@ namespace EightBit { virtual int execute() final; virtual int step() final; - virtual void raisePOWER() final; - auto& D() { return m_d; } auto& A() { return D().high; } auto& B() { return D().low; } diff --git a/MC6809/src/mc6809.cpp b/MC6809/src/mc6809.cpp index 91361aa..a62a654 100644 --- a/MC6809/src/mc6809.cpp +++ b/MC6809/src/mc6809.cpp @@ -5,7 +5,12 @@ #include EightBit::mc6809::mc6809(Bus& bus) -: BigEndianProcessor(bus) {} +: BigEndianProcessor(bus) { + RaisedPOWER.connect([this](EventArgs) { + lowerBA(); + lowerBS(); + }); +} DEFINE_PIN_LEVEL_CHANGERS(NMI, mc6809); DEFINE_PIN_LEVEL_CHANGERS(FIRQ, mc6809); @@ -13,12 +18,6 @@ DEFINE_PIN_LEVEL_CHANGERS(HALT, mc6809); DEFINE_PIN_LEVEL_CHANGERS(BA, mc6809); DEFINE_PIN_LEVEL_CHANGERS(BS, mc6809); -void EightBit::mc6809::raisePOWER() { - BigEndianProcessor::raisePOWER(); - lowerBA(); - lowerBS(); -} - int EightBit::mc6809::step() { resetCycles(); ExecutingInstruction.fire(*this); diff --git a/MC6850/inc/MC6850.h b/MC6850/inc/MC6850.h index a5f7c08..bac5d78 100644 --- a/MC6850/inc/MC6850.h +++ b/MC6850/inc/MC6850.h @@ -10,8 +10,6 @@ namespace EightBit { public: mc6850(); - void raisePOWER() final; - // +--------+----------------------------------------------------------------------------------+ // | | Buffer address | // | +------------------+------------------+--------------------+-----------------------+ diff --git a/MC6850/src/MC6850.cpp b/MC6850/src/MC6850.cpp index a9d51944b93903a3f3606873e6335a819e2452fb..3645f2d14a98b25825dda9b8613731c8feb35f71 100644 GIT binary patch delta 70 zcmeCMePA42cYx48;to3@Ho&4E_w^46Y186Hh8nekLQpt;wLk YP|W~VI60clc(W1XC6>)6*bayT0G);sX#fBK delta 111 zcmaE0(_uSd&%^^wn{P25WARR8$YdyHNM#6M@Mj2TaAgQ$&|uJHP++KL;AP-q;AC)S y$YIE5NM^_es!0LzGJxs}7_5M>hyhLS