ALTAIR, Interdata, LGP, NOVA: Addition of sim_printf in various places from Bob Supnik

This commit is contained in:
Mark Pizzolato 2015-04-03 18:33:31 -07:00
parent 7b3fdf5718
commit c221e1ff97
16 changed files with 101 additions and 98 deletions

View file

@ -25,7 +25,7 @@
cpu 8080 CPU cpu 8080 CPU
02-Feb-15 RSB Fixed initialization of "uninstalled" memory 02-Feb-15 RSB Fixed initialization of "uninstalled" memory
19-Mar-12 RMS Fixed data type for breakpoint variables 19-Mar-12 RMS Fixed data type for breakpoint variables
08-Oct-02 RMS Tied off spurious compiler warnings 08-Oct-02 RMS Tied off spurious compiler warnings

View file

@ -24,19 +24,19 @@
in this Software without prior written authorization from Charles E. Owen. in this Software without prior written authorization from Charles E. Owen.
*/ */
#include "sim_defs.h" /* simulator defns */ #include "sim_defs.h" /* simulator defns */
/* Memory */ /* Memory */
#define MAXMEMSIZE 65536 /* max memory size */ #define MAXMEMSIZE 65536 /* max memory size */
#define MEMSIZE (cpu_unit.capac) /* actual memory size */ #define MEMSIZE (cpu_unit.capac) /* actual memory size */
#define ADDRMASK (MAXMEMSIZE - 1) /* address mask */ #define ADDRMASK (MAXMEMSIZE - 1) /* address mask */
#define MEM_ADDR_OK(x) (((uint32) (x)) < MEMSIZE) #define MEM_ADDR_OK(x) (((uint32) (x)) < MEMSIZE)
/* Simulator stop codes */ /* Simulator stop codes */
#define STOP_RSRV 1 /* must be 1 */ #define STOP_RSRV 1 /* must be 1 */
#define STOP_HALT 2 /* HALT */ #define STOP_HALT 2 /* HALT */
#define STOP_IBKPT 3 /* breakpoint */ #define STOP_IBKPT 3 /* breakpoint */
#define STOP_OPCODE 4 #define STOP_OPCODE 4

View file

@ -164,7 +164,7 @@ while ((i = getc (fileref)) != EOF) {
addr++; addr++;
cnt++; cnt++;
} /* end while */ } /* end while */
printf ("%d Bytes loaded.\n", cnt); sim_printf ("%d Bytes loaded.\n", cnt);
return (SCPE_OK); return (SCPE_OK);
} }

View file

@ -1948,7 +1948,7 @@ if (!(val & UNIT_816E) && (MEMSIZE > MAXMEMSIZE16)) {
MEMSIZE = MAXMEMSIZE16; MEMSIZE = MAXMEMSIZE16;
for (i = MEMSIZE; i < MAXMEMSIZE16E; i = i + 2) for (i = MEMSIZE; i < MAXMEMSIZE16E; i = i + 2)
M[i >> 1] = 0; M[i >> 1] = 0;
printf ("Reducing memory to 64KB\n"); sim_printf ("Reducing memory to 64KB\n");
} }
return SCPE_OK; return SCPE_OK;
} }

View file

@ -496,9 +496,9 @@ uint32 dtype = GET_DTYPE (uptr->flags); /* get drive type */
if (((uptr->flags & UNIT_ATT) == 0) || /* not attached? */ if (((uptr->flags & UNIT_ATT) == 0) || /* not attached? */
((uptr->flags & UNIT_WPRT) && (dp_cmd == CMC_WR))) { ((uptr->flags & UNIT_WPRT) && (dp_cmd == CMC_WR))) {
dp_done (STC_DTE); /* error, done */ dp_done (STC_DTE); /* error, done */
return TRUE; return TRUE;
} }
hd = GET_SRF (dp_hdsc); /* get head */ hd = GET_SRF (dp_hdsc); /* get head */
sc = GET_SEC (dp_hdsc); /* get sector */ sc = GET_SEC (dp_hdsc); /* get sector */
if (dp_cyl != (uint32) uptr->CYL) { /* wrong cylinder? */ if (dp_cyl != (uint32) uptr->CYL) { /* wrong cylinder? */

View file

@ -578,7 +578,7 @@ switch (uptr->FNC & CMC_MASK) { /* case on func */
if ((r = idc_rds (uptr))) /* read sec, err? */ if ((r = idc_rds (uptr))) /* read sec, err? */
return r; return r;
idc_1st = 0; idc_1st = 0;
sch_wrmem (idc_dib.sch, idcxb, IDC_NUMBY); /* write mem */ sch_wrmem (idc_dib.sch, idcxb, IDC_NUMBY); /* write mem */
if (sch_actv (idc_dib.sch, idc_dib.dno)) { /* more to do? */ if (sch_actv (idc_dib.sch, idc_dib.dno)) { /* more to do? */
sim_activate (uptr, idc_rtime); /* reschedule */ sim_activate (uptr, idc_rtime); /* reschedule */
return SCPE_OK; return SCPE_OK;

View file

@ -204,7 +204,7 @@ if ((temp = getc (uptr->fileref)) == EOF) { /* error? */
if (feof (uptr->fileref)) { /* eof? */ if (feof (uptr->fileref)) { /* eof? */
pt_sta = pt_sta | STA_DU; /* set DU */ pt_sta = pt_sta | STA_DU; /* set DU */
if (ptr_stopioe) if (ptr_stopioe)
printf ("PTR end of file\n"); sim_printf ("PTR end of file\n");
else return SCPE_OK; else return SCPE_OK;
} }
else perror ("PTR I/O error"); else perror ("PTR I/O error");

View file

@ -501,7 +501,7 @@ do {
if ((ch = getc (uptr->fileref)) == EOF) { /* read char */ if ((ch = getc (uptr->fileref)) == EOF) { /* read char */
if (feof (uptr->fileref)) { /* err or eof? */ if (feof (uptr->fileref)) { /* err or eof? */
if (stop) if (stop)
printf ("Reader end of file\n"); sim_printf ("Reader end of file\n");
else return SCPE_OK; else return SCPE_OK;
} }
else perror ("Reader I/O error"); else perror ("Reader I/O error");
@ -516,7 +516,7 @@ do {
if ((d1 == EOF) || (d2 == EOF)) { /* error? */ if ((d1 == EOF) || (d2 == EOF)) { /* error? */
if (feof (uptr->fileref)) { /* eof? */ if (feof (uptr->fileref)) { /* eof? */
if (stop) if (stop)
printf ("Reader end of file\n"); sim_printf ("Reader end of file\n");
else return SCPE_OK; else return SCPE_OK;
} }
else perror ("Reader I/O error"); else perror ("Reader I/O error");

View file

@ -1,6 +1,6 @@
/* nova_cpu.c: NOVA CPU simulator /* nova_cpu.c: NOVA CPU simulator
Copyright (c) 1993-2008, Robert M. Supnik Copyright (c) 1993-2013, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
@ -25,6 +25,7 @@
cpu Nova central processor cpu Nova central processor
17-Mar-13 RMS Added clarifying brances to IND_STEP macro (Dave Bryan)
04-Jul-07 BKR DEV_SET/CLR macros now used, 04-Jul-07 BKR DEV_SET/CLR macros now used,
support for non-existant devices added support for non-existant devices added
CPU bootstrap code warning: high-speed devices may not boot properly, CPU bootstrap code warning: high-speed devices may not boot properly,
@ -387,7 +388,6 @@ MTAB cpu_mod[] = {
{ UNIT_MSIZE, (24 * 1024), NULL, "24K", &cpu_set_size }, { UNIT_MSIZE, (24 * 1024), NULL, "24K", &cpu_set_size },
{ UNIT_MSIZE, (28 * 1024), NULL, "28K", &cpu_set_size }, { UNIT_MSIZE, (28 * 1024), NULL, "28K", &cpu_set_size },
{ UNIT_MSIZE, (32 * 1024), NULL, "32K", &cpu_set_size }, { UNIT_MSIZE, (32 * 1024), NULL, "32K", &cpu_set_size },
{ UNIT_MSIZE, (36 * 1024), NULL, "36K", &cpu_set_size }, { UNIT_MSIZE, (36 * 1024), NULL, "36K", &cpu_set_size },
{ UNIT_MSIZE, (40 * 1024), NULL, "40K", &cpu_set_size }, { UNIT_MSIZE, (40 * 1024), NULL, "40K", &cpu_set_size },
{ UNIT_MSIZE, (44 * 1024), NULL, "44K", &cpu_set_size }, { UNIT_MSIZE, (44 * 1024), NULL, "44K", &cpu_set_size },
@ -1206,7 +1206,7 @@ return SCPE_OK;
#define BOOT_LEN (sizeof(boot_rom) / sizeof(int32)) #define BOOT_LEN (sizeof(boot_rom) / sizeof(int32))
static const int32 boot_rom[] = { static const int32 boot_rom[] = {
0062677, /* IORST ;reset all I/O */ 0062677, /* IORST ;reset all I/O */
0060477, /* READS 0 ;read SR into AC0 */ 0060477, /* READS 0 ;read SR into AC0 */
0024026, /* LDA 1,C77 ;get dev mask */ 0024026, /* LDA 1,C77 ;get dev mask */
0107400, /* AND 0,1 ;isolate dev code */ 0107400, /* AND 0,1 ;isolate dev code */

View file

@ -344,7 +344,7 @@ int32 dkp_swait = 100; /* seek latency */
int32 dkp_rwait = 100; /* rotate latency */ int32 dkp_rwait = 100; /* rotate latency */
int32 dkp_diagmode = 0; /* diagnostic mode */ int32 dkp_diagmode = 0; /* diagnostic mode */
int32 dkp_trace = 0 ; int32 dkp_trace = 0 ;
DEVICE dkp_dev; DEVICE dkp_dev;
int32 dkp (int32 pulse, int32 code, int32 AC); int32 dkp (int32 pulse, int32 code, int32 AC);
@ -545,8 +545,8 @@ switch (code) { /* decode IR<5:7> */
} }
DEV_CLR_DONE( INT_DKP ); /* assume done flags 0 */ DEV_CLR_DONE( INT_DKP ); /* assume done flags 0 */
if ( dkp_sta & STA_DFLGS ) /* done flags = 0? */ if ( dkp_sta & STA_DFLGS ) /* done flags = 0? */
DEV_SET_DONE( INT_DKP ); /* nope - set done */ DEV_SET_DONE( INT_DKP ) ; /* nope - set done */
DEV_UPDATE_INTR; /* update intr */ DEV_UPDATE_INTR ; /* update intr */
break; break;
case ioDIB: /* DIB */ case ioDIB: /* DIB */
@ -575,12 +575,12 @@ switch (code) { /* decode IR<5:7> */
(dtype == TYPE_6097) || /* for 6099 and 6103 */ (dtype == TYPE_6097) || /* for 6099 and 6103 */
(dtype == TYPE_6103)) && /* if data<0> set, */ (dtype == TYPE_6103)) && /* if data<0> set, */
(AC & 010000) ) (AC & 010000) )
dkp_diagmode = 1; /* set diagnostic mode */ dkp_diagmode = 1; /* set diagnostic mode */
break; break;
} /* end switch code */ } /* end switch code */
u = GET_UNIT(dkp_ussc); /* update current unit */ u = GET_UNIT(dkp_ussc); /* update current unit */
uptr = dkp_dev.units + u ; /* select unit */ uptr = dkp_dev.units + u ; /* select unit */
dtype = GET_DTYPE (uptr->flags); /* get drive type */ dtype = GET_DTYPE (uptr->flags); /* get drive type */
if ( DKP_TRACE(0) ) if ( DKP_TRACE(0) )
@ -606,7 +606,7 @@ switch (pulse) { /* decode IR<8:9> */
dkp_ussc = 010003; dkp_ussc = 010003;
} }
else { /* normal mode ... */ else { /* normal mode ... */
if (dkp_go (pulse)) /* do command */ if (dkp_go (pulse)) /* do command */
break ; /* break if no error */ break ; /* break if no error */
} }
DEV_CLR_BUSY( INT_DKP ) ; /* clear busy */ DEV_CLR_BUSY( INT_DKP ) ; /* clear busy */
@ -645,8 +645,8 @@ switch (pulse) { /* decode IR<8:9> */
break; /* no error - do not set done and status */ break; /* no error - do not set done and status */
} }
DEV_SET_DONE( INT_DKP ) ; /* set done */ DEV_SET_DONE( INT_DKP ) ; /* set done */
DEV_UPDATE_INTR ; /* update ints */ DEV_UPDATE_INTR ; /* update ints */
dkp_sta = dkp_sta | (STA_SKDN0 >> u); /* set controller seek done */ dkp_sta = dkp_sta | (STA_SKDN0 >> u); /* set controller seek done */
break; break;
} /* end case pulse */ } /* end case pulse */
@ -661,8 +661,8 @@ return rval;
t_stat dkp_go ( int32 pulse ) t_stat dkp_go ( int32 pulse )
{ {
UNIT * uptr; UNIT *uptr;
int32 oldCyl, u, dtype; int32 oldCyl, u, dtype;
dkp_sta = dkp_sta & ~STA_EFLGS; /* clear errors */ dkp_sta = dkp_sta & ~STA_EFLGS; /* clear errors */
u = GET_UNIT (dkp_ussc); /* get unit number */ u = GET_UNIT (dkp_ussc); /* get unit number */
@ -687,10 +687,10 @@ uptr->CYL = GET_CYL (dkp_fccy, dtype) ;
if ( DKP_TRACE(1) ) if ( DKP_TRACE(1) )
{ {
int32 xSect ; int32 xSect ;
int32 xSurf ; int32 xSurf ;
int32 xCyl ; int32 xCyl ;
int32 xCnt ; int32 xCnt ;
xSect = GET_SECT(dkp_ussc, dtype) ; xSect = GET_SECT(dkp_ussc, dtype) ;
xSurf = GET_SURF(dkp_ussc, dtype) ; xSurf = GET_SURF(dkp_ussc, dtype) ;
@ -698,25 +698,25 @@ if ( DKP_TRACE(1) )
xCnt = 16 - (GET_COUNT(dkp_ussc)) ; xCnt = 16 - (GET_COUNT(dkp_ussc)) ;
fprintf( DKP_TRACE_FP, fprintf( DKP_TRACE_FP,
" [%s:%c %-5s: %3d / %2d / %2d %2d %06o ] \r\n", " [%s:%c %-5s: %3d / %2d / %2d %2d %06o ] \r\n",
"DKP", "DKP",
(char) (u + '0'), (char) (u + '0'),
((uptr->FUNC == FCCY_READ) ? ((uptr->FUNC == FCCY_READ) ?
"read" "read"
: ((uptr->FUNC == FCCY_WRITE) ? : ((uptr->FUNC == FCCY_WRITE) ?
"write" "write"
: ((uptr->FUNC == FCCY_SEEK) ? : ((uptr->FUNC == FCCY_SEEK) ?
"seek" "seek"
: "<?>" : "<?>"
)
) )
), )
(unsigned) xCyl, ),
(unsigned) xSurf, (unsigned) xCyl,
(unsigned) xSect, (unsigned) xSurf,
(unsigned) (16 - xCnt), (unsigned) xSect,
(unsigned) (dkp_ma & 0xFFFF) /* show all 16-bits in case DCH B */ (unsigned) (16 - xCnt),
) ; (unsigned) (dkp_ma & 0xFFFF) /* show all 16-bits in case DCH B */
) ;
} }
@ -727,7 +727,7 @@ switch (uptr->FUNC) { /* decode command */
if (((uptr->flags & UNIT_ATT) == 0) || /* not attached? */ if (((uptr->flags & UNIT_ATT) == 0) || /* not attached? */
((uptr->flags & UNIT_WPRT) && (uptr->FUNC == FCCY_WRITE))) ((uptr->flags & UNIT_WPRT) && (uptr->FUNC == FCCY_WRITE)))
{ {
dkp_sta = dkp_sta | STA_DONE | STA_ERR; /* error */ dkp_sta = dkp_sta | STA_DONE | STA_ERR; /* error */
} }
else if ( uptr->CYL >= drv_tab[dtype].cyl ) /* bad cylinder */ else if ( uptr->CYL >= drv_tab[dtype].cyl ) /* bad cylinder */
{ {
@ -736,7 +736,7 @@ switch (uptr->FUNC) { /* decode command */
else if ( GET_SURF(dkp_ussc, dtype) >= drv_tab[dtype].surf ) /* bad surface */ else if ( GET_SURF(dkp_ussc, dtype) >= drv_tab[dtype].surf ) /* bad surface */
{ {
dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_UNS; /* older drives may not even do this... */ dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_UNS; /* older drives may not even do this... */
/* dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_XCY ; /- newer disks give this error */ /* dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_XCY ; /- newer disks give this error */
} }
else if ( GET_SECT(dkp_ussc, dtype) >= drv_tab[dtype].sect ) /* or bad sector? */ else if ( GET_SECT(dkp_ussc, dtype) >= drv_tab[dtype].sect ) /* or bad sector? */
{ {
@ -811,7 +811,7 @@ u = uptr - dkp_dev.units; /* get unit number */
if (uptr->FUNC == FCCY_SEEK) { /* seek? */ if (uptr->FUNC == FCCY_SEEK) { /* seek? */
if ( ! (uptr->flags & UNIT_ATT) ) /* not attached? */ if ( ! (uptr->flags & UNIT_ATT) ) /* not attached? */
{ {
dkp_sta = dkp_sta | STA_DONE | STA_ERR; /* error (changed during queue time?) */ dkp_sta = dkp_sta | STA_DONE | STA_ERR; /* error (changed during queue time?) */
} }
else if ( uptr->CYL >= drv_tab[dtype].cyl ) /* bad cylinder? */ else if ( uptr->CYL >= drv_tab[dtype].cyl ) /* bad cylinder? */
{ {
@ -856,7 +856,7 @@ else if ( GET_SURF(dkp_ussc, dtype) >= drv_tab[dtype].surf ) /* bad surface */
} }
else if ( GET_SECT(dkp_ussc, dtype) >= drv_tab[dtype].sect ) /* or bad sector? */ else if ( GET_SECT(dkp_ussc, dtype) >= drv_tab[dtype].sect ) /* or bad sector? */
{ {
/* dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_UNS; /- older DG drives do not even give error(!), but we do */ /* dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_UNS; /- older DG drives do not even give error(!), but we do */
dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_XCY ; /* newer disks give this error */ dkp_sta = dkp_sta | STA_DONE | STA_ERR | STA_XCY ; /* newer disks give this error */
} }
else { else {
@ -937,8 +937,8 @@ do {
} }
newsect = GET_SECT (dkp_ussc, dtype) + 1 ; /* update next sector */ newsect = GET_SECT (dkp_ussc, dtype) + 1 ; /* update next sector */
newsurf = GET_SURF (dkp_ussc, dtype) ; /* and next head */ newsurf = GET_SURF (dkp_ussc, dtype) ; /* and next head */
/* (count set below) */ /* (count set below) */
DKP_UPDATE_USSC( type, 1, newsurf, newsect ) DKP_UPDATE_USSC( type, 1, newsurf, newsect )
} /* end read/write loop */ } /* end read/write loop */
@ -973,9 +973,9 @@ t_stat dkp_reset (DEVICE *dptr)
int32 u; int32 u;
UNIT *uptr; UNIT *uptr;
DEV_CLR_BUSY( INT_DKP ) ; /* clear busy */ DEV_CLR_BUSY( INT_DKP ) ; /* clear busy */
DEV_CLR_DONE( INT_DKP ) ; /* clear done */ DEV_CLR_DONE( INT_DKP ) ; /* clear done */
DEV_UPDATE_INTR ; /* update ints */ DEV_UPDATE_INTR ; /* update ints */
dkp_fccy = dkp_ussc = dkp_ma = dkp_sta = 0; /* clear registers */ dkp_fccy = dkp_ussc = dkp_ma = dkp_sta = 0; /* clear registers */
dkp_diagmode = 0; /* clear diagnostic mode */ dkp_diagmode = 0; /* clear diagnostic mode */
dkp_map = 0; dkp_map = 0;

View file

@ -149,12 +149,12 @@
#define STA_MON (STA_REW | STA_BOT | STA_WLK | STA_RDY | \ #define STA_MON (STA_REW | STA_BOT | STA_WLK | STA_RDY | \
STA_PEM) /* set status chg */ STA_PEM) /* set status chg */
extern uint16 M[]; extern uint16 M[];
extern UNIT cpu_unit; extern UNIT cpu_unit;
extern int32 int_req, dev_busy, dev_done, dev_disable; extern int32 int_req, dev_busy, dev_done, dev_disable;
extern int32 SR, AMASK; extern int32 SR, AMASK;
extern t_stat cpu_boot(int32 unitno, DEVICE * dptr ) ; extern t_stat cpu_boot(int32 unitno, DEVICE * dptr ) ;
int32 mta_ma = 0; /* memory address */ int32 mta_ma = 0; /* memory address */
@ -496,7 +496,7 @@ if (change) {
/* if (mta_ep) { *//* if polling */ /* if (mta_ep) { *//* if polling */
/* u = uptr - mta_dev.units; *//* unit num */ /* u = uptr - mta_dev.units; *//* unit num */
/* mta_sta = (mta_sta & ~STA_UNIT) | (u << STA_V_UNIT); */ /* mta_sta = (mta_sta & ~STA_UNIT) | (u << STA_V_UNIT); */
/* set polling interupt... */ /* set polling interupt... */
/* } */ /* } */
mta_sta = mta_sta | STA_CHG; /* flag change */ mta_sta = mta_sta | STA_CHG; /* flag change */
} }
@ -642,4 +642,4 @@ t_stat mta_boot (int32 unitno, DEVICE *dptr)
cpu_boot( unitno, dptr ) ; cpu_boot( unitno, dptr ) ;
SR = 0100000 + DEV_MTA ; SR = 0100000 + DEV_MTA ;
return ( SCPE_OK ); return ( SCPE_OK );
} /* end of 'mta_boot' */ } /* end of 'mta_boot' */

View file

@ -54,7 +54,7 @@ t_stat plt_svc (UNIT *uptr);
t_stat plt_reset (DEVICE *dptr); t_stat plt_reset (DEVICE *dptr);
/* 7 or 8 bit data mask support for either device */ /* 7 or 8 bit data mask support for either device */
#define UNIT_V_8B (UNIT_V_UF + 0) /* 8b output */ #define UNIT_V_8B (UNIT_V_UF + 0) /* 8b output */
#define UNIT_8B (1 << UNIT_V_8B) #define UNIT_8B (1 << UNIT_V_8B)

View file

@ -1,6 +1,6 @@
/* nova_pt.c: NOVA paper tape read/punch simulator /* nova_pt.c: NOVA paper tape read/punch simulator
Copyright (c) 1993-2008, Robert M. Supnik Copyright (c) 1993-2015, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
@ -26,6 +26,7 @@
ptr paper tape reader ptr paper tape reader
ptp paper tape punch ptp paper tape punch
28-Mar-15 RMS Revised to use sim_printf
04-Jul-07 BKR added PTR and PTP device DISABLE capability, 04-Jul-07 BKR added PTR and PTP device DISABLE capability,
added 7B/8B support PTR and PTP (default is 8B), added 7B/8B support PTR and PTP (default is 8B),
DEV_SET/CLR macros now used, DEV_SET/CLR macros now used,
@ -45,10 +46,10 @@ Notes:
#include "nova_defs.h" #include "nova_defs.h"
extern int32 int_req, dev_busy, dev_done, dev_disable ; extern int32 int_req, dev_busy, dev_done, dev_disable ;
extern int32 SR ; extern int32 SR ;
extern t_stat cpu_boot(int32 unitno, DEVICE * dptr ) ; extern t_stat cpu_boot(int32 unitno, DEVICE * dptr ) ;
int32 ptr_stopioe = 0, ptp_stopioe = 0; /* stop on error */ int32 ptr_stopioe = 0, ptp_stopioe = 0; /* stop on error */
@ -62,7 +63,7 @@ t_stat ptp_reset (DEVICE *dptr);
t_stat ptr_boot (int32 unitno, DEVICE *dptr); t_stat ptr_boot (int32 unitno, DEVICE *dptr);
/* 7 or 8 bit data mask support for either device */ /* 7 or 8 bit data mask support for either device */
#define UNIT_V_8B (UNIT_V_UF + 0) /* 8b output */ #define UNIT_V_8B (UNIT_V_UF + 0) /* 8b output */
#define UNIT_8B (1 << UNIT_V_8B) #define UNIT_8B (1 << UNIT_V_8B)
@ -193,7 +194,7 @@ if ((ptr_unit.flags & UNIT_ATT) == 0) /* attached? */
if ((temp = getc (ptr_unit.fileref)) == EOF) { /* end of file? */ if ((temp = getc (ptr_unit.fileref)) == EOF) { /* end of file? */
if (feof (ptr_unit.fileref)) { if (feof (ptr_unit.fileref)) {
if (ptr_stopioe) if (ptr_stopioe)
printf ("PTR end of file\n"); sim_printf ("PTR end of file\n");
else return SCPE_OK; else return SCPE_OK;
} }
else perror ("PTR I/O error"); else perror ("PTR I/O error");

View file

@ -1,6 +1,6 @@
/* nova_qty.c: NOVA multiplexor (QTY/ALM) simulator /* nova_qty.c: NOVA multiplexor (QTY/ALM) simulator
Copyright (c) 2000-2008, Robert M. Supnik Copyright (c) 2000-2015, Robert M. Supnik
Written by Bruce Ray and used with his gracious permission. Written by Bruce Ray and used with his gracious permission.
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
@ -26,7 +26,9 @@
qty multiplexor: QTY = 4060, ALM = 42xx qty multiplexor: QTY = 4060, ALM = 42xx
04-Jul-07 BKR fixed QTY output line number calculation (affected higher line numbers), 28-Mar-15 RMS Revised to use sim_printf
14-Mar-12 RMS Fixed dangling else clauses
04-Jul-07 BKR Fixed QTY output line number calculation (affected higher line numbers),
25-Mar-04 RMS Updated for V3.2 25-Mar-04 RMS Updated for V3.2
12-Jan-04 BKR Initial release 12-Jan-04 BKR Initial release
includes both original DG "quad" multiplexor (QTY) includes both original DG "quad" multiplexor (QTY)
@ -626,7 +628,7 @@ t_stat qty_common_svc( DIB * dibp, UNIT * unitp )
sim_activate( unitp, tmxr_poll ) ; /* restart the bubble machine */ sim_activate( unitp, tmxr_poll ) ; /* restart the bubble machine */
return ( SCPE_OK ) ; return ( SCPE_OK ) ;
} /* end of 'qty_common_svc' */ } /* end of 'qty_common_svc' */
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/
@ -636,7 +638,7 @@ t_stat qty_common_svc( DIB * dibp, UNIT * unitp )
t_stat qty_svc( UNIT * uptr ) t_stat qty_svc( UNIT * uptr )
{ {
return ( qty_common_svc(&qty_dib,uptr) ) ; return ( qty_common_svc(&qty_dib,uptr) ) ;
} /* end of 'qty_svc' */ } /* end of 'qty_svc' */
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/
@ -996,13 +998,13 @@ int32 alm( int32 pulse, int32 code, int32 AC )
/* get modem section status */ /* get modem section status */
if ( qty_ldsc[ alm_line ].xmte ) if ( qty_ldsc[ alm_line ].xmte )
{ {
iodata = 0035 ; /* set CD, CTS, DSR, MDM flags */ iodata = 0035 ; /* set CD, CTS, DSR, MDM flags */
} }
} }
else else
{ {
/* get receiver section status */ /* get receiver section status */
iodata = 0 ; /* receiver error status - no errors by default */ iodata = 0 ; /* receiver error status - no errors by default */
} }
} }
break ; break ;

View file

@ -176,11 +176,11 @@ internal state machine:
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag) t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag)
{ {
int32 data, csum, count, state, i; int32 data, csum, count, state, i;
int32 origin; int32 origin;
int pos ; int pos ;
int block_start ; int block_start ;
int done ; int done ;
if ((*cptr != 0) || (flag != 0)) if ((*cptr != 0) || (flag != 0))
return ( SCPE_ARG ) ; return ( SCPE_ARG ) ;
@ -223,11 +223,11 @@ for ( pos = 0 ; (! done) && ((i=getc(fileref)) != EOF) ; ++pos )
/* do any auto-start check or inhibit check */ /* do any auto-start check or inhibit check */
saved_PC = (origin & 077777) ; /* 0B0 = auto-start program */ saved_PC = (origin & 077777) ; /* 0B0 = auto-start program */
/* 1B0 = do not auto start */ /* 1B0 = do not auto start */
state = 0 ; /* indicate okay state */ state = 0 ; /* indicate okay state */
done = 1 ; /* we're done! */ done = 1 ; /* we're done! */
if ( ! (origin & 0x8000) ) if ( ! (origin & 0x8000) )
{ {
printf( "auto start @ %05o \n", (origin & 0x7FFF) ) ; sim_printf( "auto start @ %05o \n", (origin & 0x7FFF) ) ;
} }
break ; break ;
} }
@ -275,8 +275,8 @@ for ( pos = 0 ; (! done) && ((i=getc(fileref)) != EOF) ; ++pos )
if (count == 0) { if (count == 0) {
if ( csum ) if ( csum )
{ {
printf( "checksum error: block start at %d [0x%x] \n", block_start, block_start ) ; sim_printf( "checksum error: block start at %d [0x%x] \n", block_start, block_start ) ;
printf( "calculated: 0%o [0x%4x]\n", csum, csum ) ; sim_printf( "calculated: 0%o [0x%4x]\n", csum, csum ) ;
if ( ! (sim_switches & SWMASK('I')) ) if ( ! (sim_switches & SWMASK('I')) )
return SCPE_CSUM; return SCPE_CSUM;
} }

View file

@ -1,6 +1,6 @@
/* nova_tt.c: NOVA console terminal simulator /* nova_tt.c: NOVA console terminal simulator
Copyright (c) 1993-2008, Robert M. Supnik Copyright (c) 1993-2015, Robert M. Supnik
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
@ -26,6 +26,7 @@
tti terminal input tti terminal input
tto terminal output tto terminal output
31-Mar-15 RMS Backported parity capability from GitHub master
04-Jul-07 BKR fixed Dasher CR/LF swap function in 'tti_svc()', 04-Jul-07 BKR fixed Dasher CR/LF swap function in 'tti_svc()',
DEV_SET/CLR macros now used, DEV_SET/CLR macros now used,
TTO device may now be DISABLED TTO device may now be DISABLED
@ -40,7 +41,6 @@
31-May-01 RMS Added multiconsole support 31-May-01 RMS Added multiconsole support
Notes: Notes:
- TTO output is always masked to 7 bits in this rev
- TTO "Dasher" attribute sends '\b' to console instead of '\031' - TTO "Dasher" attribute sends '\b' to console instead of '\031'
- TTO may be disabled - TTO may be disabled
- TTI "Dasher" attribute swaps <CR> and <LF> - TTI "Dasher" attribute swaps <CR> and <LF>
@ -90,10 +90,10 @@ REG tti_reg[] = {
MTAB ttx_mod[] = { MTAB ttx_mod[] = {
{ UNIT_DASHER, 0, "ANSI", "ANSI", &ttx_setmod }, { UNIT_DASHER, 0, "ANSI", "ANSI", &ttx_setmod },
{ UNIT_DASHER, UNIT_DASHER, "Dasher", "DASHER", &ttx_setmod }, { UNIT_DASHER, UNIT_DASHER, "Dasher", "DASHER", &ttx_setmod },
{ TT_PAR, TT_PAR_EVEN, "Even Parity", "EVEN", &ttx_setpar }, { TT_PAR, TT_PAR_EVEN, "even parity", "EVEN", &ttx_setpar },
{ TT_PAR, TT_PAR_ODD, "Odd Parity", "ODD", &ttx_setpar }, { TT_PAR, TT_PAR_ODD, "odd parity", "ODD", &ttx_setpar },
{ TT_PAR, TT_PAR_MARK, "Mark Parity", "MARK", &ttx_setpar }, { TT_PAR, TT_PAR_MARK, "mark parity", "MARK", &ttx_setpar },
{ TT_PAR, TT_PAR_SPACE, "No Parity", "NONE", &ttx_setpar }, { TT_PAR, TT_PAR_SPACE, "no parity", "NONE", &ttx_setpar },
{ 0 } { 0 }
} ; } ;