From 5bd6ea9496dd660d4a6a4e82c4a871f3bee20b95 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 20 Sep 2015 14:08:52 -0700 Subject: [PATCH] HP2100: Latest changes from Dave Bryan --- HP2100/hp2100_defs.h | 12 ++++++++---- HP2100/hp2100_sys.c | 19 +++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/HP2100/hp2100_defs.h b/HP2100/hp2100_defs.h index a2bca878..f115ef48 100644 --- a/HP2100/hp2100_defs.h +++ b/HP2100/hp2100_defs.h @@ -1,6 +1,6 @@ /* hp2100_defs.h: HP 2100 simulator definitions - Copyright (c) 1993-2014, Robert M. Supnik + Copyright (c) 1993-2015, 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,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. + 19-Jun-15 JDB Conditionally use Global_PC for PC for version 4.0 and on 30-Dec-14 JDB Added S-register parameters to ibl_copy, more IBL constants 28-Dec-14 JDB Changed suppression from #pragma GCC to #pragma clang 05-Feb-13 JDB Added declaration for hp_fprint_stopped @@ -77,11 +78,14 @@ #ifndef HP2100_DEFS_H_ #define HP2100_DEFS_H_ 0 -#include "sim_defs.h" /* simulator defns */ -/* Rename of global PC variable to avoid namespace conflicts on some platforms */ +#include "sim_defs.h" +#include "sim_rev.h" -#define PC PC_Global + +#if (SIM_MAJOR >= 4) + #define PC PC_Global /* Rename to avoid namespace conflicts */ +#endif /* The following pragmas quell clang warnings that are on by default but should diff --git a/HP2100/hp2100_sys.c b/HP2100/hp2100_sys.c index 45b7c138..00cf26db 100644 --- a/HP2100/hp2100_sys.c +++ b/HP2100/hp2100_sys.c @@ -23,6 +23,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. + 19-Jun-15 JDB Conditionally use Fprintf function for version 4.x and on 18-Jun-15 JDB Added cast to int for isspace parameter 24-Dec-14 JDB Added casts to t_addr and t_value for 64-bit compatibility Made local routines static @@ -62,9 +63,18 @@ 27-Oct-98 RMS V2.4 load interface */ + +#include #include "hp2100_defs.h" #include "hp2100_cpu.h" -#include +#include "sim_rev.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; @@ -431,13 +441,6 @@ static const int32 vtab[] = { #define FMTASC(x) ((x) < 040)? "<%03o>": "%c", (x) -#if (SIM_MAJOR >= 4) -/* 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) -#endif - t_stat fprint_sym (FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw) {