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
1 changed files with 7 additions and 9 deletions

View File

@ -110,22 +110,20 @@ var state = 0;
var last_rd_done = 1;
function handleBusRead(){
if(!isNodeHigh(nodenames['_m1']) && !isNodeHigh(nodenames['_iorq'])) {
// Interrupt acknownledge cycle, force 0xFF onto the bus
// 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'])){
if(!isNodeHigh(nodenames['_rd']) && !isNodeHigh(nodenames['_mreq'])) {
// Memory read
var a = readAddressBus();
var d = eval(readTriggers[a]);
if(d == undefined)
d = mRead(readAddressBus());
if(!isNodeHigh(nodenames['_m1']) && !isNodeHigh(nodenames['_mreq'])) {
if(!isNodeHigh(nodenames['_m1'])) {
eval(fetchTriggers[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: