Skip to content

Commit

Permalink
SCP: Migrate all stdio writes to pass through SCP provided Fprintf()
Browse files Browse the repository at this point in the history
  • Loading branch information
markpizz committed Jan 15, 2017
1 parent 861d9c8 commit d8dbc7e
Show file tree
Hide file tree
Showing 31 changed files with 6 additions and 146 deletions.
5 changes: 0 additions & 5 deletions ALTAIR/altair_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ return (SCPE_OK);
status = error code
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
5 changes: 0 additions & 5 deletions AltairZ80/altairz80_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,6 @@ static int32 DAsm(char *S, const uint32 *val, const int32 useZ80Mnemonics, const
status = error code
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym(FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw) {
char disasm_result[128];
int32 ch = val[0] & 0x7f;
Expand Down
4 changes: 0 additions & 4 deletions BESM6/besm6_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ t_stat parse_instruction_word (CONST char *cptr, t_value *val)
/*
* Печать машинной инструкции с мнемоникой.
*/
/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)
void besm6_fprint_cmd (FILE *of, uint32 cmd)
{
int reg, opcode, addr;
Expand Down
5 changes: 0 additions & 5 deletions GRI/gri_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ static const struct fnc_op fop[] = {

/* Print opcode field for FO, SF */

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

void fprint_op (FILE *of, uint32 inst, uint32 op)
{
int32 i, nfirst;
Expand Down
5 changes: 0 additions & 5 deletions H316/h316_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,6 @@ static const int32 opc_val[] = {
status = space needed
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

void fprint_opr (FILE *of, int32 inst, int32 Class)
{
int32 i, j, sp;
Expand Down
9 changes: 2 additions & 7 deletions HP2100/hp2100_sys.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* hp2100_sys.c: HP 2100 simulator interface
Copyright (c) 1993-2016, Robert M. Supnik
Copyright (c) 2017 J. David Bryan
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand All @@ -23,6 +24,7 @@
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik.
14-Jan-17 JDB Removed use of Fprintf functions for version 4.x and on
30-Dec-16 JDB Corrected parsing of memory reference instructions
13-May-16 JDB Modified for revised SCP API function parameter types
19-Jun-15 JDB Conditionally use Fprintf function for version 4.x and on
Expand Down Expand Up @@ -71,13 +73,6 @@
#include "hp2100_cpu.h"


#if (SIM_MAJOR >= 4)
#define fprintf Fprintf
#define fputs(_s,_f) Fprintf (_f, "%s", _s)
#define fputc(_c,_f) Fprintf (_f, "%c", _c)
#endif


extern DEVICE mp_dev;
extern DEVICE dma1_dev, dma2_dev;
extern DEVICE ptr_dev, ptp_dev;
Expand Down
5 changes: 0 additions & 5 deletions I1401/i1401_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ const char *opcode[64] = {

/* Print an address from three characters */

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

void fprint_addr (FILE *of, t_value *dig)
{
int32 addr, xa;
Expand Down
5 changes: 0 additions & 5 deletions I1620/i1620_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,6 @@ struct opc opcode[] = {

/* Print an address from five characters */

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

void fprint_addr (FILE *of, int32 spc, t_value *dig, t_bool flg)
{
int32 i, idx;
Expand Down
5 changes: 0 additions & 5 deletions I7094/i7094_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,6 @@ static const t_uint64 opc_v[] = {
return = status code
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
5 changes: 0 additions & 5 deletions Ibm1130/ibm1130_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ static int ebcdic_to_ascii (int ch)
return '?';
}

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw)
{
int32 ch, OP, F, TAG, INDIR, DSPLC, IR, eaddr;
Expand Down
5 changes: 0 additions & 5 deletions Interdata/id16_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,6 @@ static const uint32 opc_val[] = {
if < 0, number of extra bytes retired
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
5 changes: 0 additions & 5 deletions Interdata/id32_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ static const uint32 opc_val[] = {

/* Print an RX specifier */

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_addr (FILE *of, t_addr addr, uint32 rx, uint32 ea1,
uint32 ea2)
{
Expand Down
5 changes: 0 additions & 5 deletions LGP/lgp_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ static const char opcode[] = "ZBYRIDNMPEUTHCAS";

static const char hex_decode[] = "0123456789FGJKQW";

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

void lgp_sprint_addr (char *buf, DEVICE *dptr, t_addr addr)
{
if ((dptr == sim_devices[0]) &&
Expand Down
5 changes: 0 additions & 5 deletions NOVA/nova_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,11 +637,6 @@ static const int32 dev_val[] = {
Outputs:
return = error code
*/
/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_addr (FILE *of, t_addr addr, int32 ind, int32 mode,
int32 disp, t_bool ext, int32 cflag)
{
Expand Down
5 changes: 0 additions & 5 deletions PDP1/pdp1_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,6 @@ static const int32 opc_val[] = {
status = space needed?
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

int32 fprint_opr (FILE *of, int32 inst, int32 Class, int32 sp)
{
int32 i, j;
Expand Down
4 changes: 0 additions & 4 deletions PDP10/pdp10_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,6 @@ static const char *devnam[NUMDEV] = {

#define FMTASC(x) ((x) < 040)? "<%03o>": "%c", (x)
#define SIXTOASC(x) ((x) + 040)
/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
Expand Down
5 changes: 0 additions & 5 deletions PDP11/pdp11_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,6 @@ static const char r50_to_asc[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ$._0123456789";
count = -number of extra words retired
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

int32 fprint_spec (FILE *of, t_addr addr, int32 spec, t_value nval,
int32 flag, int32 iflag)
{
Expand Down
5 changes: 0 additions & 5 deletions PDP18B/pdp18b_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,11 +905,6 @@ static const int32 opc_val[] = {
status = space needed?
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

int32 fprint_opr (FILE *of, int32 inst, int32 clss, int32 sp)
{
int32 i, j;
Expand Down
5 changes: 0 additions & 5 deletions PDP8/pdp8_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,6 @@ static const int32 fop_val[] = {
status = space needed
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

int32 fprint_opr (FILE *of, int32 inst, int32 Class, int32 sp)
{
int32 i, j;
Expand Down
4 changes: 0 additions & 4 deletions PDQ-3/pdq3_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,6 @@ t_stat sim_load (FILE *fi, CONST char *cptr, CONST char *fnam, int flag)
* The t_addr type must be 32 bit, the upper half contains the segment, the lower
* half contains the offset. If the upper half is NIL, it is a word address
*/
/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)
void pdq3_sprint_addr (char *buf, DEVICE *dptr, t_addr addr)
{
*buf = '\0';
Expand Down
5 changes: 0 additions & 5 deletions S3/s3_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,6 @@ return (SCPE_OK);
status = error code
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
5 changes: 0 additions & 5 deletions SAGE/m68k_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,6 @@ const char *sim_stop_messages[] = {
#define DATA_B(x) (x&0xff)
#define DATA_W(x) (x&0xffff)

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

static t_stat _fsymea(FILE* of,t_addr addr,int ea, int oplen,t_value* rest)
{
int eamod = EAMOD_FIELD(ea);
Expand Down
2 changes: 0 additions & 2 deletions SDS/sds_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ static const char *chname[] = {
inst = mask bits
*/

#define fprintf Fprintf /* Use scp.c provided fprintf function */

void fprint_reg (FILE *of, int32 inst)
{
int32 i, j, sp;
Expand Down
5 changes: 0 additions & 5 deletions SSEM/ssem_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ if (flag == 1) return ssem_dump(fi);
return ssem_load_dmp(fi);
}

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

/* Utility routine - prints number in decimal */

t_stat ssem_fprint_decimal (FILE *of, uint32 inst)
Expand Down
5 changes: 0 additions & 5 deletions TX-0/tx0_sys_orig.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ const OPMAP opmap_orig [] = {
{ 0000000, NULL, NULL }
};

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym_orig (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
5 changes: 0 additions & 5 deletions VAX/vax_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,6 @@ const char* regname[] = {
if < 0, number of extra bytes retired
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr exta, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
5 changes: 0 additions & 5 deletions VAX/vax_syscm.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ static const char r50_to_asc[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ$._0123456789";
count = -number of extra words retired
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

int32 fprint_spec (FILE *of, t_addr addr, int32 spec, int32 nval)
{
int32 reg, mode;
Expand Down
5 changes: 0 additions & 5 deletions alpha/alpha_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,6 @@ const uint32 opval[] = {
if < 0, number of extra bytes retired
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
4 changes: 4 additions & 0 deletions scp.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ char *sim_encode_quoted_string (const uint8 *iptr, uint32 size);
void fprint_buffer_string (FILE *st, const uint8 *buf, uint32 size);
t_value strtotv (CONST char *cptr, CONST char **endptr, uint32 radix);
int Fprintf (FILE *f, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,_f) Fprintf(_f,"%s",_s)
#define fputc(_c,_f) Fprintf(_f,"%c",_c)
t_stat sim_set_memory_load_file (const unsigned char *data, size_t size);
int Fgetc (FILE *f);
t_stat fprint_val (FILE *stream, t_value val, uint32 rdx, uint32 wid, uint32 fmt);
Expand Down
5 changes: 0 additions & 5 deletions sigma/sigma_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,6 @@ static const char *opcode[] = {
return = status code
*/

/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw)
{
Expand Down
5 changes: 0 additions & 5 deletions swtp6800/common/m6800.c
Original file line number Diff line number Diff line change
Expand Up @@ -1952,11 +1952,6 @@ t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
status = error code
for M6800
*/
/* Use scp.c provided fprintf function */
#define fprintf Fprintf
#define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c)

t_stat fprint_sym (FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw)
{
int32 i, inst, inst1;
Expand Down

0 comments on commit d8dbc7e

Please sign in to comment.