AltairZ80: Additional checks for stop_cpu condition

This commit is contained in:
Peter Schorn 2023-04-20 17:05:48 +02:00 committed by Paul Koning
parent 044ba02847
commit 1aa76cca6e

View file

@ -770,6 +770,11 @@ static int32 sio0sCore(const int32 port, const int32 io, const int32 data) {
pollConnection();
if (io == 0) { /* IN */
if (sio_unit.u4) { /* attached to a file? */
ch = sim_poll_kbd(); /* yes, check for stop condition first */
if ((ch == SCPE_OK) && stop_cpu) {
sim_interval = 0; /* detect stop condition as soon as possible*/
return spi.sio_cannot_read | spi.sio_can_write; /* do not consume stop character */
}
if (sio_unit.u3) /* character available? */
return spi.sio_can_read | spi.sio_can_write;
ch = getc(sio_unit.fileref);
@ -783,6 +788,11 @@ static int32 sio0sCore(const int32 port, const int32 io, const int32 data) {
}
}
if (sio_unit.flags & UNIT_ATT) { /* attached to a port? */
ch = sim_poll_kbd(); /* yes, check for stop condition first */
if ((ch == SCPE_OK) && stop_cpu) {
sim_interval = 0; /* detect stop condition as soon as possible*/
return spi.sio_cannot_read | spi.sio_can_write; /* do not consume stop character */
}
if (tmxr_rqln(&TerminalLines[spi.terminalLine]))
result = spi.sio_can_read;
else {