Skip to content

Commit

Permalink
SCP: Updated to current.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcornwell committed Oct 19, 2024
1 parent 9f8ee05 commit a11d190
Show file tree
Hide file tree
Showing 26 changed files with 1,552 additions and 1,508 deletions.
575 changes: 291 additions & 284 deletions scp.c

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions scp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
05-Dec-10 MP Added macro invocation of sim_debug
05-Dec-10 MP Added macro invocation of sim_debug
09-Aug-06 JDB Added assign_device and deassign_device
14-Jul-06 RMS Added sim_activate_abs
06-Jan-06 RMS Added fprint_stopped_gen
Expand Down Expand Up @@ -253,7 +253,7 @@ void sim_perror (const char *msg);
t_stat sim_call_argv (int (*main_like)(int argc, char *argv[]), const char *cptr);
t_stat sim_messagef (t_stat stat, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
void sim_data_trace(DEVICE *dptr, UNIT *uptr, const uint8 *data, const char *position, size_t len, const char *txt, uint32 reason);
void sim_debug_bits_hdr (uint32 dbits, DEVICE* dptr, const char *header,
void sim_debug_bits_hdr (uint32 dbits, DEVICE* dptr, const char *header,
BITFIELD* bitdefs, uint32 before, uint32 after, int terminate);
void sim_debug_bits (uint32 dbits, DEVICE* dptr, BITFIELD* bitdefs,
uint32 before, uint32 after, int terminate);
Expand Down Expand Up @@ -357,13 +357,13 @@ extern t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val
int32 sw);

/* The per-simulator init routine is a weak global that defaults to NULL
The other per-simulator pointers can be overrriden by the init routine
The other per-simulator pointers can be overridden by the init routine
extern void (*sim_vm_init) (void);
This routine is no longer invoked this way since it doesn't work reliably
on all simh supported compile environments. A simulator that needs these
initializations can perform them in the CPU device reset routine which will
on all simh supported compile environments. A simulator that needs these
initializations can perform them in the CPU device reset routine which will
always be called before anything else can be processed.
*/
Expand Down
20 changes: 10 additions & 10 deletions scp_help.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
* For these cases, ?#, where # is a 1-based parameter number, can be used
* to selectively include a topic. If the specified parameter is TRUE
* (a string with the value "T", "t" or '1'), the topic will be visible.
* If the parameter is FALSE (NULL, or a string with any other value),
* If the parameter is FALSE (NULL, or a string with any other value),
* the topic will not be visible.
*
* If it can be determined at compile time whether the topic in question
Expand All @@ -95,7 +95,7 @@
* Guidelines:
* Help should be concise and easy to understand.
*
* The main topic should be short - less than a sceenful when presented with the
* The main topic should be short - less than a screenful when presented with the
* subtopic list.
*
* Keep line lengths to 76 columns or less.
Expand All @@ -107,7 +107,7 @@
* Hardware Description - The details of the hardware. Feeds & speeds are OK here.
* Models - If the device was offered in distinct models, a subtopic for each.
* Registers - Register descriptions
*
*
* Configuration - How to configure the device under SimH. SET commands.
* Operating System - If the device needs special configuration for a particular
* OS, a subtopic for each such OS goes here.
Expand All @@ -126,7 +126,7 @@
*
* Related Devices - If devices are configured or used together, list the other devices here.
* E.G. The DEC KMC/DUP are two hardware devices that are closely related;
* The KMC controlls the DUP on behalf of the OS.
* The KMC controls the DUP on behalf of the OS.
*
* This text can be created by any convenient means. It can be mechanically extracted from the device
* source, read from a file, or simply entered as a string in the help routine. To facilitate the latter,
Expand All @@ -151,7 +151,7 @@
* UNIT *uptr, int flag, const char *help, char *cptr, ...)
*
* If you need to pass the variable argument list from another routine, use:
*
*
* t_stat scp_vhelp (FILE *st, DEVICE *dptr,
* UNIT *uptr, int flag, const char *help, char *cptr, va_list ap)
*
Expand All @@ -175,12 +175,12 @@
* to a string.)
*
* Lines beginning with ';' will be ignored.
*
*
* Here is a worked-out example:
*
;****************************************************************************
The Whizbang 100 is a DMA line printer controller used on the Whizbang 1000
and Gurgle 1200 processor familes of the Obsolete Hardware Corporation.
and Gurgle 1200 processor families of the Obsolete Hardware Corporation.
1 Hardware Description
The Whizbang 100 is specified to operate "any printer you and a friend can
lift", and speeds up to 0.5 C.
Expand All @@ -205,7 +205,7 @@
Bit 2 ejects the operator
Bit 3 enables interrupts
3 Print data register
The print data register is thiry-seven bits wide, and accepts data in
The print data register is thirty-seven bits wide, and accepts data in
elephantcode, the precursor to Unicode. Paper advance is accomplished
with the Rocket Return and Page Trampoline characters.
1 Configuration
Expand All @@ -217,7 +217,7 @@
+ SET WHIZBANG CODESET ASCII
+ SET WHIZBANG CODESET ELEPHANTCODE
The VFU (carriage control tape) is specifed with
The VFU (carriage control tape) is specified with
+ SET WHIZBANG TAPE vfufile
2 WOS
Under WOS, the device will only work at LooneyBus slot 9
Expand All @@ -231,7 +231,7 @@
2 Examples
TBS
1 Operation
Specify the host file to receive output using the
Specify the host file to receive output using the
+ATTACH WHIZBANG filespec
command.
1 Monitoring
Expand Down
36 changes: 15 additions & 21 deletions sim_card.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
This is the standard card reader.
This is the standard card punch.
Input formats are accepted in a variaty of formats:
Input formats are accepted in a variety of formats:
Standard ASCII: one record per line.
returns are ignored.
tabs are expanded to modules 8 characters.
Expand All @@ -44,7 +44,7 @@
Bits 5-0 are character.
CBN Format:
Each record 160 charaters.
Each record 160 characters.
First char has bit 7 set. Rest set to 0.
Bit 6 is odd parity.
Bit 5-0 of first character are top 6 bits
Expand All @@ -60,7 +60,7 @@
is not enough octal numbers to span a full card the remainder of the
card will not be punched.
Also ~eor, will generate a 7/8/9 punch card. An ~eof will gernerate a
Also ~eor, will generate a 7/8/9 punch card. An ~eof will generate a
6/7/9 punch card, and a ~eoi will generate a 6/7/8/9 punch.
A single line of ~ will set the EOF flag when that card is read.
Expand Down Expand Up @@ -163,7 +163,7 @@ static const uint16 ascii_to_hol_026[128] = {
/* Set for Burrough codes */
static const uint16 ascii_to_hol_029[128] = {
/* Control */
0xf000,0xf000,0x0881,0xf000,0xf000,0xf000,0xf000,0xf000, /*0-37*/
0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000, /*0-37*/
/*Control*/
0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,0xf000,
/*Control*/
Expand Down Expand Up @@ -252,7 +252,7 @@ static const uint16 ascii_to_dec_029[128] = {

#if SIMH_EVER_USES_THIS
/* This is a static const that isn't referenced in this code.
* Kept for historical refernce.
* Kept for historical reference.
*/
static const uint16 ascii_to_hol_ebcdic[128] = {
/* Control */
Expand Down Expand Up @@ -434,7 +434,7 @@ static struct card_formats fmts[] = {

/* Conversion routines */

/* Convert BCD character into hollerith code */
/* Convert BCD character into Hollerith code */
uint16
sim_bcd_to_hol(uint8 bcd) {
uint16 hol;
Expand Down Expand Up @@ -479,7 +479,7 @@ sim_bcd_to_hol(uint8 bcd) {
return hol;
}

/* Returns the BCD of the hollerith code or 0x7f if error */
/* Returns the BCD of the Hollerith code or 0x7f if error */
uint8
sim_hol_to_bcd(uint16 hol) {
uint8 bcd;
Expand Down Expand Up @@ -529,15 +529,15 @@ sim_hol_to_bcd(uint16 hol) {
return bcd;
}

/* Convert EBCDIC character into hollerith code */
/* Convert EBCDIC character into Hollerith code */
uint16
sim_ebcdic_to_hol(uint8 ebcdic) {
return ebcdic_to_hol[ebcdic];
}



/* Returns the BCD of the hollerith code or 0x7f if error */
/* Returns the BCD of the Hollerith code or 0x7f if error */
uint16
sim_hol_to_ebcdic(uint16 hol) {
return hol_to_ebcdic[hol];
Expand Down Expand Up @@ -614,8 +614,7 @@ sim_read_card(UNIT * uptr, uint16 image[80])
int ok = 1;
for (i = 0; i < 80; i++) {
out[i] = data->hol_to_ascii[(int)(*img)[i]];
/* Handle case where table entry is 0 or invalid */
if (out[i] == 0 || out[i] == 0xff) {
if (out[i] == 0xff) {
ok = 0;
}
}
Expand Down Expand Up @@ -687,7 +686,7 @@ _sim_parse_card(UNIT *uptr, DEVICE *dptr, struct _card_buffer *buf, uint16 (*ima
unsigned int mode;
uint16 temp;
size_t i;
unsigned char c;
char c;
size_t col;

sim_debug(DEBUG_CARD, dptr, "Read card ");
Expand Down Expand Up @@ -818,9 +817,6 @@ _sim_parse_card(UNIT *uptr, DEVICE *dptr, struct _card_buffer *buf, uint16 (*ima
col = 80;
i--;
break;
case 0xac: /* Handle EBCDIC not symbol */
(*image)[col++] = 0x406;
break;
default:
sim_debug(DEBUG_CARD, dptr, "%c", c);
if ((uptr->flags & MODE_LOWER) == 0)
Expand All @@ -837,10 +833,8 @@ _sim_parse_card(UNIT *uptr, DEVICE *dptr, struct _card_buffer *buf, uint16 (*ima
temp = ascii_to_dec_029[(int)c];
break;
}
if (temp & 0xf000) {
if (temp & 0xf000)
(*image)[0] |= CARD_ERR;
sim_debug(DEBUG_CARD, dptr, "<<");
}
(*image)[col++] = temp & 0xfff;
}
}
Expand Down Expand Up @@ -993,7 +987,7 @@ _sim_read_deck(UNIT * uptr, int eof)

buf.len = 0;
buf.size = 0;
buf.buffer[0] = 0; /* Initialize bufer to empty */
buf.buffer[0] = 0; /* Initialize buffer to empty */

/* Slurp up current file */
do {
Expand All @@ -1020,7 +1014,7 @@ _sim_read_deck(UNIT * uptr, int eof)
sim_uname(uptr), uptr->filename, sim_error_text(r), cards);
}
data->hopper_cards++;
/* Move data to start at begining of buffer */
/* Move data to start at beginning of buffer */
/* Data is moved down to simplify the decoding of one card */
l = buf.len - buf.size;
j = buf.size;
Expand Down Expand Up @@ -1065,7 +1059,7 @@ sim_punch_card(UNIT * uptr, uint16 image[80])
/* Convert word record into column image */
/* Check output type, if auto or text, try and convert record to bcd first */
/* If failed and text report error and dump what we have */
/* Else if binary or not convertable, dump as image */
/* Else if binary or not convertible, dump as image */

/* Try to convert to text */
uint8 out[512];
Expand Down
12 changes: 6 additions & 6 deletions sim_card.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
This is the standard card reader.
This is the standard card punch.
Input formats are accepted in a variaty of formats:
Input formats are accepted in a variety of formats:
Standard ASCII: one record per line.
returns are ignored.
tabs are expanded to modules 8 characters.
Expand All @@ -44,7 +44,7 @@
Bits 5-0 are character.
CBN Format:
Each record 160 charaters.
Each record 160 characters.
First char has bit 7 set. Rest set to 0.
Bit 6 is odd parity.
Bit 5-0 of first character are top 6 bits
Expand All @@ -60,14 +60,14 @@
ASCII mode recognizes some additional forms of input which allows the
intermixing of binary cards with text cards.
intermixing of binary cards with text cards.
Lines beginning with ~raw are taken as a number of 4 digit octal values
with represent each column of the card from 12 row down to 9 row. If there
is not enough octal numbers to span a full card the remainder of the
is not enough octal numbers to span a full card the remainder of the
card will not be punched.
Also ~eor, will generate a 7/8/9 punch card. An ~eof will gernerate a
Also ~eor, will generate a 7/8/9 punch card. An ~eof will generate a
6/7/9 punch card, and a ~eoi will generate a 6/7/8/9 punch.
A single line of ~ will set the EOF flag when that card is read.
Expand Down Expand Up @@ -110,7 +110,7 @@ typedef int t_cdstat;
#define CDSE_OK 0 /* Good */
#define CDSE_EOF 1 /* End of File */
#define CDSE_EMPTY 2 /* Input Hopper Empty */
#define CDSE_ERROR 3 /* Error Card Read */
#define CDSE_ERROR 3 /* Error Card Read */

/* Generic routines. */

Expand Down
Loading

0 comments on commit a11d190

Please sign in to comment.