Z80: updated handleBusRead() to leave the databus at 0xFF between reads

This commit is contained in:
David Banks 2018-10-08 10:27:36 +01:00
parent 924074e305
commit 5005774b1b

View File

@ -110,22 +110,20 @@ var state = 0;
var last_rd_done = 1; var last_rd_done = 1;
function handleBusRead(){ function handleBusRead(){
if(!isNodeHigh(nodenames['_m1']) && !isNodeHigh(nodenames['_iorq'])) { if(!isNodeHigh(nodenames['_rd']) && !isNodeHigh(nodenames['_mreq'])) {
// Interrupt acknownledge cycle, force 0xFF onto the bus // Memory read
// In IM0 this is seen as RST 0x38
// In IM1 this is ignored
// In IM2 this is used as the low byte of the vector
// TODO: ideally this "vector" would be a configurable parameter
writeDataBus(0xff);
} else if(!isNodeHigh(nodenames['_rd'])){
var a = readAddressBus(); var a = readAddressBus();
var d = eval(readTriggers[a]); var d = eval(readTriggers[a]);
if(d == undefined) if(d == undefined)
d = mRead(readAddressBus()); d = mRead(readAddressBus());
if(!isNodeHigh(nodenames['_m1']) && !isNodeHigh(nodenames['_mreq'])) { if(!isNodeHigh(nodenames['_m1'])) {
eval(fetchTriggers[d]); eval(fetchTriggers[d]);
} }
writeDataBus(d); writeDataBus(d);
} else {
// In all other cases we set the data bus to FF
// as a crude indicateion that it's not being driven
writeDataBus(0xff);
} }
// Prefix / displacement / opcode state machine, deals with: // Prefix / displacement / opcode state machine, deals with: