1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 11:46:37 +00:00

Official simh-V3.9-0-rc3 Merge

This commit is contained in:
Mark Pizzolato
2012-04-23 04:02:02 -07:00
parent 15570e5e8d
commit 73bd8c36e7
62 changed files with 5364 additions and 3806 deletions

View File

@@ -1,6 +1,6 @@
/* pdp8_clk.c: PDP-8 real-time clock simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2012, 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"),
@@ -25,6 +25,7 @@
clk real time clock
18-Apr-12 RMS Added clock coscheduling
18-Jun-07 RMS Added UNIT_IDLE flag
01-Mar-03 RMS Aded SET/SHOW CLK FREQ support
04-Oct-02 RMS Added DIB, device number support
@@ -43,6 +44,8 @@ extern int32 int_req, int_enable, dev_done, stop_inst;
int32 clk_tps = 60; /* ticks/second */
int32 tmxr_poll = 16000; /* term mux poll */
extern int32 sim_is_running;
int32 clk (int32 IR, int32 AC);
t_stat clk_svc (UNIT *uptr);
t_stat clk_reset (DEVICE *dptr);
@@ -150,6 +153,16 @@ tmxr_poll = t; /* set mux poll */
return SCPE_OK;
}
/* Clock coscheduling routine */
int32 clk_cosched (int32 wait)
{
int32 t;
t = sim_is_active (&clk_unit);
return (t? t - 1: wait);
}
/* Reset routine */
t_stat clk_reset (DEVICE *dptr)
@@ -159,9 +172,11 @@ int32 t;
dev_done = dev_done & ~INT_CLK; /* clear done, int */
int_req = int_req & ~INT_CLK;
int_enable = int_enable & ~INT_CLK; /* clear enable */
t = sim_rtcn_init (clk_unit.wait, TMR_CLK);
sim_activate_abs (&clk_unit, t); /* activate unit */
tmxr_poll = t;
if (!sim_is_running) { /* RESET (not CAF)? */
t = sim_rtcn_init (clk_unit.wait, TMR_CLK);
sim_activate (&clk_unit, t); /* activate unit */
tmxr_poll = t;
}
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_defs.h: PDP-8 simulator definitions
Copyright (c) 1993-2010, Robert M Supnik
Copyright (c) 1993-2012, 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"),
@@ -23,6 +23,8 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
18-Apr-12 RMS Removed separate timer for additional terminals;
added clock_cosched prototype
22-May-10 RMS Added check for 64b definitions
21-Aug-07 RMS Added FPP8 support
13-Dec-06 RMS Added TA8E support
@@ -78,7 +80,6 @@
/* Timers */
#define TMR_CLK 0 /* timer 0 = clock */
#define TMR_TTX 1 /* timer 1 = TTx */
/* Device information block */
@@ -209,4 +210,6 @@ typedef struct {
t_stat set_dev (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat show_dev (FILE *st, UNIT *uptr, int32 val, void *desc);
int32 clk_cosched (int32 wait);
#endif

View File

@@ -1,6 +1,6 @@
/* pdp8_tt.c: PDP-8 console terminal simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2012, 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"),
@@ -25,6 +25,7 @@
tti,tto KL8E terminal input/output
18-Apr-12 RMS Revised to use clock coscheduling
18-Jun-07 RMS Added UNIT_IDLE flag to console input
18-Oct-06 RMS Synced keyboard to clock
30-Sep-06 RMS Fixed handling of non-printable characters in KSR mode
@@ -44,7 +45,7 @@
#include <ctype.h>
extern int32 int_req, int_enable, dev_done, stop_inst;
extern int32 tmxr_poll;
extern int32 tmxr_poll, sim_is_running;
int32 tti (int32 IR, int32 AC);
int32 tto (int32 IR, int32 AC);
@@ -175,7 +176,8 @@ t_stat tti_svc (UNIT *uptr)
{
int32 c;
sim_activate (uptr, KBD_WAIT (uptr->wait, tmxr_poll)); /* continue poll */
sim_activate (uptr, KBD_WAIT (uptr->wait, clk_cosched (tmxr_poll)));
/* continue poll */
if ((c = sim_poll_kbd ()) < SCPE_KFLAG) /* no char or error? */
return c;
if (c & SCPE_BREAK) /* break? */
@@ -195,7 +197,8 @@ tti_unit.buf = 0;
dev_done = dev_done & ~INT_TTI; /* clear done, int */
int_req = int_req & ~INT_TTI;
int_enable = int_enable | INT_TTI; /* set enable */
sim_activate_abs (&tti_unit, KBD_WAIT (tti_unit.wait, tmxr_poll));
if (!sim_is_running) /* RESET (not CAF)? */
sim_activate (&tti_unit, KBD_WAIT (tti_unit.wait, tmxr_poll));
return SCPE_OK;
}

View File

@@ -1,6 +1,6 @@
/* pdp8_ttx.c: PDP-8 additional terminals simulator
Copyright (c) 1993-2011, Robert M Supnik
Copyright (c) 1993-2012, 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"),
@@ -25,6 +25,7 @@
ttix,ttox PT08/KL8JA terminal input/output
18-Apr-12 RMS Revised to use clock coscheduling
19-Nov-08 RMS Revised for common TMXR show routines
07-Jun-06 RMS Added UNIT_IDLE flag
06-Jul-06 RMS Fixed bug in DETACH routine
@@ -60,6 +61,7 @@
#define TTX_GETLN(x) (((x) >> 4) & TTX_MASK)
extern int32 int_req, int_enable, dev_done, stop_inst;
extern int32 tmxr_poll, sim_is_running;
uint8 ttix_buf[TTX_LINES] = { 0 }; /* input buffers */
uint8 ttox_buf[TTX_LINES] = { 0 }; /* output buffers */
@@ -224,8 +226,7 @@ int32 ln, c, temp;
if ((uptr->flags & UNIT_ATT) == 0) /* attached? */
return SCPE_OK;
temp = sim_rtcn_calb (ttx_tps, TMR_TTX); /* calibrate */
sim_activate (uptr, temp); /* continue poll */
sim_activate (uptr, clk_cosched (tmxr_poll)); /* continue poll */
ln = tmxr_poll_conn (&ttx_desc); /* look for connect */
if (ln >= 0) /* got one? rcv enb*/
ttx_ldsc[ln].rcve = 1;
@@ -249,15 +250,11 @@ return SCPE_OK;
t_stat ttix_reset (DEVICE *dptr)
{
int32 t, ln, itto;
int32 ln, itto;
ttx_enbdis (dptr->flags & DEV_DIS); /* sync enables */
if (ttix_unit.flags & UNIT_ATT) { /* if attached, */
if (!sim_is_active (&ttix_unit)) {
t = sim_rtcn_init (ttix_unit.wait, TMR_TTX);
sim_activate (&ttix_unit, t); /* activate */
}
}
if (ttix_unit.flags & UNIT_ATT) /* if attached, */
sim_activate (&ttix_unit, tmxr_poll); /* activate */
else sim_cancel (&ttix_unit); /* else stop */
for (ln = 0; ln < TTX_LINES; ln++) { /* for all lines */
ttix_buf[ln] = 0; /* clear buf, */
@@ -358,14 +355,12 @@ return SCPE_OK;
t_stat ttx_attach (UNIT *uptr, char *cptr)
{
int32 t;
t_stat r;
r = tmxr_attach (&ttx_desc, uptr, cptr); /* attach */
if (r != SCPE_OK) /* error */
return r;
t = sim_rtcn_init (ttix_unit.wait, TMR_TTX); /* init calib */
sim_activate (uptr, t); /* start poll */
sim_activate (uptr, tmxr_poll); /* start poll */
return SCPE_OK;
}