PDP11: Improve idling.

This commit is contained in:
Lars Brinkhoff 2022-10-26 12:59:49 +02:00 committed by Paul Koning
parent eb359b962f
commit 34c4ab3cd5
4 changed files with 16 additions and 9 deletions

View file

@ -157,7 +157,7 @@ DIB dci_dib = {
2, IVCL (DCI), VEC_AUTO, { &dci_iack, &dco_iack }, IOLN_DC,
};
UNIT dci_unit = { UDATA (&dci_svc, 0, 0), TMLN_SPD_9600_BPS };
UNIT dci_unit = { UDATA (&dci_svc, UNIT_IDLE, 0), TMLN_SPD_9600_BPS };
REG dci_reg[] = {
{ BRDATAD (BUF, dci_buf, DEV_RDX, 8, DCX_LINES, "input control/stats register") },

View file

@ -81,8 +81,8 @@ DIB dh_dib = {
};
UNIT dh_unit[] = {
{ UDATA (&dh_input_svc, UNIT_ATTABLE, 0) },
{ UDATA (&dh_output_svc, UNIT_DIS, 0) }
{ UDATA (&dh_input_svc, UNIT_ATTABLE | UNIT_IDLE, 0) },
{ UDATA (&dh_output_svc, UNIT_DIS | UNIT_IDLE, 0) }
};
REG dh_reg[] = {

View file

@ -58,7 +58,7 @@ DIB ng_dib = {
};
UNIT ng_unit = {
UDATA (&ng_svc, 0, 0), NG_DELAY
UDATA (&ng_svc, UNIT_IDLE, 0), NG_DELAY
};
REG ng_reg[] = {
@ -133,8 +133,14 @@ t_stat
ng_wr(int32 data, int32 PA, int32 access)
{
switch (PA & 002) {
case 000: ng_set_csr(data); return SCPE_OK;
case 002: ng_set_reloc(data); return SCPE_OK;
case 000:
ng_set_csr(data);
if (data & 010000)
sim_activate (&ng_unit, 1);
return SCPE_OK;
case 002:
ng_set_reloc(data);
return SCPE_OK;
}
return SCPE_NXM;
}
@ -185,7 +191,6 @@ ng_reset(DEVICE *dptr)
CLR_INT (NG);
ng_unit.wait = 100;
sim_activate (dptr->units, 1);
set_cmd (0, "DZ DISABLED"); /* Conflict with NG. */
set_cmd (0, "HK DISABLED"); /* Conflict with RF. */

View file

@ -308,6 +308,7 @@ ng_cycle(int us, int slowdown)
static uint32 usec = 0;
static uint32 msec = 0;
uint32 new_msec;
int running = 0;
int saved;
new_msec = (usec += us) / 1000;
@ -323,7 +324,7 @@ ng_cycle(int us, int slowdown)
if ((status[0] & 1) == 0)
goto age_ret;
} else if (ng_type != TYPE_DAZZLE)
return 1;
return 0;
if (sync_period)
goto age_ret;
@ -333,6 +334,7 @@ ng_cycle(int us, int slowdown)
if (ng_type == TYPE_DAZZLE && (status[console] & TKRUN) == 0)
continue;
running = 1;
time_out = fetch(dpc[console], &inst);
DEBUGF("[%d] PC %06o, INSTR %06o\n", console, dpc[console], inst);
dpc[console] += 2;
@ -355,5 +357,5 @@ ng_cycle(int us, int slowdown)
age_ret:
display_age(us, slowdown);
return 1;
return running || !display_is_blank();
}