Add MREQ (to go along with IORQ) to the Z80 implementation.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon 2019-11-02 17:38:20 +00:00
parent 687df0023a
commit 6d90ea6237
2 changed files with 6 additions and 0 deletions

View File

@ -85,6 +85,7 @@ namespace EightBit {
DECLARE_PIN_INPUT(NMI)
DECLARE_PIN_OUTPUT(M1)
DECLARE_PIN_OUTPUT(MREQ)
DECLARE_PIN_OUTPUT(IORQ)
DECLARE_PIN_OUTPUT(RD)
DECLARE_PIN_OUTPUT(WR)

View File

@ -34,6 +34,7 @@ EightBit::Z80::Z80(Bus& bus, InputOutput& ports)
DEFINE_PIN_LEVEL_CHANGERS(NMI, Z80);
DEFINE_PIN_LEVEL_CHANGERS(M1, Z80);
DEFINE_PIN_LEVEL_CHANGERS(MREQ, Z80);
DEFINE_PIN_LEVEL_CHANGERS(IORQ, Z80);
DEFINE_PIN_LEVEL_CHANGERS(RD, Z80);
DEFINE_PIN_LEVEL_CHANGERS(WR, Z80);
@ -55,15 +56,19 @@ EightBit::register16_t& EightBit::Z80::HL() {
}
void EightBit::Z80::busWrite() {
lowerMREQ();
lowerWR();
IntelProcessor::busWrite();
raiseWR();
raiseMREQ();
}
uint8_t EightBit::Z80::busRead() {
lowerMREQ();
lowerRD();
const auto returned = IntelProcessor::busRead();
raiseRD();
raiseMREQ();
return returned;
}