mirror of
https://github.com/open-simh/simh.git
synced 2026-01-26 20:23:09 +00:00
PDP1, PDP18B: Fixed dt_seterr to handle nx unit select (COVERITY)
This commit is contained in:
committed by
Mark Pizzolato
parent
43d8ee6323
commit
8029b1075f
@@ -1,6 +1,6 @@
|
||||
/* pdp18b_dt.c: 18b DECtape simulator
|
||||
|
||||
Copyright (c) 1993-2016, Robert M Supnik
|
||||
Copyright (c) 1993-2017, Robert M Supnik
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
@@ -27,6 +27,7 @@
|
||||
(PDP-9) TC02/TU55 DECtape
|
||||
(PDP-15) TC15/TU56 DECtape
|
||||
|
||||
09-Mar-17 RMS Fixed dt_seterr to handle nx unit select (COVERITY)
|
||||
10-Mar-16 RMS Added 3-cycle databreak set/show entries
|
||||
07-Mar-16 RMS Revised for dynamically allocated memory
|
||||
13-Mar-15 RMS Added APIVEC register
|
||||
@@ -1269,16 +1270,17 @@ return SCPE_OK;
|
||||
|
||||
void dt_seterr (UNIT *uptr, int32 e)
|
||||
{
|
||||
int32 mot = DTS_GETMOT (uptr->STATE);
|
||||
|
||||
dtsa = dtsa & ~DTA_STSTP; /* clear go */
|
||||
dtsb = dtsb | DTB_ERF | e; /* set error flag */
|
||||
if (mot >= DTS_ACCF) { /* ~stopped or stopping? */
|
||||
sim_cancel (uptr); /* cancel activity */
|
||||
if (dt_setpos (uptr)) /* update position */
|
||||
return;
|
||||
sim_activate (uptr, dt_dctime); /* sched decel */
|
||||
DTS_SETSTA (DTS_DECF | (mot & DTS_DIR), 0); /* state = decel */
|
||||
if (uptr != NULL) { /* valid select? */
|
||||
int32 mot = DTS_GETMOT (uptr->STATE); /* get motion */
|
||||
if (mot >= DTS_ACCF) { /* ~stopped or stopping? */
|
||||
sim_cancel (uptr); /* cancel activity */
|
||||
if (dt_setpos (uptr)) /* update position */
|
||||
return;
|
||||
sim_activate (uptr, dt_dctime); /* sched decel */
|
||||
DTS_SETSTA (DTS_DECF | (mot & DTS_DIR), 0); /* state = decel */
|
||||
}
|
||||
}
|
||||
DT_UPDINT;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user