ALL: Massive 'const' cleanup

These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.

Most simulators can now also be compiled with a C++ compiler without
warnings.

Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
This commit is contained in:
Mark Pizzolato 2016-05-15 15:25:33 -07:00
parent 60a8a2d43d
commit 5531ccb175
444 changed files with 4119 additions and 3798 deletions

View file

@ -113,7 +113,7 @@ int32 PCX; /* External view of PC *
t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_reset (DEVICE *dptr); t_stat cpu_reset (DEVICE *dptr);
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
void setarith(int32 reg); void setarith(int32 reg);
void setlogical(int32 reg); void setlogical(int32 reg);
void setinc(int32 reg); void setinc(int32 reg);
@ -1163,7 +1163,7 @@ t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw)
return SCPE_OK; return SCPE_OK;
} }
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 mc = 0; int32 mc = 0;
uint32 i; uint32 i;

View file

@ -153,7 +153,7 @@ int32 oplen[256] = {
load starts at the current value of the PC. load starts at the current value of the PC.
*/ */
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag) t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
{ {
int32 i, addr = 0, cnt = 0; int32 i, addr = 0, cnt = 0;
@ -234,7 +234,7 @@ return -(oplen[inst] - 1);
status = error status status = error status
*/ */
t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
{ {
int32 cflag, i = 0, j, r; int32 cflag, i = 0, j, r;
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];

View file

@ -154,24 +154,24 @@ extern t_stat sim_instr_8086(void);
extern void cpu8086reset(void); extern void cpu8086reset(void);
/* function prototypes */ /* function prototypes */
static t_stat cpu_set_switcher (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_switcher (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_reset_switcher(UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_reset_switcher(UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_show_switcher (FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat cpu_show_switcher (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
static int32 switchcpu_io (const int32 port, const int32 io, const int32 data); static int32 switchcpu_io (const int32 port, const int32 io, CONST int32 data);
static t_stat cpu_set_altairrom (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_altairrom (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_noaltairrom (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_noaltairrom (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_nommu (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_nommu (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_banked (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_banked (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_nonbanked (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_nonbanked (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_ramtype (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_ramtype (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_chiptype (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_chiptype (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_size (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_size (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_set_memory (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_set_memory (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat cpu_clear_command (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat cpu_clear_command (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static void cpu_clear(void); static void cpu_clear(void);
static t_stat cpu_show (FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat cpu_show (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
static t_stat chip_show (FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat chip_show (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
static t_stat cpu_ex(t_value *vptr, t_addr addr, UNIT *uptr, int32 sw); static t_stat cpu_ex(t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
static t_stat cpu_dep(t_value val, t_addr addr, UNIT *uptr, int32 sw); static t_stat cpu_dep(t_value val, t_addr addr, UNIT *uptr, int32 sw);
static t_stat cpu_reset(DEVICE *dptr); static t_stat cpu_reset(DEVICE *dptr);
@ -2075,7 +2075,6 @@ static t_stat sim_instr_mmu (void) {
extern int32 timerInterruptHandler; extern int32 timerInterruptHandler;
extern int32 keyboardInterrupt; extern int32 keyboardInterrupt;
extern uint32 keyboardInterruptHandler; extern uint32 keyboardInterruptHandler;
extern const t_bool rtc_avail;
int32 reason = SCPE_OK; int32 reason = SCPE_OK;
register uint32 specialProcessing; register uint32 specialProcessing;
register uint32 AF; register uint32 AF;
@ -6738,9 +6737,9 @@ const static CPUFLAG *cpuflags[NUM_CHIP_TYPE] = { cpuflags8080, cpuflagsZ80,
cpuflags8086, cpuflagsM68K, }; cpuflags8086, cpuflagsM68K, };
/* needs to be set for each ramtype <= MAX_RAM_TYPE */ /* needs to be set for each ramtype <= MAX_RAM_TYPE */
static char *ramTypeToString[] = { "AZ80", "HRAM", "VRAM", "CRAM" }; static const char *ramTypeToString[] = { "AZ80", "HRAM", "VRAM", "CRAM" };
static t_stat chip_show(FILE *st, UNIT *uptr, int32 val, void *desc) { static t_stat chip_show(FILE *st, UNIT *uptr, int32 val, CONST void *desc) {
fprintf(st, cpu_unit.flags & UNIT_CPU_OPSTOP ? "ITRAP, " : "NOITRAP, "); fprintf(st, cpu_unit.flags & UNIT_CPU_OPSTOP ? "ITRAP, " : "NOITRAP, ");
if (chiptype < NUM_CHIP_TYPE) if (chiptype < NUM_CHIP_TYPE)
fprintf(st, "%s", cpu_mod[chiptype].mstring); fprintf(st, "%s", cpu_mod[chiptype].mstring);
@ -6750,7 +6749,7 @@ static t_stat chip_show(FILE *st, UNIT *uptr, int32 val, void *desc) {
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_show(FILE *st, UNIT *uptr, int32 val, void *desc) { static t_stat cpu_show(FILE *st, UNIT *uptr, int32 val, CONST void *desc) {
uint32 i, maxBanks, first = TRUE; uint32 i, maxBanks, first = TRUE;
MDEV m; MDEV m;
maxBanks = ((cpu_unit.flags & UNIT_CPU_BANKED) || maxBanks = ((cpu_unit.flags & UNIT_CPU_BANKED) ||
@ -6815,23 +6814,23 @@ static void cpu_clear(void) {
clockHasChanged = FALSE; clockHasChanged = FALSE;
} }
static t_stat cpu_clear_command(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_clear_command(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
cpu_clear(); cpu_clear();
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_altairrom(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_altairrom(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
install_ALTAIRbootROM(); install_ALTAIRbootROM();
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_noaltairrom(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_noaltairrom(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
mmu_table[ALTAIR_ROM_LOW >> LOG2PAGESIZE] = MEMORYSIZE < MAXBANKSIZE ? mmu_table[ALTAIR_ROM_LOW >> LOG2PAGESIZE] = MEMORYSIZE < MAXBANKSIZE ?
EMPTY_PAGE : RAM_PAGE; EMPTY_PAGE : RAM_PAGE;
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_nommu(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_nommu(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
if (chiptype == CHIP_TYPE_8086) { if (chiptype == CHIP_TYPE_8086) {
sim_printf("Cannot switch off MMU for 8086 CPU.\n"); sim_printf("Cannot switch off MMU for 8086 CPU.\n");
return SCPE_ARG; return SCPE_ARG;
@ -6849,7 +6848,7 @@ static t_stat cpu_set_nommu(UNIT *uptr, int32 value, char *cptr, void *desc) {
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_banked(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_banked(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
if ((chiptype == CHIP_TYPE_8080) || (chiptype == CHIP_TYPE_Z80)) { if ((chiptype == CHIP_TYPE_8080) || (chiptype == CHIP_TYPE_Z80)) {
if (MEMORYSIZE <= MAXBANKSIZE) if (MEMORYSIZE <= MAXBANKSIZE)
previousCapacity = MEMORYSIZE; previousCapacity = MEMORYSIZE;
@ -6864,7 +6863,7 @@ static t_stat cpu_set_banked(UNIT *uptr, int32 value, char *cptr, void *desc) {
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_nonbanked(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_nonbanked(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
if ((chiptype == CHIP_TYPE_8080) || (chiptype == CHIP_TYPE_Z80)) { if ((chiptype == CHIP_TYPE_8080) || (chiptype == CHIP_TYPE_Z80)) {
MEMORYSIZE = previousCapacity; MEMORYSIZE = previousCapacity;
cpu_dev.awidth = MAXBANKSIZELOG2; cpu_dev.awidth = MAXBANKSIZELOG2;
@ -6965,10 +6964,10 @@ static void cpu_set_chiptype_short(const int32 value) {
return; /* nothing to do */ return; /* nothing to do */
if (((chiptype == CHIP_TYPE_8080) && (value == CHIP_TYPE_Z80)) || if (((chiptype == CHIP_TYPE_8080) && (value == CHIP_TYPE_Z80)) ||
((chiptype == CHIP_TYPE_Z80) && (value == CHIP_TYPE_8080))) { ((chiptype == CHIP_TYPE_Z80) && (value == CHIP_TYPE_8080))) {
chiptype = value; chiptype = (ChipType)value;
return; return;
} }
chiptype = value; chiptype = (ChipType)value;
switch (chiptype) { switch (chiptype) {
case CHIP_TYPE_8080: case CHIP_TYPE_8080:
case CHIP_TYPE_Z80: case CHIP_TYPE_Z80:
@ -6998,13 +6997,13 @@ static void cpu_set_chiptype_short(const int32 value) {
} }
} }
static t_stat cpu_set_chiptype(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_chiptype(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
cpu_set_chiptype_short(value); cpu_set_chiptype_short(value);
cpu_clear(); cpu_clear();
return SCPE_OK; return SCPE_OK;
} }
static int32 switchcpu_io(const int32 port, const int32 io, const int32 data) { static int32 switchcpu_io(const int32 port, const int32 io, CONST int32 data) {
int32 new_chiptype = 0; int32 new_chiptype = 0;
if (io == 0) { /* Read, switch CPU */ if (io == 0) { /* Read, switch CPU */
switch(chiptype) { switch(chiptype) {
@ -7036,7 +7035,7 @@ static int32 switchcpu_io(const int32 port, const int32 io, const int32 data) {
return 0; return 0;
} }
static t_stat cpu_show_switcher(FILE *st, UNIT *uptr, int32 val, void *desc) { static t_stat cpu_show_switcher(FILE *st, UNIT *uptr, int32 val, CONST void *desc) {
if ((cpu_unit.flags & UNIT_CPU_SWITCHER) && (switcherPort >= 0)) if ((cpu_unit.flags & UNIT_CPU_SWITCHER) && (switcherPort >= 0))
fprintf(st, "SWITCHER=0x%02x", switcherPort); fprintf(st, "SWITCHER=0x%02x", switcherPort);
else else
@ -7044,7 +7043,7 @@ static t_stat cpu_show_switcher(FILE *st, UNIT *uptr, int32 val, void *desc) {
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_switcher(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_switcher(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
struct idev safe; struct idev safe;
switcherPort &= 0xff; switcherPort &= 0xff;
safe = dev_table[switcherPort]; safe = dev_table[switcherPort];
@ -7056,7 +7055,7 @@ static t_stat cpu_set_switcher(UNIT *uptr, int32 value, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_reset_switcher(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_reset_switcher(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
if (sim_map_resource(switcherPort, 1, RESOURCE_TYPE_IO, oldSwitcherDevice.routine, FALSE)) { if (sim_map_resource(switcherPort, 1, RESOURCE_TYPE_IO, oldSwitcherDevice.routine, FALSE)) {
sim_printf("%s: error mapping I/O resource at 0x%04x\n", __FUNCTION__, switcherPort); sim_printf("%s: error mapping I/O resource at 0x%04x\n", __FUNCTION__, switcherPort);
return SCPE_ARG; return SCPE_ARG;
@ -7064,7 +7063,7 @@ static t_stat cpu_reset_switcher(UNIT *uptr, int32 value, char *cptr, void *desc
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_ramtype(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_ramtype(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
if (value == ramtype) { if (value == ramtype) {
if (cpu_unit.flags & UNIT_CPU_VERBOSE) if (cpu_unit.flags & UNIT_CPU_VERBOSE)
@ -7149,11 +7148,11 @@ static t_stat set_size(uint32 size) {
return SCPE_OK; return SCPE_OK;
} }
static t_stat cpu_set_size(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_size(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
return set_size(value); return set_size(value);
} }
static t_stat cpu_set_memory(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat cpu_set_memory(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
uint32 size, result, i; uint32 size, result, i;
if (cptr == NULL) if (cptr == NULL)
return SCPE_ARG; return SCPE_ARG;
@ -7175,7 +7174,7 @@ void altairz80_init(void) {
/* altairz80_print_tables(); */ /* altairz80_print_tables(); */
} }
void (*sim_vm_init) (void) = &altairz80_init; WEAK void (*sim_vm_init) (void) = &altairz80_init;
/* This is the binary loader. The input file is considered to be a string of /* This is the binary loader. The input file is considered to be a string of
literal bytes with no special format. The load starts at the current value literal bytes with no special format. The load starts at the current value
@ -7186,12 +7185,12 @@ void (*sim_vm_init) (void) = &altairz80_init;
#define PLURAL(x) (x), (x) == 1 ? "" : "s" #define PLURAL(x) (x), (x) == 1 ? "" : "s"
static t_stat sim_load_m68k(FILE *fileref, char *cptr, char *fnam, int flag) { static t_stat sim_load_m68k(FILE *fileref, CONST char *cptr, CONST char *fnam, int flag) {
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
int32 i; int32 i;
t_addr j, lo, hi; t_addr j, lo, hi;
uint32 addr, org, cnt = 0; uint32 addr, org, cnt = 0;
const char* result; CONST char* result;
if (flag ) { if (flag ) {
result = get_range(NULL, cptr, &lo, &hi, 16, M68K_MAX_RAM, 0); result = get_range(NULL, cptr, &lo, &hi, 16, M68K_MAX_RAM, 0);
if (result == NULL) if (result == NULL)
@ -7221,11 +7220,11 @@ static t_stat sim_load_m68k(FILE *fileref, char *cptr, char *fnam, int flag) {
return SCPE_OK; return SCPE_OK;
} }
t_stat sim_load(FILE *fileref, char *cptr, char *fnam, int flag) { t_stat sim_load(FILE *fileref, CONST char *cptr, CONST char *fnam, int flag) {
int32 i; int32 i;
uint32 addr, cnt = 0, org, pagesModified = 0, makeROM = FALSE; uint32 addr, cnt = 0, org, pagesModified = 0, makeROM = FALSE;
t_addr j, lo, hi; t_addr j, lo, hi;
const char *result; CONST char *result;
MDEV m; MDEV m;
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
if (chiptype == CHIP_TYPE_M68K) if (chiptype == CHIP_TYPE_M68K)

View file

@ -122,7 +122,6 @@ extern int32 DE1_S; /* alternate DE register */
extern int32 HL1_S; /* alternate HL register */ extern int32 HL1_S; /* alternate HL register */
extern int32 IFF_S; /* Interrupt Flip Flop */ extern int32 IFF_S; /* Interrupt Flip Flop */
extern int32 IR_S; /* Interrupt (upper) / Refresh (lower) register */ extern int32 IR_S; /* Interrupt (upper) / Refresh (lower) register */
extern int32 chiptype;
#if !UNIX_PLATFORM #if !UNIX_PLATFORM
extern void pollForCPUStop(void); extern void pollForCPUStop(void);

View file

@ -109,4 +109,6 @@ typedef struct {
uint32 io_size; /* I/O Address Space requirement */ uint32 io_size; /* I/O Address Space requirement */
} PNP_INFO; } PNP_INFO;
extern ChipType chiptype;
#endif #endif

View file

@ -163,8 +163,7 @@ int32 dsk11(const int32 port, const int32 io, const int32 data);
int32 dsk12(const int32 port, const int32 io, const int32 data); int32 dsk12(const int32 port, const int32 io, const int32 data);
static t_stat dsk_boot(int32 unitno, DEVICE *dptr); static t_stat dsk_boot(int32 unitno, DEVICE *dptr);
static t_stat dsk_reset(DEVICE *dptr); static t_stat dsk_reset(DEVICE *dptr);
static t_stat dsk_attach(UNIT *uptr, char *cptr); static t_stat dsk_attach(UNIT *uptr, CONST char *cptr);
static const char* dsk_description(DEVICE *dptr);
extern UNIT cpu_unit; extern UNIT cpu_unit;
extern uint32 PCX; extern uint32 PCX;
@ -369,7 +368,7 @@ DEVICE dsk_dev = {
dsk_dt, NULL, NULL, NULL, NULL, NULL, &dsk_description dsk_dt, NULL, NULL, NULL, NULL, NULL, &dsk_description
}; };
static char* selectInOut(const int32 io) { static const char* selectInOut(const int32 io) {
return io == 0 ? "IN" : "OUT"; return io == 0 ? "IN" : "OUT";
} }
@ -399,7 +398,7 @@ static t_stat dsk_reset(DEVICE *dptr) {
} }
/* dsk_attach - determine type of drive attached based on disk image size */ /* dsk_attach - determine type of drive attached based on disk image size */
static t_stat dsk_attach(UNIT *uptr, char *cptr) { static t_stat dsk_attach(UNIT *uptr, CONST char *cptr) {
int32 thisUnitIndex; int32 thisUnitIndex;
int32 imageSize; int32 imageSize;
const t_stat r = attach_unit(uptr, cptr); /* attach unit */ const t_stat r = attach_unit(uptr, cptr); /* attach unit */

View file

@ -36,13 +36,13 @@
#define VERBOSE_MSG (1 << 2) #define VERBOSE_MSG (1 << 2)
/* The following routines are based on work from Howard M. Harte */ /* The following routines are based on work from Howard M. Harte */
static t_stat set_geom(UNIT *uptr, int32 val, char *cptr, void *desc); static t_stat set_geom(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
static t_stat show_geom(FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat show_geom(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
static t_stat set_format(UNIT *uptr, int32 val, char *cptr, void *desc); static t_stat set_format(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
static t_stat show_format(FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat show_format(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
static t_stat hdsk_reset(DEVICE *dptr); static t_stat hdsk_reset(DEVICE *dptr);
static t_stat hdsk_attach(UNIT *uptr, char *cptr); static t_stat hdsk_attach(UNIT *uptr, CONST char *cptr);
static t_stat hdsk_detach(UNIT *uptr); static t_stat hdsk_detach(UNIT *uptr);
static uint32 is_imd(const UNIT *uptr); static uint32 is_imd(const UNIT *uptr);
static void assignFormat(UNIT *uptr); static void assignFormat(UNIT *uptr);
@ -71,15 +71,14 @@ static void verifyDiskInfo(const DISK_INFO *info, const char unitChar);
extern uint32 PCX; extern uint32 PCX;
extern UNIT cpu_unit; extern UNIT cpu_unit;
extern ChipType chiptype;
extern void install_ALTAIRbootROM(void); extern void install_ALTAIRbootROM(void);
extern void PutBYTEWrapper(const uint32 Addr, const uint32 Value); extern void PutBYTEWrapper(const uint32 Addr, const uint32 Value);
extern uint8 GetBYTEWrapper(const uint32 Addr); extern uint8 GetBYTEWrapper(const uint32 Addr);
extern t_stat install_bootrom(const int32 bootrom[], const int32 size, const int32 addr, const int32 makeROM); extern t_stat install_bootrom(const int32 bootrom[], const int32 size, const int32 addr, const int32 makeROM);
extern int32 bootrom_dsk[]; extern int32 bootrom_dsk[];
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern int32 find_unit_index(UNIT *uptr); extern int32 find_unit_index(UNIT *uptr);
@ -430,7 +429,7 @@ static void verifyDiskInfo(const DISK_INFO *info, const char unitChar) {
} }
/* Attach routine */ /* Attach routine */
static t_stat hdsk_attach(UNIT *uptr, char *cptr) { static t_stat hdsk_attach(UNIT *uptr, CONST char *cptr) {
int32 thisUnitIndex; int32 thisUnitIndex;
char unitChar; char unitChar;
const t_stat r = attach_unit(uptr, cptr); /* attach unit */ const t_stat r = attach_unit(uptr, cptr); /* attach unit */
@ -541,7 +540,7 @@ static t_stat hdsk_detach(UNIT *uptr) {
} }
/* Set disk geometry routine */ /* Set disk geometry routine */
static t_stat set_geom(UNIT *uptr, int32 val, char *cptr, void *desc) { static t_stat set_geom(UNIT *uptr, int32 val, CONST char *cptr, void *desc) {
uint32 numberOfTracks, numberOfSectors, sectorSize; uint32 numberOfTracks, numberOfSectors, sectorSize;
int result, n; int result, n;
@ -567,7 +566,7 @@ static t_stat set_geom(UNIT *uptr, int32 val, char *cptr, void *desc) {
} }
/* Show disk geometry routine */ /* Show disk geometry routine */
static t_stat show_geom(FILE *st, UNIT *uptr, int32 val, void *desc) { static t_stat show_geom(FILE *st, UNIT *uptr, int32 val, CONST void *desc) {
if (uptr == NULL) if (uptr == NULL)
return SCPE_IERR; return SCPE_IERR;
fprintf(st, "T:%d/N:%d/S:%d", uptr -> HDSK_NUMBER_OF_TRACKS, fprintf(st, "T:%d/N:%d/S:%d", uptr -> HDSK_NUMBER_OF_TRACKS,
@ -578,7 +577,7 @@ static t_stat show_geom(FILE *st, UNIT *uptr, int32 val, void *desc) {
#define QUOTE1(text) #text #define QUOTE1(text) #text
#define QUOTE2(text) QUOTE1(text) #define QUOTE2(text) QUOTE1(text)
/* Set disk format routine */ /* Set disk format routine */
static t_stat set_format(UNIT *uptr, int32 val, char *cptr, void *desc) { static t_stat set_format(UNIT *uptr, int32 val, CONST char *cptr, void *desc) {
char fmtname[DPB_NAME_LENGTH + 1]; char fmtname[DPB_NAME_LENGTH + 1];
int32 i; int32 i;
@ -611,7 +610,7 @@ static t_stat set_format(UNIT *uptr, int32 val, char *cptr, void *desc) {
} }
/* Show disk format routine */ /* Show disk format routine */
static t_stat show_format(FILE *st, UNIT *uptr, int32 val, void *desc) { static t_stat show_format(FILE *st, UNIT *uptr, int32 val, CONST void *desc) {
if (uptr == NULL) if (uptr == NULL)
return SCPE_IERR; return SCPE_IERR;
fprintf(st, "%s", dpb[uptr -> HDSK_FORMAT_TYPE].name); fprintf(st, "%s", dpb[uptr -> HDSK_FORMAT_TYPE].name);

View file

@ -89,7 +89,7 @@ extern t_stat install_bootrom(const int32 bootrom[], const int32 size, const int
#define CMD_INITIALIZE 14 #define CMD_INITIALIZE 14
#define CMD_MAX (CMD_INITIALIZE + 1) #define CMD_MAX (CMD_INITIALIZE + 1)
static char* commandMessage[CMD_MAX] = { static const char* commandMessage[CMD_MAX] = {
"Seek", // CMD_SEEK 0 "Seek", // CMD_SEEK 0
"Undefined 1", // 1 "Undefined 1", // 1
"Write Sector", // CMD_WRITE_SEC 2 "Write Sector", // CMD_WRITE_SEC 2
@ -162,7 +162,7 @@ static int32 hdAdata(const int32 port, const int32 io, const int32 data);
static void doRead(const int32 port, const int32 data, const uint32 command); static void doRead(const int32 port, const int32 data, const uint32 command);
static void doWrite(const int32 port, const int32 data, const uint32 command); static void doWrite(const int32 port, const int32 data, const uint32 command);
static t_stat dsk_reset(DEVICE *dptr); static t_stat dsk_reset(DEVICE *dptr);
static char* cmdTranslate(const int32 cmd); static const char* cmdTranslate(const int32 cmd);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
static const char* mhdsk_description(DEVICE *dptr); static const char* mhdsk_description(DEVICE *dptr);
@ -253,7 +253,7 @@ static t_stat mhdsk_boot(int32 unitno, DEVICE *dptr) {
return SCPE_OK; return SCPE_OK;
} }
static char* cmdTranslate(const int32 cmd) { static const char* cmdTranslate(const int32 cmd) {
static char result[128]; static char result[128];
if ((0 <= cmd) && (cmd < CMD_MAX)) if ((0 <= cmd) && (cmd < CMD_MAX))
return commandMessage[cmd]; return commandMessage[cmd];

View file

@ -40,11 +40,11 @@ extern uint32 PCX;
#define NET_INIT_POLL_SERVER 16000 #define NET_INIT_POLL_SERVER 16000
#define NET_INIT_POLL_CLIENT 15000 #define NET_INIT_POLL_CLIENT 15000
static t_stat net_attach (UNIT *uptr, char *cptr); static t_stat net_attach (UNIT *uptr, CONST char *cptr);
static t_stat net_detach (UNIT *uptr); static t_stat net_detach (UNIT *uptr);
static t_stat net_reset (DEVICE *dptr); static t_stat net_reset (DEVICE *dptr);
static t_stat net_svc (UNIT *uptr); static t_stat net_svc (UNIT *uptr);
static t_stat set_net (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat set_net (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
int32 netStatus (const int32 port, const int32 io, const int32 data); int32 netStatus (const int32 port, const int32 io, const int32 data);
int32 netData (const int32 port, const int32 io, const int32 data); int32 netData (const int32 port, const int32 io, const int32 data);
static const char* net_description(DEVICE *dptr); static const char* net_description(DEVICE *dptr);
@ -119,7 +119,7 @@ DEVICE net_dev = {
net_dt, NULL, NULL, NULL, NULL, NULL, &net_description net_dt, NULL, NULL, NULL, NULL, NULL, &net_description
}; };
static t_stat set_net(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat set_net(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
char temp[CBUFSIZE]; char temp[CBUFSIZE];
if ((net_unit.flags & UNIT_ATT) && ((net_unit.flags & UNIT_SERVER) != (uint32)value)) { if ((net_unit.flags & UNIT_ATT) && ((net_unit.flags & UNIT_SERVER) != (uint32)value)) {
strncpy(temp, net_unit.filename, CBUFSIZE); /* save name for later attach */ strncpy(temp, net_unit.filename, CBUFSIZE); /* save name for later attach */
@ -154,7 +154,7 @@ static t_stat net_reset(DEVICE *dptr) {
return SCPE_OK; return SCPE_OK;
} }
static t_stat net_attach(UNIT *uptr, char *cptr) { static t_stat net_attach(UNIT *uptr, CONST char *cptr) {
uint32 i; uint32 i;
char host[CBUFSIZE], port[CBUFSIZE]; char host[CBUFSIZE], port[CBUFSIZE];

View file

@ -125,18 +125,18 @@ uint8 *URLContents(const char *URL, uint32 *length) {
#define SLEEP_ALLOWED_START_DEFAULT 100 /* default initial value for sleepAllowedCounter*/ #define SLEEP_ALLOWED_START_DEFAULT 100 /* default initial value for sleepAllowedCounter*/
#define DEFAULT_TIMER_DELTA 100 /* default value for timer delta in ms */ #define DEFAULT_TIMER_DELTA 100 /* default value for timer delta in ms */
static t_stat simh_dev_set_timeron (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat simh_dev_set_timeron (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat simh_dev_set_timeroff (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat simh_dev_set_timeroff (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat sio_reset(DEVICE *dptr); static t_stat sio_reset(DEVICE *dptr);
static t_stat sio_attach(UNIT *uptr, char *cptr); static t_stat sio_attach(UNIT *uptr, CONST char *cptr);
static t_stat sio_detach(UNIT *uptr); static t_stat sio_detach(UNIT *uptr);
static t_stat ptr_reset(DEVICE *dptr); static t_stat ptr_reset(DEVICE *dptr);
static t_stat ptp_reset(DEVICE *dptr); static t_stat ptp_reset(DEVICE *dptr);
static t_stat toBool(char tf, int32 *result); static t_stat toBool(char tf, int32 *result);
static t_stat sio_dev_set_port(UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat sio_dev_set_port(UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat sio_dev_show_port(FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat sio_dev_show_port(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
static t_stat sio_dev_set_interrupton(UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat sio_dev_set_interrupton(UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat sio_dev_set_interruptoff(UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat sio_dev_set_interruptoff(UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat sio_svc(UNIT *uptr); static t_stat sio_svc(UNIT *uptr);
static t_stat simh_dev_reset(DEVICE *dptr); static t_stat simh_dev_reset(DEVICE *dptr);
static t_stat simh_svc(UNIT *uptr); static t_stat simh_svc(UNIT *uptr);
@ -167,8 +167,6 @@ extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_typ
extern uint32 getClockFrequency(void); extern uint32 getClockFrequency(void);
extern void setClockFrequency(const uint32 Value); extern void setClockFrequency(const uint32 Value);
extern int32 chiptype;
extern const t_bool rtc_avail;
extern uint32 PCX; extern uint32 PCX;
extern int32 SR; extern int32 SR;
extern UNIT cpu_unit; extern UNIT cpu_unit;
@ -498,7 +496,7 @@ static void resetSIOWarningFlags(void) {
warnUnattachedPTP = warnUnattachedPTR = warnPTREOF = warnUnassignedPort = 0; warnUnattachedPTP = warnUnattachedPTR = warnPTREOF = warnUnassignedPort = 0;
} }
static t_stat sio_attach(UNIT *uptr, char *cptr) { static t_stat sio_attach(UNIT *uptr, CONST char *cptr) {
t_stat r = SCPE_IERR; t_stat r = SCPE_IERR;
sio_unit.u3 = FALSE; /* no character in terminal input buffer */ sio_unit.u3 = FALSE; /* no character in terminal input buffer */
get_uint(cptr, 10, 65535, &r); /* attempt to get port, discard result */ get_uint(cptr, 10, 65535, &r); /* attempt to get port, discard result */
@ -974,7 +972,7 @@ static uint32 equalSIP(SIO_PORT_INFO x, SIO_PORT_INFO y) {
(x.sio_reset == y.sio_reset) && (x.hasOUT == y.hasOUT); (x.sio_reset == y.sio_reset) && (x.hasOUT == y.hasOUT);
} }
static t_stat sio_dev_set_port(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat sio_dev_set_port(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
int32 result, n, position; int32 result, n, position;
SIO_PORT_INFO sip = { 0 }, old; SIO_PORT_INFO sip = { 0 }, old;
char hasReset, hasOUT; char hasReset, hasOUT;
@ -1040,7 +1038,7 @@ static t_stat sio_dev_set_port(UNIT *uptr, int32 value, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
static t_stat sio_dev_show_port(FILE *st, UNIT *uptr, int32 val, void *desc) { static t_stat sio_dev_show_port(FILE *st, UNIT *uptr, int32 val, CONST void *desc) {
int32 i, first = TRUE; int32 i, first = TRUE;
for (i = 0; port_table[i].port != -1; i++) for (i = 0; port_table[i].port != -1; i++)
if (!port_table[i].isBuiltin) { if (!port_table[i].isBuiltin) {
@ -1055,12 +1053,12 @@ static t_stat sio_dev_show_port(FILE *st, UNIT *uptr, int32 val, void *desc) {
return SCPE_OK; return SCPE_OK;
} }
static t_stat sio_dev_set_interrupton(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat sio_dev_set_interrupton(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
keyboardInterrupt = FALSE; keyboardInterrupt = FALSE;
return sim_activate(&sio_unit, sio_unit.wait); /* activate unit */ return sim_activate(&sio_unit, sio_unit.wait); /* activate unit */
} }
static t_stat sio_dev_set_interruptoff(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat sio_dev_set_interruptoff(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
keyboardInterrupt = FALSE; keyboardInterrupt = FALSE;
sim_cancel(&sio_unit); sim_cancel(&sio_unit);
return SCPE_OK; return SCPE_OK;
@ -1191,7 +1189,7 @@ enum simhPseudoDeviceCommands { /* do not change order or remove commands, add o
kSimhPseudoDeviceCommands kSimhPseudoDeviceCommands
}; };
static char *cmdNames[kSimhPseudoDeviceCommands] = { static const char *cmdNames[kSimhPseudoDeviceCommands] = {
"printTime", "printTime",
"startTimer", "startTimer",
"stopTimer", "stopTimer",
@ -1277,12 +1275,12 @@ static void warnNoRealTimeClock(void) {
" Sorry - no real time clock available.\n", PCX); " Sorry - no real time clock available.\n", PCX);
} }
static t_stat simh_dev_set_timeron(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat simh_dev_set_timeron(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
timeOfNextInterrupt = sim_os_msec() + timerDelta; timeOfNextInterrupt = sim_os_msec() + timerDelta;
return sim_activate(&simh_unit, simh_unit.wait); /* activate unit */ return sim_activate(&simh_unit, simh_unit.wait); /* activate unit */
} }
static t_stat simh_dev_set_timeroff(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat simh_dev_set_timeroff(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
timerInterrupt = FALSE; timerInterrupt = FALSE;
return SCPE_OK; return SCPE_OK;
} }

View file

@ -73,18 +73,17 @@ extern DEVICE wdi2_dev;
extern DEVICE scp300f_dev; extern DEVICE scp300f_dev;
extern int32 chiptype;
extern long disasm (unsigned char *data, char *output, int segsize, long offset); extern long disasm (unsigned char *data, char *output, int segsize, long offset);
void prepareMemoryAccessMessage(const t_addr loc); void prepareMemoryAccessMessage(const t_addr loc);
void prepareInstructionMessage(const t_addr loc, const uint32 op); void prepareInstructionMessage(const t_addr loc, const uint32 op);
t_stat fprint_sym (FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw); t_stat fprint_sym (FILE *of, t_addr addr, t_value *val, UNIT *uptr, int32 sw);
t_stat parse_sym(char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw); t_stat parse_sym(CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw);
t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* SCP data structures /* SCP data structures
sim_name simulator name string sim_name simulator name string
@ -135,7 +134,7 @@ const char *sim_stop_messages[] = {
"Invalid Opcode" "Invalid Opcode"
}; };
static char *const Mnemonics8080[] = { static const char *const Mnemonics8080[] = {
/* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */ /* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */
"NOP", "LXI B,#h", "STAX B", "INX B", "INR B", "DCR B", "MVI B,*h", "RLC", /* 00-07 */ "NOP", "LXI B,#h", "STAX B", "INX B", "INR B", "DCR B", "MVI B,*h", "RLC", /* 00-07 */
"_NOP", "DAD B", "LDAX B", "DCX B", "INR C", "DCR C", "MVI C,*h", "RRC", /* 08-0f */ "_NOP", "DAD B", "LDAX B", "DCX B", "INR C", "DCR C", "MVI C,*h", "RRC", /* 08-0f */
@ -171,7 +170,7 @@ static char *const Mnemonics8080[] = {
"RM", "SPHL", "JM #h", "EI", "CM #h", "_CALL #h", "CPI *h", "RST 7" /* f8-ff */ "RM", "SPHL", "JM #h", "EI", "CM #h", "_CALL #h", "CPI *h", "RST 7" /* f8-ff */
}; };
static char *const MnemonicsZ80[256] = { static const char *const MnemonicsZ80[256] = {
/* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */ /* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */
"NOP", "LD BC,#h", "LD (BC),A", "INC BC", "INC B", "DEC B", "LD B,*h", "RLCA", /* 00-07 */ "NOP", "LD BC,#h", "LD (BC),A", "INC BC", "INC B", "DEC B", "LD B,*h", "RLCA", /* 00-07 */
"EX AF,AF'", "ADD HL,BC", "LD A,(BC)", "DEC BC", "INC C", "DEC C", "LD C,*h", "RRCA", /* 08-0f */ "EX AF,AF'", "ADD HL,BC", "LD A,(BC)", "DEC BC", "INC C", "DEC C", "LD C,*h", "RRCA", /* 08-0f */
@ -207,7 +206,7 @@ static char *const MnemonicsZ80[256] = {
"RET M", "LD SP,HL", "JP M,#h", "EI", "CALL M,#h", "PFX_FD", "CP *h", "RST 38h" /* f8-ff */ "RET M", "LD SP,HL", "JP M,#h", "EI", "CALL M,#h", "PFX_FD", "CP *h", "RST 38h" /* f8-ff */
}; };
static char *const MnemonicsCB[256] = { static const char *const MnemonicsCB[256] = {
/* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */ /* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */
"RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (HL)", "RLC A", /* 00-07 */ "RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (HL)", "RLC A", /* 00-07 */
"RRC B", "RRC C", "RRC D", "RRC E", "RRC H", "RRC L", "RRC (HL)", "RRC A", /* 08-0f */ "RRC B", "RRC C", "RRC D", "RRC E", "RRC H", "RRC L", "RRC (HL)", "RRC A", /* 08-0f */
@ -243,7 +242,7 @@ static char *const MnemonicsCB[256] = {
"SET 7,B", "SET 7,C", "SET 7,D", "SET 7,E", "SET 7,H", "SET 7,L", "SET 7,(HL)", "SET 7,A" /* f8-ff */ "SET 7,B", "SET 7,C", "SET 7,D", "SET 7,E", "SET 7,H", "SET 7,L", "SET 7,(HL)", "SET 7,A" /* f8-ff */
}; };
static char *const MnemonicsED[256] = { static const char *const MnemonicsED[256] = {
/* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */ /* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */
"DB EDh,00h", "DB EDh,01h", "DB EDh,02h", "DB EDh,03h", "DB EDh,04h", "DB EDh,05h", "DB EDh,06h", "DB EDh,07h", /* 00-07 */ "DB EDh,00h", "DB EDh,01h", "DB EDh,02h", "DB EDh,03h", "DB EDh,04h", "DB EDh,05h", "DB EDh,06h", "DB EDh,07h", /* 00-07 */
"DB EDh,08h", "DB EDh,09h", "DB EDh,0Ah", "DB EDh,0Bh", "DB EDh,0Ch", "DB EDh,0Dh", "DB EDh,0Eh", "DB EDh,0Fh", /* 08-0f */ "DB EDh,08h", "DB EDh,09h", "DB EDh,0Ah", "DB EDh,0Bh", "DB EDh,0Ch", "DB EDh,0Dh", "DB EDh,0Eh", "DB EDh,0Fh", /* 08-0f */
@ -279,7 +278,7 @@ static char *const MnemonicsED[256] = {
"DB EDh,F8h", "DB EDh,F9h", "DB EDh,FAh", "DB EDh,FBh", "DB EDh,FCh", "DB EDh,FDh", "DB EDh,FEh", "DB EDh,FFh" /* f8-ff */ "DB EDh,F8h", "DB EDh,F9h", "DB EDh,FAh", "DB EDh,FBh", "DB EDh,FCh", "DB EDh,FDh", "DB EDh,FEh", "DB EDh,FFh" /* f8-ff */
}; };
static char *const MnemonicsXX[256] = { static const char *const MnemonicsXX[256] = {
/* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */ /* 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */
"NOP", "LD BC,#h", "LD (BC),A", "INC BC", "INC B", "DEC B", "LD B,*h", "RLCA", /* 00-07 */ "NOP", "LD BC,#h", "LD (BC),A", "INC BC", "INC B", "DEC B", "LD B,*h", "RLCA", /* 00-07 */
"EX AF,AF'", "ADD I%,BC", "LD A,(BC)", "DEC BC", "INC C", "DEC C", "LD C,*h", "RRCA", /* 08-0f */ "EX AF,AF'", "ADD I%,BC", "LD A,(BC)", "DEC BC", "INC C", "DEC C", "LD C,*h", "RRCA", /* 08-0f */
@ -315,7 +314,7 @@ static char *const MnemonicsXX[256] = {
"RET M", "LD SP,I%", "JP M,#h", "EI", "CALL M,#h", "PFX_FD", "CP *h", "RST 38h" /* f8-ff */ "RET M", "LD SP,I%", "JP M,#h", "EI", "CALL M,#h", "PFX_FD", "CP *h", "RST 38h" /* f8-ff */
}; };
static char *const MnemonicsXCB[256] = { static const char *const MnemonicsXCB[256] = {
/*0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */ /*0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F */
"RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (I%@h)", "RLC A", /* 00-07 */ "RLC B", "RLC C", "RLC D", "RLC E", "RLC H", "RLC L", "RLC (I%@h)", "RLC A", /* 00-07 */
"RRC B", "RRC C", "RRC D", "RRC E", "RRC H", "RRC L", "RRC (I%@h)", "RRC A", /* 08-0f */ "RRC B", "RRC C", "RRC D", "RRC E", "RRC H", "RRC L", "RRC (I%@h)", "RRC A", /* 08-0f */
@ -386,7 +385,8 @@ static void printHex4(char* string, const uint32 value) {
*/ */
static int32 DAsm(char *S, const uint32 *val, const int32 useZ80Mnemonics, const int32 addr) { static int32 DAsm(char *S, const uint32 *val, const int32 useZ80Mnemonics, const int32 addr) {
char R[128], H[10], C = '\0', *T, *P; char R[128], H[10], C = '\0', *P;
const char *T, *T1;
uint8 J = 0, Offset = 0; uint8 J = 0, Offset = 0;
uint16 B = 0; uint16 B = 0;
@ -423,12 +423,12 @@ static int32 DAsm(char *S, const uint32 *val, const int32 useZ80Mnemonics, const
else else
T = Mnemonics8080[val[B++]]; T = Mnemonics8080[val[B++]];
if ( (P = strchr(T, '^')) ) { if ( (T1 = strchr(T, '^')) ) {
strncpy(R, T, P - T); strncpy(R, T, T1 - T);
R[P - T] = '\0'; R[T1 - T] = '\0';
printHex2(H, val[B++]); printHex2(H, val[B++]);
strcat(R, H); strcat(R, H);
strcat(R, P + 1); strcat(R, T1 + 1);
} }
else else
strcpy(R, T); strcpy(R, T);
@ -659,7 +659,7 @@ static int32 checkXY(const char xy) {
return xy == 'X' ? 0xdd : 0xfd; /* else is 'Y' */ return xy == 'X' ? 0xdd : 0xfd; /* else is 'Y' */
} }
static int32 parse_X80(const char *cptr, const int32 addr, uint32 *val, char *const Mnemonics[]) { static int32 parse_X80(const char *cptr, const int32 addr, uint32 *val, const char *const Mnemonics[]) {
char xyFirst = 0, xy; char xyFirst = 0, xy;
int32 op, number, star, at, hat, dollar; int32 op, number, star, at, hat, dollar;
for (op = 0; op < 256; op++) { for (op = 0; op < 256; op++) {
@ -784,7 +784,7 @@ static int32 parse_X80(const char *cptr, const int32 addr, uint32 *val, char *co
Outputs: Outputs:
status = error status status = error status
*/ */
t_stat parse_sym(char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) { t_stat parse_sym(CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) {
static t_bool symbolicInputNotImplementedMessage8086 = FALSE; static t_bool symbolicInputNotImplementedMessage8086 = FALSE;
static t_bool symbolicInputNotImplementedMessageM68K = FALSE; static t_bool symbolicInputNotImplementedMessageM68K = FALSE;
if ((sw & (SWMASK('M'))) && (chiptype == CHIP_TYPE_8086)) { if ((sw & (SWMASK('M'))) && (chiptype == CHIP_TYPE_8086)) {
@ -813,7 +813,7 @@ t_stat parse_sym(char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) {
} }
/* Set Memory Base Address routine */ /* Set Memory Base Address routine */
t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc) t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
PNP_INFO *pnp; PNP_INFO *pnp;
@ -853,7 +853,7 @@ t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc)
} }
/* Show Base Address routine */ /* Show Base Address routine */
t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc) t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
PNP_INFO *pnp; PNP_INFO *pnp;
@ -872,7 +872,7 @@ t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc)
} }
/* Set Memory Base Address routine */ /* Set Memory Base Address routine */
t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc) t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
PNP_INFO *pnp; PNP_INFO *pnp;
@ -913,7 +913,7 @@ t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc)
} }
/* Show I/O Base Address routine */ /* Show I/O Base Address routine */
t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc) t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
PNP_INFO *pnp; PNP_INFO *pnp;

View file

@ -1176,7 +1176,7 @@ long disasm (unsigned char *data, char *output, int segsize, long offset)
{ {
struct itemplate **p, **best_p; struct itemplate **p, **best_p;
int length, best_length = 0; int length, best_length = 0;
char *segover; const char *segover;
int rep, lock, asize, osize, i, slen, colon; int rep, lock, asize, osize, i, slen, colon;
unsigned char *origdata; unsigned char *origdata;
int works; int works;

View file

@ -75,11 +75,11 @@ static FW2_INFO *fw2_info[FW2_MAX_BOARDS];
static uint8 port_map[FW2_MAX_BOARDS] = { 0x11, 0x15, 0x17, 0x19 }; static uint8 port_map[FW2_MAX_BOARDS] = { 0x11, 0x15, 0x17, 0x19 };
static int32 fw2dev(const int32 Addr, const int32 rw, const int32 data); static int32 fw2dev(const int32 Addr, const int32 rw, const int32 data);
static t_stat fw2_attach(UNIT *uptr, char *cptr); static t_stat fw2_attach(UNIT *uptr, CONST char *cptr);
static t_stat fw2_detach(UNIT *uptr); static t_stat fw2_detach(UNIT *uptr);
static uint8 FW2_Read(const uint32 Addr); static uint8 FW2_Read(const uint32 Addr);
static uint8 FW2_Write(const uint32 Addr, uint8 cData); static uint8 FW2_Write(const uint32 Addr, uint8 cData);
static t_stat get_base_address(char *cptr, uint32 *baseaddr); static t_stat get_base_address(const char *cptr, uint32 *baseaddr);
static const char* fw2_description(DEVICE *dptr); static const char* fw2_description(DEVICE *dptr);
static UNIT fw2_unit[] = { static UNIT fw2_unit[] = {
@ -115,7 +115,7 @@ DEVICE fw2_dev = {
}; };
/* Attach routine */ /* Attach routine */
static t_stat fw2_attach(UNIT *uptr, char *cptr) static t_stat fw2_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
unsigned int i = 0; unsigned int i = 0;
@ -137,7 +137,7 @@ static t_stat fw2_attach(UNIT *uptr, char *cptr)
} }
} }
fw2_info[i] = calloc(1, sizeof(FW2_INFO)); fw2_info[i] = (FW2_INFO *)calloc(1, sizeof(FW2_INFO));
fw2_info[i]->uptr = uptr; fw2_info[i]->uptr = uptr;
fw2_info[i]->uptr->u3 = baseaddr; fw2_info[i]->uptr->u3 = baseaddr;
@ -197,7 +197,7 @@ static t_stat fw2_detach(UNIT *uptr)
return SCPE_OK; return SCPE_OK;
} }
static t_stat get_base_address(char *cptr, uint32 *baseaddr) static t_stat get_base_address(const char *cptr, uint32 *baseaddr)
{ {
uint32 b; uint32 b;
sscanf(cptr, "%x", &b); sscanf(cptr, "%x", &b);

View file

@ -134,8 +134,8 @@ typedef struct {
static SECTOR_FORMAT sdata; static SECTOR_FORMAT sdata;
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
@ -279,7 +279,7 @@ int32 find_unit_index (UNIT *uptr)
} }
/* Attach routine */ /* Attach routine */
t_stat i8272_attach(UNIT *uptr, char *cptr) t_stat i8272_attach(UNIT *uptr, CONST char *cptr)
{ {
char header[4]; char header[4];
t_stat r; t_stat r;
@ -461,7 +461,7 @@ uint8 I8272_Read(const uint32 Addr)
return (cData); return (cData);
} }
static char *messages[0x20] = { static const char *messages[0x20] = {
/* 0 1 2 3 */ /* 0 1 2 3 */
"Undefined Command 0x0","Undefined Command 0x1","Read Track", "Specify", "Undefined Command 0x0","Undefined Command 0x1","Read Track", "Specify",
/* 4 5 6 7 */ /* 4 5 6 7 */

View file

@ -39,7 +39,7 @@
* * * *
*************************************************************************/ *************************************************************************/
extern t_stat i8272_attach(UNIT *uptr, char *cptr); extern t_stat i8272_attach(UNIT *uptr, CONST char *cptr);
extern t_stat i8272_detach(UNIT *uptr); extern t_stat i8272_detach(UNIT *uptr);
extern uint8 I8272_Set_DMA(const uint32 dma_addr); extern uint8 I8272_Set_DMA(const uint32 dma_addr);
extern uint8 I8272_Read(const uint32 Addr); extern uint8 I8272_Read(const uint32 Addr);

View file

@ -215,7 +215,7 @@ struct pc_env
}; };
/* GLOBAL */ /* GLOBAL */
volatile int intr; extern volatile int intr;
void halt_sys (PC_ENV *sys); void halt_sys (PC_ENV *sys);
void fetch_decode_modrm (PC_ENV *m, uint16 *mod, uint16 *regh, uint16 *regl); void fetch_decode_modrm (PC_ENV *m, uint16 *mod, uint16 *regh, uint16 *regl);

View file

@ -24,6 +24,9 @@
#include "altairz80_defs.h" #include "altairz80_defs.h"
#include "i86.h" #include "i86.h"
/* GLOBAL */
volatile int intr;
extern uint32 GetBYTEExtended(register uint32 Addr); extern uint32 GetBYTEExtended(register uint32 Addr);
extern void PutBYTEExtended(register uint32 Addr, const register uint32 Value); extern void PutBYTEExtended(register uint32 Addr, const register uint32 Value);
extern int32 AX_S; /* AX register (8086) */ extern int32 AX_S; /* AX register (8086) */

View file

@ -4118,7 +4118,7 @@ static void i86op_opcD3_word_RM_CL(PC_ENV *m)
DECODE_CLEAR_SEGOVR(m); DECODE_CLEAR_SEGOVR(m);
} }
static void sys_fatal(int error, char *fmt, ...) static void sys_fatal(int error, const char *fmt, ...)
{ {
va_list p; va_list p;
va_start(p, fmt); va_start(p, fmt);

View file

@ -295,13 +295,13 @@ void m68k_set_context(void* dst);
* You must provide a function pointer of the form: * You must provide a function pointer of the form:
* void save_value(char* identifier, unsigned int value) * void save_value(char* identifier, unsigned int value)
*/ */
void m68k_save_context( void (*save_value)(char* identifier, unsigned int value)); void m68k_save_context( void (*save_value)(const char* identifier, unsigned int value));
/* Load a cpu context from disk. /* Load a cpu context from disk.
* You must provide a function pointer of the form: * You must provide a function pointer of the form:
* unsigned int load_value(char* identifier) * unsigned int load_value(char* identifier)
*/ */
void m68k_load_context(unsigned int (*load_value)(char* identifier)); void m68k_load_context(unsigned int (*load_value)(const char* identifier));

View file

@ -45,7 +45,7 @@ uint m68ki_tracing = 0;
uint m68ki_address_space; uint m68ki_address_space;
#ifdef M68K_LOG_ENABLE #ifdef M68K_LOG_ENABLE
char* m68ki_cpu_names[9] = const char* m68ki_cpu_names[9] =
{ {
"Invalid CPU", "Invalid CPU",
"M68000", "M68000",
@ -799,7 +799,7 @@ void m68k_set_context(void* src)
if(src) m68ki_cpu = *(m68ki_cpu_core*)src; if(src) m68ki_cpu = *(m68ki_cpu_core*)src;
} }
void m68k_save_context( void (*save_value)(char*, unsigned int)) void m68k_save_context( void (*save_value)(const char*, unsigned int))
{ {
if(!save_value) if(!save_value)
return; return;
@ -840,7 +840,7 @@ void m68k_save_context( void (*save_value)(char*, unsigned int))
save_value("PREF_DATA" , CPU_PREF_DATA); save_value("PREF_DATA" , CPU_PREF_DATA);
} }
void m68k_load_context(unsigned int (*load_value)(char*)) void m68k_load_context(unsigned int (*load_value)(const char*))
{ {
unsigned int temp; unsigned int temp;

View file

@ -191,18 +191,18 @@ static uint g_cpu_ir; /* instruction register */
static uint g_cpu_type; static uint g_cpu_type;
/* used by ops like asr, ror, addq, etc */ /* used by ops like asr, ror, addq, etc */
static uint g_3bit_qdata_table[8] = {8, 1, 2, 3, 4, 5, 6, 7}; static const uint g_3bit_qdata_table[8] = {8, 1, 2, 3, 4, 5, 6, 7};
static uint g_5bit_data_table[32] = static const uint g_5bit_data_table[32] =
{ {
32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
}; };
static char* g_cc[16] = static const char* g_cc[16] =
{"t", "f", "hi", "ls", "cc", "cs", "ne", "eq", "vc", "vs", "pl", "mi", "ge", "lt", "gt", "le"}; {"t", "f", "hi", "ls", "cc", "cs", "ne", "eq", "vc", "vs", "pl", "mi", "ge", "lt", "gt", "le"};
static char* g_cpcc[64] = static const char* g_cpcc[64] =
{/* 000 001 010 011 100 101 110 111 */ {/* 000 001 010 011 100 101 110 111 */
"f", "eq", "ogt", "oge", "olt", "ole", "ogl", "or", /* 000 */ "f", "eq", "ogt", "oge", "olt", "ole", "ogl", "or", /* 000 */
"un", "ueq", "ugt", "uge", "ult", "ule", "ne", "t", /* 001 */ "un", "ueq", "ugt", "uge", "ult", "ule", "ne", "t", /* 001 */
@ -1754,8 +1754,8 @@ static void d68000_move_to_usp(void)
static void d68010_movec(void) static void d68010_movec(void)
{ {
uint extension; uint extension;
char* reg_name; const char* reg_name;
char* processor; const char* processor;
LIMIT_CPU_TYPES(M68010_PLUS); LIMIT_CPU_TYPES(M68010_PLUS);
extension = read_imm_16(); extension = read_imm_16();

View file

@ -204,13 +204,13 @@ t_stat m68k_hdsk_boot(const int32 unitno, DEVICE *dptr,
void m68k_CPUToView(void) { void m68k_CPUToView(void) {
uint32 reg; uint32 reg;
for (reg = M68K_REG_D0; reg <= M68K_REG_CPU_TYPE; reg++) for (reg = M68K_REG_D0; reg <= M68K_REG_CPU_TYPE; reg++)
m68k_registers[reg] = m68k_get_reg(NULL, reg); m68k_registers[reg] = m68k_get_reg(NULL, (m68k_register_t)reg);
} }
void m68k_viewToCPU(void) { void m68k_viewToCPU(void) {
uint32 reg; uint32 reg;
for (reg = M68K_REG_D0; reg <= M68K_REG_CPU_TYPE; reg++) for (reg = M68K_REG_D0; reg <= M68K_REG_CPU_TYPE; reg++)
m68k_set_reg(reg, m68k_registers[reg]); m68k_set_reg((m68k_register_t)reg, m68k_registers[reg]);
} }
t_stat sim_instr_m68k(void) { t_stat sim_instr_m68k(void) {

View file

@ -67,8 +67,8 @@
#define VERBOSE_MSG (1 << 5) #define VERBOSE_MSG (1 << 5)
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern int32 find_unit_index(UNIT *uptr); extern int32 find_unit_index(UNIT *uptr);
@ -132,7 +132,7 @@ static SECTOR_FORMAT sdata;
#define MFDC_CAPACITY (77*16*MFDC_SECTOR_LEN) /* Default Micropolis Disk Capacity */ #define MFDC_CAPACITY (77*16*MFDC_SECTOR_LEN) /* Default Micropolis Disk Capacity */
static t_stat mfdc_reset(DEVICE *mfdc_dev); static t_stat mfdc_reset(DEVICE *mfdc_dev);
static t_stat mfdc_attach(UNIT *uptr, char *cptr); static t_stat mfdc_attach(UNIT *uptr, CONST char *cptr);
static t_stat mfdc_detach(UNIT *uptr); static t_stat mfdc_detach(UNIT *uptr);
static uint8 MFDC_Read(const uint32 Addr); static uint8 MFDC_Read(const uint32 Addr);
static uint8 MFDC_Write(const uint32 Addr, uint8 cData); static uint8 MFDC_Write(const uint32 Addr, uint8 cData);
@ -238,7 +238,7 @@ static t_stat mfdc_reset(DEVICE *dptr)
} }
/* Attach routine */ /* Attach routine */
static t_stat mfdc_attach(UNIT *uptr, char *cptr) static t_stat mfdc_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
unsigned int i = 0; unsigned int i = 0;

View file

@ -77,10 +77,10 @@ typedef struct {
static N8VEM_INFO n8vem_info_data = { { 0x0, 0x8000, 0x60, 32 } }; static N8VEM_INFO n8vem_info_data = { { 0x0, 0x8000, 0x60, 32 } };
static N8VEM_INFO *n8vem_info = &n8vem_info_data; static N8VEM_INFO *n8vem_info = &n8vem_info_data;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern uint32 PCX; extern uint32 PCX;
@ -88,7 +88,7 @@ extern int32 find_unit_index (UNIT *uptr);
static t_stat n8vem_reset(DEVICE *n8vem_dev); static t_stat n8vem_reset(DEVICE *n8vem_dev);
static t_stat n8vem_boot(int32 unitno, DEVICE *dptr); static t_stat n8vem_boot(int32 unitno, DEVICE *dptr);
static t_stat n8vem_attach(UNIT *uptr, char *cptr); static t_stat n8vem_attach(UNIT *uptr, CONST char *cptr);
static t_stat n8vem_detach(UNIT *uptr); static t_stat n8vem_detach(UNIT *uptr);
static uint8 N8VEM_Read(const uint32 Addr); static uint8 N8VEM_Read(const uint32 Addr);
@ -190,8 +190,8 @@ static t_stat n8vem_reset(DEVICE *dptr)
return SCPE_ARG; return SCPE_ARG;
} }
n8vem_info->ram = calloc(1, (N8VEM_RAM_SIZE)); n8vem_info->ram = (uint8 *)calloc(1, (N8VEM_RAM_SIZE));
n8vem_info->rom = calloc(1, (N8VEM_ROM_SIZE)); n8vem_info->rom = (uint8 *)calloc(1, (N8VEM_ROM_SIZE));
/* Clear the RAM and ROM mapping registers */ /* Clear the RAM and ROM mapping registers */
n8vem_info->mpcl_ram = 0; n8vem_info->mpcl_ram = 0;
@ -214,7 +214,7 @@ static t_stat n8vem_boot(int32 unitno, DEVICE *dptr)
} }
/* Attach routine */ /* Attach routine */
static t_stat n8vem_attach(UNIT *uptr, char *cptr) static t_stat n8vem_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
int32 i = 0, rtn; int32 i = 0, rtn;

View file

@ -86,10 +86,10 @@ extern WD179X_INFO_PUB *wd179x_infop;
static CROMFDC_INFO cromfdc_info_data = { { 0xC000, CROMFDC_ROM_SIZE, 0x3, 2 } }; static CROMFDC_INFO cromfdc_info_data = { { 0xC000, CROMFDC_ROM_SIZE, 0x3, 2 } };
static CROMFDC_INFO *cromfdc_info = &cromfdc_info_data; static CROMFDC_INFO *cromfdc_info = &cromfdc_info_data;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);

View file

@ -86,10 +86,10 @@ extern WD179X_INFO_PUB *wd179x_infop;
static ADCS6_INFO adcs6_info_data = { { 0xF000, ADCS6_ROM_SIZE, 0x3, 2 } }; static ADCS6_INFO adcs6_info_data = { { 0xF000, ADCS6_ROM_SIZE, 0x3, 2 } };
static ADCS6_INFO *adcs6_info = &adcs6_info_data; static ADCS6_INFO *adcs6_info = &adcs6_info_data;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
@ -105,7 +105,7 @@ extern uint32 PCX; /* external view of PC */
static t_stat adcs6_reset(DEVICE *adcs6_dev); static t_stat adcs6_reset(DEVICE *adcs6_dev);
static t_stat adcs6_boot(int32 unitno, DEVICE *dptr); static t_stat adcs6_boot(int32 unitno, DEVICE *dptr);
static t_stat adcs6_attach(UNIT *uptr, char *cptr); static t_stat adcs6_attach(UNIT *uptr, CONST char *cptr);
static t_stat adcs6_detach(UNIT *uptr); static t_stat adcs6_detach(UNIT *uptr);
static int32 adcs6_dma(const int32 port, const int32 io, const int32 data); static int32 adcs6_dma(const int32 port, const int32 io, const int32 data);
@ -469,7 +469,7 @@ static t_stat adcs6_boot(int32 unitno, DEVICE *dptr)
} }
/* Attach routine */ /* Attach routine */
static t_stat adcs6_attach(UNIT *uptr, char *cptr) static t_stat adcs6_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
r = wd179x_attach(uptr, cptr); r = wd179x_attach(uptr, cptr);

View file

@ -76,10 +76,10 @@ typedef struct {
static DISK1A_INFO disk1a_info_data = { { 0x0, 512, 0xC0, 4 } }; static DISK1A_INFO disk1a_info_data = { { 0x0, 512, 0xC0, 4 } };
static DISK1A_INFO *disk1a_info = &disk1a_info_data; static DISK1A_INFO *disk1a_info = &disk1a_info_data;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
@ -93,7 +93,7 @@ extern uint32 PCX; /* external view of PC */
static t_stat disk1a_reset(DEVICE *disk1a_dev); static t_stat disk1a_reset(DEVICE *disk1a_dev);
static t_stat disk1a_boot(int32 unitno, DEVICE *dptr); static t_stat disk1a_boot(int32 unitno, DEVICE *dptr);
static t_stat disk1a_attach(UNIT *uptr, char *cptr); static t_stat disk1a_attach(UNIT *uptr, CONST char *cptr);
static t_stat disk1a_detach(UNIT *uptr); static t_stat disk1a_detach(UNIT *uptr);
static const char* disk1a_description(DEVICE *dptr); static const char* disk1a_description(DEVICE *dptr);
@ -757,7 +757,7 @@ static t_stat disk1a_boot(int32 unitno, DEVICE *dptr)
} }
/* Attach routine */ /* Attach routine */
static t_stat disk1a_attach(UNIT *uptr, char *cptr) static t_stat disk1a_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
r = i8272_attach(uptr, cptr); r = i8272_attach(uptr, cptr);

View file

@ -118,8 +118,8 @@ static int32 nsectors = C20MB_NSECTORS;
static int32 sectsize = C20MB_SECTSIZE; static int32 sectsize = C20MB_SECTSIZE;
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern int32 selchan_dma(uint8 *buf, uint32 len); extern int32 selchan_dma(uint8 *buf, uint32 len);
@ -131,7 +131,7 @@ extern void raise_ss1_interrupt(uint8 intnum);
#define DISK2_CAPACITY (C20MB_NTRACKS*C20MB_NHEADS*C20MB_NSECTORS*C20MB_SECTSIZE) /* Default Disk Capacity */ #define DISK2_CAPACITY (C20MB_NTRACKS*C20MB_NHEADS*C20MB_NSECTORS*C20MB_SECTSIZE) /* Default Disk Capacity */
static t_stat disk2_reset(DEVICE *disk2_dev); static t_stat disk2_reset(DEVICE *disk2_dev);
static t_stat disk2_attach(UNIT *uptr, char *cptr); static t_stat disk2_attach(UNIT *uptr, CONST char *cptr);
static t_stat disk2_detach(UNIT *uptr); static t_stat disk2_detach(UNIT *uptr);
static const char* disk2_description(DEVICE *dptr); static const char* disk2_description(DEVICE *dptr);
@ -229,7 +229,7 @@ static t_stat disk2_reset(DEVICE *dptr)
/* Attach routine */ /* Attach routine */
static t_stat disk2_attach(UNIT *uptr, char *cptr) static t_stat disk2_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r = SCPE_OK; t_stat r = SCPE_OK;
DISK2_DRIVE_INFO *pDrive; DISK2_DRIVE_INFO *pDrive;

View file

@ -175,8 +175,8 @@ static int32 nsectors = C20MB_NSECTORS;
static int32 sectsize = C20MB_SECTSIZE; static int32 sectsize = C20MB_SECTSIZE;
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern int32 find_unit_index(UNIT *uptr); extern int32 find_unit_index(UNIT *uptr);
@ -191,7 +191,7 @@ extern uint8 GetByteDMA(const uint32 Addr);
#define DISK3_CAPACITY (C20MB_NTRACKS*C20MB_NHEADS*C20MB_NSECTORS*C20MB_SECTSIZE) /* Default Disk Capacity */ #define DISK3_CAPACITY (C20MB_NTRACKS*C20MB_NHEADS*C20MB_NSECTORS*C20MB_SECTSIZE) /* Default Disk Capacity */
static t_stat disk3_reset(DEVICE *disk3_dev); static t_stat disk3_reset(DEVICE *disk3_dev);
static t_stat disk3_attach(UNIT *uptr, char *cptr); static t_stat disk3_attach(UNIT *uptr, CONST char *cptr);
static t_stat disk3_detach(UNIT *uptr); static t_stat disk3_detach(UNIT *uptr);
static void raise_disk3_interrupt(void); static void raise_disk3_interrupt(void);
static const char* disk3_description(DEVICE *dptr); static const char* disk3_description(DEVICE *dptr);
@ -296,7 +296,7 @@ static t_stat disk3_reset(DEVICE *dptr)
/* Attach routine */ /* Attach routine */
static t_stat disk3_attach(UNIT *uptr, char *cptr) static t_stat disk3_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r = SCPE_OK; t_stat r = SCPE_OK;
DISK3_DRIVE_INFO *pDrive; DISK3_DRIVE_INFO *pDrive;
@ -544,7 +544,7 @@ static uint8 DISK3_Write(const uint32 Addr, uint8 cData)
xfr_len = pDrive->xfr_nsects * pDrive->sectsize; xfr_len = pDrive->xfr_nsects * pDrive->sectsize;
dataBuffer = malloc(xfr_len); dataBuffer = (uint8 *)malloc(xfr_len);
sim_fseek((pDrive->uptr)->fileref, file_offset, SEEK_SET); sim_fseek((pDrive->uptr)->fileref, file_offset, SEEK_SET);
@ -620,7 +620,7 @@ static uint8 DISK3_Write(const uint32 Addr, uint8 cData)
file_offset = (pDrive->track * (pDrive->nheads) * data_len); /* Calculate offset based on current track */ file_offset = (pDrive->track * (pDrive->nheads) * data_len); /* Calculate offset based on current track */
file_offset += (disk3_info->iopb[DISK3_IOPB_ARG3] * data_len); file_offset += (disk3_info->iopb[DISK3_IOPB_ARG3] * data_len);
fmtBuffer = malloc(data_len); fmtBuffer = (uint8 *)malloc(data_len);
memset(fmtBuffer, disk3_info->iopb[DISK3_IOPB_ARG2], data_len); memset(fmtBuffer, disk3_info->iopb[DISK3_IOPB_ARG2], data_len);
sim_fseek((pDrive->uptr)->fileref, file_offset, SEEK_SET); sim_fseek((pDrive->uptr)->fileref, file_offset, SEEK_SET);

View file

@ -40,12 +40,12 @@
#define MAX_DSK_SIZE (DSK_TRACSIZE * MAX_TRACKS) #define MAX_DSK_SIZE (DSK_TRACSIZE * MAX_TRACKS)
static t_stat fif_reset(DEVICE *dptr); static t_stat fif_reset(DEVICE *dptr);
static t_stat fif_set_verbose(UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat fif_set_verbose(UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static int32 fif_io(const int32 port, const int32 io, const int32 data); static int32 fif_io(const int32 port, const int32 io, const int32 data);
static const char* fif_description(DEVICE *dptr); static const char* fif_description(DEVICE *dptr);
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern uint8 GetBYTEWrapper(const uint32 Addr); extern uint8 GetBYTEWrapper(const uint32 Addr);
@ -128,7 +128,7 @@ static void resetDSKWarningFlags(void) {
warnDSK11 = 0; warnDSK11 = 0;
} }
static t_stat fif_set_verbose(UNIT *uptr, int32 value, char *cptr, void *desc) { static t_stat fif_set_verbose(UNIT *uptr, int32 value, CONST char *cptr, void *desc) {
resetDSKWarningFlags(); resetDSKWarningFlags();
return SCPE_OK; return SCPE_OK;
} }

View file

@ -95,14 +95,14 @@ static HDC1001_INFO hdc1001_info_data = { { 0x0, 0, 0xC8, 8 } };
static HDC1001_INFO *hdc1001_info = &hdc1001_info_data; static HDC1001_INFO *hdc1001_info = &hdc1001_info_data;
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern int32 find_unit_index(UNIT *uptr); extern int32 find_unit_index(UNIT *uptr);
/* These are needed for DMA. */ /* These are needed for DMA. */
extern void PutBYTEWrapper(const uint32 Addr, const uint32 Value); extern void PutBYTEWrapper(const uint32 Addr, CONST uint32 Value);
extern uint8 GetBYTEWrapper(const uint32 Addr); extern uint8 GetBYTEWrapper(const uint32 Addr);
#define UNIT_V_HDC1001_VERBOSE (UNIT_V_UF + 1) /* verbose mode, i.e. show error messages */ #define UNIT_V_HDC1001_VERBOSE (UNIT_V_UF + 1) /* verbose mode, i.e. show error messages */
@ -110,7 +110,7 @@ extern uint8 GetBYTEWrapper(const uint32 Addr);
#define HDC1001_CAPACITY (77*2*16*256) /* Default Micropolis Disk Capacity */ #define HDC1001_CAPACITY (77*2*16*256) /* Default Micropolis Disk Capacity */
static t_stat hdc1001_reset(DEVICE *hdc1001_dev); static t_stat hdc1001_reset(DEVICE *hdc1001_dev);
static t_stat hdc1001_attach(UNIT *uptr, char *cptr); static t_stat hdc1001_attach(UNIT *uptr, CONST char *cptr);
static t_stat hdc1001_detach(UNIT *uptr); static t_stat hdc1001_detach(UNIT *uptr);
static int32 hdc1001dev(const int32 port, const int32 io, const int32 data); static int32 hdc1001dev(const int32 port, const int32 io, const int32 data);
@ -190,7 +190,7 @@ static t_stat hdc1001_reset(DEVICE *dptr)
/* Attach routine */ /* Attach routine */
static t_stat hdc1001_attach(UNIT *uptr, char *cptr) static t_stat hdc1001_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r = SCPE_OK; t_stat r = SCPE_OK;
HDC1001_DRIVE_INFO *pDrive; HDC1001_DRIVE_INFO *pDrive;

View file

@ -76,8 +76,8 @@ typedef struct {
static IF3_INFO if3_info_data = { { 0x0, 0, 0x10, 8 } }; static IF3_INFO if3_info_data = { { 0x0, 0, 0x10, 8 } };
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern uint32 PCX; extern uint32 PCX;
@ -85,7 +85,7 @@ extern uint32 PCX;
extern int32 sio0d(const int32 port, const int32 io, const int32 data); extern int32 sio0d(const int32 port, const int32 io, const int32 data);
extern int32 sio0s(const int32 port, const int32 io, const int32 data); extern int32 sio0s(const int32 port, const int32 io, const int32 data);
static t_stat set_if3_connect(UNIT *uptr, int32 val, char *cptr, void *desc); static t_stat set_if3_connect(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
static t_stat if3_reset(DEVICE *if3_dev); static t_stat if3_reset(DEVICE *if3_dev);
static t_stat if3_svc (UNIT *uptr); static t_stat if3_svc (UNIT *uptr);
@ -154,7 +154,7 @@ DEVICE if3_dev = {
if3_dt, NULL, NULL, NULL, NULL, NULL, &if3_description if3_dt, NULL, NULL, NULL, NULL, NULL, &if3_description
}; };
static t_stat set_if3_connect(UNIT *uptr, int32 val, char *cptr, void *desc) static t_stat set_if3_connect(UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if(uptr->flags & UNIT_DISABLE) { if(uptr->flags & UNIT_DISABLE) {
sim_debug(ERROR_MSG, &if3_dev, "IF3[%d]: not enabled.\n", uptr->u3); sim_debug(ERROR_MSG, &if3_dev, "IF3[%d]: not enabled.\n", uptr->u3);

View file

@ -72,8 +72,8 @@ static MDRIVEH_INFO mdriveh_info_data = { { 0x0, 0, 0xC6, 2 } };
static MDRIVEH_INFO *mdriveh_info = &mdriveh_info_data; static MDRIVEH_INFO *mdriveh_info = &mdriveh_info_data;
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
@ -179,7 +179,7 @@ static t_stat mdriveh_reset(DEVICE *dptr)
} }
} else { } else {
if(mdriveh_info->storage[i] == NULL) { if(mdriveh_info->storage[i] == NULL) {
mdriveh_info->storage[i] = calloc(1, 524288); mdriveh_info->storage[i] = (uint8 *)calloc(1, 524288);
} }
if (dptr->units[i].flags & UNIT_MDRIVEH_VERBOSE) if (dptr->units[i].flags & UNIT_MDRIVEH_VERBOSE)
sim_printf("MDRIVEH: Unit %d enabled, 512K at 0x%p\n", i, mdriveh_info->storage[i]); sim_printf("MDRIVEH: Unit %d enabled, 512K at 0x%p\n", i, mdriveh_info->storage[i]);

View file

@ -37,8 +37,8 @@
#define WR_DATA_DETAIL_MSG (1 << 7) #define WR_DATA_DETAIL_MSG (1 << 7)
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
@ -148,7 +148,7 @@ static uint32 stepCleared = TRUE; /* true when step bit has returned to zero *
/* Local function prototypes */ /* Local function prototypes */
static t_stat mdsa_reset(DEVICE *mdsa_dev); static t_stat mdsa_reset(DEVICE *mdsa_dev);
static t_stat mdsa_attach(UNIT *uptr, char *cptr); static t_stat mdsa_attach(UNIT *uptr, CONST char *cptr);
static t_stat mdsa_detach(UNIT *uptr); static t_stat mdsa_detach(UNIT *uptr);
static t_stat mdsa_boot(int32 unitno, DEVICE *dptr); static t_stat mdsa_boot(int32 unitno, DEVICE *dptr);
static uint8 MDSA_Read(const uint32 Addr); static uint8 MDSA_Read(const uint32 Addr);
@ -229,7 +229,7 @@ t_stat mdsa_reset(DEVICE *dptr)
} }
/* Attach routine */ /* Attach routine */
t_stat mdsa_attach(UNIT *uptr, char *cptr) t_stat mdsa_attach(UNIT *uptr, CONST char *cptr)
{ {
char header[4]; char header[4];
t_stat r; t_stat r;

View file

@ -66,8 +66,8 @@
#define WR_DATA_DETAIL_MSG (1 << 8) #define WR_DATA_DETAIL_MSG (1 << 8)
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
@ -211,7 +211,7 @@ static SECTOR_FORMAT sdata;
/* Local function prototypes */ /* Local function prototypes */
static t_stat mdsad_reset(DEVICE *mdsad_dev); static t_stat mdsad_reset(DEVICE *mdsad_dev);
static t_stat mdsad_attach(UNIT *uptr, char *cptr); static t_stat mdsad_attach(UNIT *uptr, CONST char *cptr);
static t_stat mdsad_detach(UNIT *uptr); static t_stat mdsad_detach(UNIT *uptr);
static t_stat mdsad_boot(int32 unitno, DEVICE *dptr); static t_stat mdsad_boot(int32 unitno, DEVICE *dptr);
static uint8 MDSAD_Read(const uint32 Addr); static uint8 MDSAD_Read(const uint32 Addr);
@ -293,7 +293,7 @@ static t_stat mdsad_reset(DEVICE *dptr)
} }
/* Attach routine */ /* Attach routine */
static t_stat mdsad_attach(UNIT *uptr, char *cptr) static t_stat mdsad_attach(UNIT *uptr, CONST char *cptr)
{ {
char header[4]; char header[4];
t_stat r; t_stat r;

View file

@ -75,10 +75,10 @@ typedef struct {
static SCP300F_INFO scp300f_info_data = { { 0xFF800, SCP300F_ROM_SIZE, 0xF0, SCP300F_IO_SIZE } }; static SCP300F_INFO scp300f_info_data = { { 0xFF800, SCP300F_ROM_SIZE, 0xF0, SCP300F_IO_SIZE } };
static SCP300F_INFO *scp300f_info = &scp300f_info_data; static SCP300F_INFO *scp300f_info = &scp300f_info_data;
extern t_stat set_membase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_membase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_membase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern uint32 PCX; extern uint32 PCX;

View file

@ -71,8 +71,8 @@ static SELCHAN_INFO selchan_info_data = { { 0x0, 0, 0xF0, 1 } };
static SELCHAN_INFO *selchan_info = &selchan_info_data; static SELCHAN_INFO *selchan_info = &selchan_info_data;
int32 selchan_dma(uint8 *buf, uint32 len); int32 selchan_dma(uint8 *buf, uint32 len);
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern uint32 PCX; extern uint32 PCX;

View file

@ -74,8 +74,8 @@ typedef struct {
static SS1_INFO ss1_info_data = { { 0x0, 0, 0x50, 16 } }; static SS1_INFO ss1_info_data = { { 0x0, 0, 0x50, 16 } };
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern uint32 PCX; extern uint32 PCX;

View file

@ -137,8 +137,8 @@ static const char* vfdhd_description(DEVICE *dptr);
static SECTOR_FORMAT sdata; static SECTOR_FORMAT sdata;
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
@ -147,7 +147,7 @@ extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_typ
#define VFDHD_CAPACITY (77*2*16*256) /* Default Micropolis Disk Capacity */ #define VFDHD_CAPACITY (77*2*16*256) /* Default Micropolis Disk Capacity */
static t_stat vfdhd_reset(DEVICE *vfdhd_dev); static t_stat vfdhd_reset(DEVICE *vfdhd_dev);
static t_stat vfdhd_attach(UNIT *uptr, char *cptr); static t_stat vfdhd_attach(UNIT *uptr, CONST char *cptr);
static t_stat vfdhd_detach(UNIT *uptr); static t_stat vfdhd_detach(UNIT *uptr);
static int32 vfdhddev(const int32 port, const int32 io, const int32 data); static int32 vfdhddev(const int32 port, const int32 io, const int32 data);
@ -227,7 +227,7 @@ static t_stat vfdhd_reset(DEVICE *dptr)
/* Attach routine */ /* Attach routine */
static t_stat vfdhd_attach(UNIT *uptr, char *cptr) static t_stat vfdhd_attach(UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
unsigned int i = 0; unsigned int i = 0;

View file

@ -148,8 +148,8 @@ typedef struct {
static SECTOR_FORMAT sdata; static SECTOR_FORMAT sdata;
extern uint32 PCX; extern uint32 PCX;
extern t_stat set_iobase(UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat set_iobase(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat show_iobase(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type, extern uint32 sim_map_resource(uint32 baseaddr, uint32 size, uint32 resource_type,
int32 (*routine)(const int32, const int32, const int32), uint8 unmap); int32 (*routine)(const int32, const int32, const int32), uint8 unmap);
extern int32 find_unit_index (UNIT *uptr); extern int32 find_unit_index (UNIT *uptr);
@ -310,7 +310,7 @@ void wd179x_external_restore(void)
} }
/* Attach routine */ /* Attach routine */
t_stat wd179x_attach(UNIT *uptr, char *cptr) t_stat wd179x_attach(UNIT *uptr, CONST char *cptr)
{ {
char header[4]; char header[4];
t_stat r; t_stat r;

View file

@ -39,7 +39,7 @@
* * * *
*************************************************************************/ *************************************************************************/
extern t_stat wd179x_attach(UNIT *uptr, char *cptr); extern t_stat wd179x_attach(UNIT *uptr, CONST char *cptr);
extern t_stat wd179x_detach(UNIT *uptr); extern t_stat wd179x_detach(UNIT *uptr);
extern uint8 WD179X_Set_DMA(const uint32 dma_addr); extern uint8 WD179X_Set_DMA(const uint32 dma_addr);
extern uint8 WD179X_Read(const uint32 Addr); extern uint8 WD179X_Read(const uint32 Addr);

View file

@ -195,13 +195,13 @@ t_stat cpu_ex(t_value * vptr, t_addr addr, UNIT * uptr,
t_stat cpu_dep(t_value val, t_addr addr, UNIT * uptr, t_stat cpu_dep(t_value val, t_addr addr, UNIT * uptr,
int32 sw); int32 sw);
t_stat cpu_reset(DEVICE * dptr); t_stat cpu_reset(DEVICE * dptr);
t_stat cpu_set_size(UNIT * uptr, int32 val, char *cptr, t_stat cpu_set_size(UNIT * uptr, int32 val, CONST char *cptr,
void *desc); void *desc);
t_stat cpu_show_size(FILE * st, UNIT * uptr, int32 val, t_stat cpu_show_size(FILE * st, UNIT * uptr, int32 val,
void *desc); CONST void *desc);
t_stat cpu_show_hist(FILE * st, UNIT * uptr, int32 val, t_stat cpu_show_hist(FILE * st, UNIT * uptr, int32 val,
void *desc); CONST void *desc);
t_stat cpu_set_hist(UNIT * uptr, int32 val, char *cptr, t_stat cpu_set_hist(UNIT * uptr, int32 val, CONST char *cptr,
void *desc); void *desc);
t_stat cpu_help(FILE *, DEVICE *, UNIT *, int32, const char *); t_stat cpu_help(FILE *, DEVICE *, UNIT *, int32, const char *);
/* Interval timer */ /* Interval timer */
@ -3818,14 +3818,14 @@ cpu_dep(t_value val, t_addr addr, UNIT * uptr, int32 sw)
} }
t_stat t_stat
cpu_show_size(FILE *st, UNIT *uptr, int32 val, void *desc) cpu_show_size(FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fprintf(st, "%dK", MEMSIZE/1024); fprintf(st, "%dK", MEMSIZE/1024);
return SCPE_OK; return SCPE_OK;
} }
t_stat t_stat
cpu_set_size(UNIT * uptr, int32 val, char *cptr, void *desc) cpu_set_size(UNIT * uptr, int32 val, CONST char *cptr, void *desc)
{ {
t_uint64 mc = 0; t_uint64 mc = 0;
uint32 i; uint32 i;
@ -3852,7 +3852,7 @@ cpu_set_size(UNIT * uptr, int32 val, char *cptr, void *desc)
/* Set history */ /* Set history */
t_stat t_stat
cpu_set_hist(UNIT * uptr, int32 val, char *cptr, void *desc) cpu_set_hist(UNIT * uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 i, lnt; int32 i, lnt;
t_stat r; t_stat r;
@ -3873,7 +3873,7 @@ cpu_set_hist(UNIT * uptr, int32 val, char *cptr, void *desc)
hst = NULL; hst = NULL;
} }
if (lnt) { if (lnt) {
hst = calloc(sizeof(struct InstHistory), lnt); hst = (struct InstHistory *)calloc(sizeof(struct InstHistory), lnt);
if (hst == NULL) if (hst == NULL)
return SCPE_MEM; return SCPE_MEM;
@ -3885,10 +3885,10 @@ cpu_set_hist(UNIT * uptr, int32 val, char *cptr, void *desc)
/* Show history */ /* Show history */
t_stat t_stat
cpu_show_hist(FILE * st, UNIT * uptr, int32 val, void *desc) cpu_show_hist(FILE * st, UNIT * uptr, int32 val, CONST void *desc)
{ {
int32 k, di, lnt; int32 k, di, lnt;
char *cptr = (char *) desc; const char *cptr = (const char *) desc;
t_stat r; t_stat r;
t_value sim_eval; t_value sim_eval;
struct InstHistory *h; struct InstHistory *h;

View file

@ -73,7 +73,7 @@ typedef struct _opcode
{ {
uint16 op; uint16 op;
uint8 type; uint8 type;
char *name; const char *name;
} }
t_opcode; t_opcode;

View file

@ -64,13 +64,13 @@ t_stat dsk_boot(int32, DEVICE *);
t_stat dsk_help (FILE *, DEVICE *, UNIT *, int32, const char *); t_stat dsk_help (FILE *, DEVICE *, UNIT *, int32, const char *);
const char *dsk_description (DEVICE *); const char *dsk_description (DEVICE *);
t_stat esu_srv(UNIT *); t_stat esu_srv(UNIT *);
t_stat esu_attach(UNIT *, char *); t_stat esu_attach(UNIT *, CONST char *);
t_stat esu_detach(UNIT *); t_stat esu_detach(UNIT *);
t_stat esu_help (FILE *, DEVICE *, UNIT *, int32, const char *); t_stat esu_help (FILE *, DEVICE *, UNIT *, int32, const char *);
const char *esu_description (DEVICE *); const char *esu_description (DEVICE *);
uint8 dsk_buffer[NUM_DEVS_DSK][DK_SEC_SIZE]; uint8 dsk_buffer[NUM_DEVS_DSK][DK_SEC_SIZE];
t_stat set_mod(UNIT *uptr, int32 val, char *cptr, t_stat set_mod(UNIT *uptr, int32 val, CONST char *cptr,
void *desc); void *desc);
#define ESU_TYPE UDATA(&esu_srv, UNIT_ATTABLE+UNIT_DISABLE+ \ #define ESU_TYPE UDATA(&esu_srv, UNIT_ATTABLE+UNIT_DISABLE+ \
@ -437,7 +437,7 @@ t_stat esu_srv(UNIT * uptr)
} }
t_stat t_stat
set_mod(UNIT *uptr, int32 val, char *cptr, void *desc) { set_mod(UNIT *uptr, int32 val, CONST char *cptr, void *desc) {
if (uptr == NULL) return SCPE_IERR; if (uptr == NULL) return SCPE_IERR;
if (val == MODIB) if (val == MODIB)
uptr->wait = DK_MAXSEGS2; uptr->wait = DK_MAXSEGS2;
@ -465,7 +465,7 @@ dsk_boot(int32 unit_num, DEVICE * dptr)
t_stat t_stat
esu_attach(UNIT * uptr, char *file) esu_attach(UNIT * uptr, CONST char *file)
{ {
t_stat r; t_stat r;
int u = uptr-esu_unit; int u = uptr-esu_unit;

View file

@ -41,19 +41,19 @@
t_stat drm_srv(UNIT *); t_stat drm_srv(UNIT *);
t_stat drm_boot(int32, DEVICE *); t_stat drm_boot(int32, DEVICE *);
t_stat drm_attach(UNIT *, char *); t_stat drm_attach(UNIT *, CONST char *);
t_stat drm_detach(UNIT *); t_stat drm_detach(UNIT *);
t_stat set_drum(UNIT * uptr, int32 val, char *cptr, t_stat set_drum(UNIT * uptr, int32 val, CONST char *cptr,
void *desc); void *desc);
t_stat set_auxmem(UNIT * uptr, int32 val, char *cptr, t_stat set_auxmem(UNIT * uptr, int32 val, CONST char *cptr,
void *desc); void *desc);
t_stat drm_help (FILE *, DEVICE *, UNIT *, int32, const char *); t_stat drm_help (FILE *, DEVICE *, UNIT *, int32, const char *);
const char *drm_description (DEVICE *); const char *drm_description (DEVICE *);
MTAB drm_mod[] = { MTAB drm_mod[] = {
{AUXMEM, 0, "DRUM", "DRUM", &set_drum, NULL, "Device is drum"}, {AUXMEM, 0, "DRUM", "DRUM", &set_drum, NULL, NULL, "Device is drum"},
{AUXMEM, AUXMEM, "AUXMEM", "AUXMEM", &set_auxmem, NULL, "Device is memory unit"}, {AUXMEM, AUXMEM, "AUXMEM", "AUXMEM", &set_auxmem, NULL, NULL, "Device is memory unit"},
{0} {0}
}; };
@ -171,7 +171,7 @@ drm_boot(int32 unit_num, DEVICE * dptr)
t_stat t_stat
drm_attach(UNIT * uptr, char *file) drm_attach(UNIT * uptr, CONST char *file)
{ {
t_stat r; t_stat r;
int u = uptr - drm_unit; int u = uptr - drm_unit;
@ -203,7 +203,7 @@ drm_detach(UNIT * uptr)
} }
t_stat t_stat
set_drum(UNIT * uptr, int32 val, char *cptr, void *desc) { set_drum(UNIT * uptr, int32 val, CONST char *cptr, void *desc) {
if ((uptr->flags & AUXMEM) == 0) if ((uptr->flags & AUXMEM) == 0)
return SCPE_OK; return SCPE_OK;
if (uptr->flags & UNIT_ATT) if (uptr->flags & UNIT_ATT)
@ -213,7 +213,7 @@ set_drum(UNIT * uptr, int32 val, char *cptr, void *desc) {
} }
t_stat t_stat
set_auxmem(UNIT * uptr, int32 val, char *cptr, void *desc) { set_auxmem(UNIT * uptr, int32 val, CONST char *cptr, void *desc) {
int u = uptr - drm_unit; int u = uptr - drm_unit;
if (uptr->flags & AUXMEM) if (uptr->flags & AUXMEM)

View file

@ -141,13 +141,13 @@
t_stat dtc_srv(UNIT *); t_stat dtc_srv(UNIT *);
t_stat dtco_srv(UNIT *); t_stat dtco_srv(UNIT *);
t_stat dtc_attach(UNIT *, char *); t_stat dtc_attach(UNIT *, CONST char *);
t_stat dtc_detach(UNIT *); t_stat dtc_detach(UNIT *);
t_stat dtc_reset(DEVICE *); t_stat dtc_reset(DEVICE *);
t_stat dtc_setnl (UNIT *, int32, char *, void *); t_stat dtc_setnl (UNIT *, int32, CONST char *, void *);
t_stat dtc_set_log (UNIT *, int32, char *, void *); t_stat dtc_set_log (UNIT *, int32, CONST char *, void *);
t_stat dtc_set_nolog (UNIT *, int32, char *, void *); t_stat dtc_set_nolog (UNIT *, int32, CONST char *, void *);
t_stat dtc_show_log (FILE *, UNIT *, int32, void *); t_stat dtc_show_log (FILE *, UNIT *, int32, CONST void *);
t_stat dtc_help(FILE *, DEVICE *, UNIT *, int32, const char *); t_stat dtc_help(FILE *, DEVICE *, UNIT *, int32, const char *);
t_stat dtc_help_attach (FILE *, DEVICE *, UNIT *, int32, const char *); t_stat dtc_help_attach (FILE *, DEVICE *, UNIT *, int32, const char *);
const char *dtc_description(DEVICE *); const char *dtc_description(DEVICE *);
@ -695,7 +695,7 @@ dtc_reset(DEVICE *dptr) {
/* Attach master unit */ /* Attach master unit */
t_stat t_stat
dtc_attach(UNIT * uptr, char *cptr) dtc_attach(UNIT * uptr, CONST char *cptr)
{ {
int i; int i;
t_stat r; t_stat r;
@ -731,7 +731,7 @@ dtc_detach(UNIT * uptr)
/* SET LINES processor */ /* SET LINES processor */
t_stat dtc_setnl (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dtc_setnl (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 newln, i, t; int32 newln, i, t;
t_stat r; t_stat r;
@ -764,27 +764,26 @@ t_stat dtc_setnl (UNIT *uptr, int32 val, char *cptr, void *desc)
/* SET LOG processor */ /* SET LOG processor */
t_stat dtc_set_log (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dtc_set_log (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
char *tptr;
t_stat r; t_stat r;
char gbuf[CBUFSIZE];
int32 ln; int32 ln;
if (cptr == NULL) if (cptr == NULL)
return SCPE_ARG; return SCPE_ARG;
tptr = strchr (cptr, '='); cptr = get_glyph (cptr, gbuf, '=');
if ((tptr == NULL) || (*tptr == 0)) if ((cptr == NULL) || (*cptr == 0) || (gbuf[0] == 0))
return SCPE_ARG; return SCPE_ARG;
*tptr++ = 0; ln = (int32) get_uint (gbuf, 10, dtc_desc.lines, &r);
ln = (int32) get_uint (cptr, 10, dtc_desc.lines, &r);
if ((r != SCPE_OK) || (ln >= dtc_desc.lines)) if ((r != SCPE_OK) || (ln >= dtc_desc.lines))
return SCPE_ARG; return SCPE_ARG;
return tmxr_set_log (NULL, ln, tptr, desc); return tmxr_set_log (NULL, ln, cptr, desc);
} }
/* SET NOLOG processor */ /* SET NOLOG processor */
t_stat dtc_set_nolog (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dtc_set_nolog (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
t_stat r; t_stat r;
int32 ln; int32 ln;
@ -799,7 +798,7 @@ t_stat dtc_set_nolog (UNIT *uptr, int32 val, char *cptr, void *desc)
/* SHOW LOG processor */ /* SHOW LOG processor */
t_stat dtc_show_log (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat dtc_show_log (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
int32 i; int32 i;
@ -814,7 +813,7 @@ t_stat dtc_show_log (FILE *st, UNIT *uptr, int32 val, void *desc)
/* Show summary processor */ /* Show summary processor */
t_stat t_stat
dtc_summ(FILE * st, UNIT * uptr, int32 val, void *desc) dtc_summ(FILE * st, UNIT * uptr, int32 val, CONST void *desc)
{ {
uint32 i, t; uint32 i, t;
@ -831,7 +830,7 @@ dtc_summ(FILE * st, UNIT * uptr, int32 val, void *desc)
/* SHOW CONN/STAT processor */ /* SHOW CONN/STAT processor */
t_stat t_stat
dtc_show(FILE * st, UNIT * uptr, int32 val, void *desc) dtc_show(FILE * st, UNIT * uptr, int32 val, CONST void *desc)
{ {
int32 i, cc; int32 i, cc;

View file

@ -80,7 +80,7 @@
#define CLR_BUF(u) u->hwmark = 0xFFFFFFFF #define CLR_BUF(u) u->hwmark = 0xFFFFFFFF
t_stat mt_srv(UNIT *); t_stat mt_srv(UNIT *);
t_stat mt_attach(UNIT *, char *); t_stat mt_attach(UNIT *, CONST char *);
t_stat mt_detach(UNIT *); t_stat mt_detach(UNIT *);
t_stat mt_reset(DEVICE *); t_stat mt_reset(DEVICE *);
t_stat mt_help(FILE *, DEVICE *, UNIT *, int32, const char *); t_stat mt_help(FILE *, DEVICE *, UNIT *, int32, const char *);
@ -123,9 +123,9 @@ UNIT mt_unit[] = {
}; };
MTAB mt_mod[] = { MTAB mt_mod[] = {
{MTUF_WLK, 0, "write enabled", "WRITEENABLED", NULL, NULL, {MTUF_WLK, 0, "write enabled", "WRITEENABLED", NULL, NULL, NULL,
"Write ring in place"}, "Write ring in place"},
{MTUF_WLK, MTUF_WLK, "write locked", "LOCKED", NULL, NULL, {MTUF_WLK, MTUF_WLK, "write locked", "LOCKED", NULL, NULL, NULL,
"no Write ring in place"}, "no Write ring in place"},
{MTAB_XTD | MTAB_VUN, 0, "FORMAT", "FORMAT", {MTAB_XTD | MTAB_VUN, 0, "FORMAT", "FORMAT",
&sim_tape_set_fmt, &sim_tape_show_fmt, NULL, &sim_tape_set_fmt, &sim_tape_show_fmt, NULL,
@ -566,7 +566,7 @@ t_stat mt_srv(UNIT * uptr)
t_stat t_stat
mt_attach(UNIT * uptr, char *file) mt_attach(UNIT * uptr, CONST char *file)
{ {
t_stat r; t_stat r;

View file

@ -26,7 +26,7 @@
#include "sim_card.h" #include "sim_card.h"
#include <ctype.h> #include <ctype.h>
t_stat parse_sym(char *cptr, t_addr addr, UNIT * uptr, t_value * val, int32 sw); t_stat parse_sym(CONST char *cptr, t_addr addr, UNIT * uptr, t_value * val, int32 sw);
/* SCP data structures and interface routines /* SCP data structures and interface routines
@ -165,7 +165,7 @@ const char ascii_to_con[128] = {
/* Load a card image file into memory. */ /* Load a card image file into memory. */
t_stat t_stat
sim_load(FILE * fileref, char *cptr, char *fnam, int flag) sim_load(FILE * fileref, CONST char *cptr, CONST char *fnam, int flag)
{ {
/* Currently not implimented until I know format of load files */ /* Currently not implimented until I know format of load files */
return SCPE_NOFNC; return SCPE_NOFNC;
@ -459,7 +459,7 @@ find_opcode(char *op, t_opcode * tab)
*/ */
t_stat t_stat
parse_sym(char *cptr, t_addr addr, UNIT * uptr, t_value * val, int32 sw) parse_sym(CONST char *cptr, t_addr addr, UNIT * uptr, t_value * val, int32 sw)
{ {
int i; int i;
t_value d; t_value d;

View file

@ -85,7 +85,7 @@ DEBTAB cdr_debug[] = {
#if NUM_DEVS_CDR > 0 #if NUM_DEVS_CDR > 0
t_stat cdr_boot(int32, DEVICE *); t_stat cdr_boot(int32, DEVICE *);
t_stat cdr_srv(UNIT *); t_stat cdr_srv(UNIT *);
t_stat cdr_attach(UNIT *, char *); t_stat cdr_attach(UNIT *, CONST char *);
t_stat cdr_detach(UNIT *); t_stat cdr_detach(UNIT *);
t_stat cdr_help(FILE *, DEVICE *, UNIT *, int32, const char *); t_stat cdr_help(FILE *, DEVICE *, UNIT *, int32, const char *);
const char *cdr_description(DEVICE *dptr); const char *cdr_description(DEVICE *dptr);
@ -93,7 +93,7 @@ const char *cdr_description(DEVICE *dptr);
#if NUM_DEVS_CDP > 0 #if NUM_DEVS_CDP > 0
t_stat cdp_srv(UNIT *); t_stat cdp_srv(UNIT *);
t_stat cdp_attach(UNIT *, char *); t_stat cdp_attach(UNIT *, CONST char *);
t_stat cdp_detach(UNIT *); t_stat cdp_detach(UNIT *);
t_stat cdp_help(FILE *, DEVICE *, UNIT *, int32, const char *); t_stat cdp_help(FILE *, DEVICE *, UNIT *, int32, const char *);
const char *cdp_description(DEVICE *dptr); const char *cdp_description(DEVICE *dptr);
@ -107,10 +107,10 @@ struct _lpr_data
lpr_data[NUM_DEVS_LPR]; lpr_data[NUM_DEVS_LPR];
t_stat lpr_srv(UNIT *); t_stat lpr_srv(UNIT *);
t_stat lpr_attach(UNIT *, char *); t_stat lpr_attach(UNIT *, CONST char *);
t_stat lpr_detach(UNIT *); t_stat lpr_detach(UNIT *);
t_stat lpr_setlpp(UNIT *, int32, char *, void *); t_stat lpr_setlpp(UNIT *, int32, CONST char *, void *);
t_stat lpr_getlpp(FILE *, UNIT *, int32, void *); t_stat lpr_getlpp(FILE *, UNIT *, int32, CONST void *);
t_stat lpr_help(FILE *, DEVICE *, UNIT *, int32, const char *); t_stat lpr_help(FILE *, DEVICE *, UNIT *, int32, const char *);
const char *lpr_description(DEVICE *dptr); const char *lpr_description(DEVICE *dptr);
#endif #endif
@ -126,7 +126,7 @@ con_data[NUM_DEVS_CON];
t_stat con_ini(DEVICE *); t_stat con_ini(DEVICE *);
t_stat con_srv(UNIT *); t_stat con_srv(UNIT *);
t_stat con_attach(UNIT *, char *); t_stat con_attach(UNIT *, CONST char *);
t_stat con_detach(UNIT *); t_stat con_detach(UNIT *);
t_stat con_help(FILE *, DEVICE *, UNIT *, int32, const char *); t_stat con_help(FILE *, DEVICE *, UNIT *, int32, const char *);
const char *con_description(DEVICE *dptr); const char *con_description(DEVICE *dptr);
@ -146,7 +146,7 @@ MTAB cdr_mod[] = {
{MTAB_XTD | MTAB_VUN, 0, "FORMAT", "FORMAT", {MTAB_XTD | MTAB_VUN, 0, "FORMAT", "FORMAT",
&sim_card_set_fmt, &sim_card_show_fmt, NULL, &sim_card_set_fmt, &sim_card_show_fmt, NULL,
"Sets card format"}, "Sets card format"},
{MODE_EOF, MODE_EOF, "EOF", "EOF", NULL, NULL, {MODE_EOF, MODE_EOF, "EOF", "EOF", NULL, NULL, NULL,
"Causes EOF to be set when reader empty"}, "Causes EOF to be set when reader empty"},
{0} {0}
}; };
@ -420,7 +420,7 @@ cdr_boot(int32 unit_num, DEVICE * dptr)
} }
t_stat t_stat
cdr_attach(UNIT * uptr, char *file) cdr_attach(UNIT * uptr, CONST char *file)
{ {
t_stat r; t_stat r;
int u = uptr-cdr_unit; int u = uptr-cdr_unit;
@ -523,7 +523,7 @@ cdp_srv(UNIT *uptr) {
t_stat t_stat
cdp_attach(UNIT * uptr, char *file) cdp_attach(UNIT * uptr, CONST char *file)
{ {
t_stat r; t_stat r;
@ -568,7 +568,7 @@ cdp_description(DEVICE *dptr)
#if NUM_DEVS_LPR > 0 #if NUM_DEVS_LPR > 0
t_stat t_stat
lpr_setlpp(UNIT *uptr, int32 val, char *cptr, void *desc) lpr_setlpp(UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int i; int i;
if (cptr == NULL) if (cptr == NULL)
@ -589,7 +589,7 @@ lpr_setlpp(UNIT *uptr, int32 val, char *cptr, void *desc)
} }
t_stat t_stat
lpr_getlpp(FILE *st, UNIT *uptr, int32 v, void *desc) lpr_getlpp(FILE *st, UNIT *uptr, int32 v, CONST void *desc)
{ {
if (uptr == NULL) if (uptr == NULL)
return SCPE_IERR; return SCPE_IERR;
@ -791,7 +791,7 @@ lpr_srv(UNIT *uptr) {
} }
t_stat t_stat
lpr_attach(UNIT * uptr, char *file) lpr_attach(UNIT * uptr, CONST char *file)
{ {
t_stat r; t_stat r;
int u = (uptr - lpr_unit); int u = (uptr - lpr_unit);

View file

@ -332,7 +332,7 @@ const uint8 sim_parity_table[64] = {
struct card_formats { struct card_formats {
uint32 mode; uint32 mode;
char *name; const char *name;
}; };
static struct card_formats fmts[] = { static struct card_formats fmts[] = {
@ -459,7 +459,7 @@ sim_hol_to_ebcdic(uint16 hol) {
static int cmpcard(char *p, char *s) { static int cmpcard(const char *p, const char *s) {
int i; int i;
if (p[0] != '~') if (p[0] != '~')
return 0; return 0;
@ -904,7 +904,7 @@ sim_punch_card(UNIT * uptr, UNIT *stkuptr)
} }
/* Set card format */ /* Set card format */
t_stat sim_card_set_fmt (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat sim_card_set_fmt (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int f; int f;
@ -921,7 +921,7 @@ t_stat sim_card_set_fmt (UNIT *uptr, int32 val, char *cptr, void *desc)
/* Show card format */ /* Show card format */
t_stat sim_card_show_fmt (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat sim_card_show_fmt (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
int f; int f;
@ -937,7 +937,7 @@ t_stat sim_card_show_fmt (FILE *st, UNIT *uptr, int32 val, void *desc)
t_stat t_stat
sim_card_attach(UNIT * uptr, char *cptr) sim_card_attach(UNIT * uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
struct _card_data *data; struct _card_data *data;

View file

@ -91,7 +91,7 @@ struct _card_data
t_stat sim_read_card(UNIT * uptr); t_stat sim_read_card(UNIT * uptr);
int sim_card_eof(UNIT * uptr); int sim_card_eof(UNIT * uptr);
t_stat sim_punch_card(UNIT * uptr, UNIT *stkptr); t_stat sim_punch_card(UNIT * uptr, UNIT *stkptr);
t_stat sim_card_attach(UNIT * uptr, char *file); t_stat sim_card_attach(UNIT * uptr, CONST char *file);
t_stat sim_card_detach(UNIT *uptr); t_stat sim_card_detach(UNIT *uptr);
/* Conversion routines to save code */ /* Conversion routines to save code */
@ -101,13 +101,13 @@ uint8 sim_hol_to_bcd(uint16 hol);
uint8 sim_hol_to_ebbcd(uint16 hol); uint8 sim_hol_to_ebbcd(uint16 hol);
/* Format control routines. */ /* Format control routines. */
t_stat sim_card_set_fmt (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat sim_card_set_fmt (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat sim_card_show_fmt (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat sim_card_show_fmt (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* Help information */ /* Help information */
t_stat sim_card_attach_help(FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr); t_stat sim_card_attach_help(FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
/* Translation tables */ /* Translation tables */
const char sim_six_to_ascii[64]; extern const char sim_six_to_ascii[64];
const char sim_ascii_to_six[128]; extern const char sim_ascii_to_six[128];
const uint8 sim_parity_table[64]; extern const uint8 sim_parity_table[64];

View file

@ -91,9 +91,9 @@ jmp_buf cpu_halt;
t_stat cpu_examine (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_examine (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_deposit (t_value val, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_deposit (t_value val, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_reset (DEVICE *dptr); t_stat cpu_reset (DEVICE *dptr);
t_stat cpu_req (UNIT *u, int32 val, char *cptr, void *desc); t_stat cpu_req (UNIT *u, int32 val, CONST char *cptr, void *desc);
t_stat cpu_set_pult (UNIT *u, int32 val, char *cptr, void *desc); t_stat cpu_set_pult (UNIT *u, int32 val, CONST char *cptr, void *desc);
t_stat cpu_show_pult (FILE *st, UNIT *up, int32 v, void *dp); t_stat cpu_show_pult (FILE *st, UNIT *up, int32 v, CONST void *dp);
/* /*
@ -392,7 +392,7 @@ t_stat cpu_reset (DEVICE *dptr)
/* /*
* Request routine * Request routine
*/ */
t_stat cpu_req (UNIT *u, int32 val, char *cptr, void *desc) t_stat cpu_req (UNIT *u, int32 val, CONST char *cptr, void *desc)
{ {
GRP |= GRP_PANEL_REQ; GRP |= GRP_PANEL_REQ;
return SCPE_OK; return SCPE_OK;
@ -401,7 +401,7 @@ t_stat cpu_req (UNIT *u, int32 val, char *cptr, void *desc)
/* /*
* Hardwired program selector validation * Hardwired program selector validation
*/ */
t_stat cpu_set_pult (UNIT *u, int32 val, char *cptr, void *desc) t_stat cpu_set_pult (UNIT *u, int32 val, CONST char *cptr, void *desc)
{ {
int sw; int sw;
if (cptr) sw = atoi(cptr); else sw = 0; if (cptr) sw = atoi(cptr); else sw = 0;
@ -417,7 +417,7 @@ t_stat cpu_set_pult (UNIT *u, int32 val, char *cptr, void *desc)
return SCPE_ARG; return SCPE_ARG;
} }
t_stat cpu_show_pult (FILE *st, UNIT *up, int32 v, void *dp) t_stat cpu_show_pult (FILE *st, UNIT *up, int32 v, CONST void *dp)
{ {
fprintf(st, "Pult packet switch position is %d", pult_packet_switch); fprintf(st, "Pult packet switch position is %d", pult_packet_switch);
return SCPE_OK; return SCPE_OK;

View file

@ -358,9 +358,9 @@ void besm6_debug (const char *fmt, ...);
t_stat fprint_sym (FILE *of, t_addr addr, t_value *val, t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
UNIT *uptr, int32 sw); UNIT *uptr, int32 sw);
void besm6_draw_panel (int force); void besm6_draw_panel (int force);
t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc); t_stat besm6_init_panel (UNIT *u, int32 val, CONST char *cptr, void *desc);
t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc); t_stat besm6_close_panel (UNIT *u, int32 val, CONST char *cptr, void *desc);
t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, void *dp); t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, CONST void *dp);
/* /*
* Арифметика. * Арифметика.

View file

@ -123,7 +123,7 @@ MTAB disk_mod[] = {
}; };
t_stat disk_reset (DEVICE *dptr); t_stat disk_reset (DEVICE *dptr);
t_stat disk_attach (UNIT *uptr, char *cptr); t_stat disk_attach (UNIT *uptr, CONST char *cptr);
t_stat disk_detach (UNIT *uptr); t_stat disk_detach (UNIT *uptr);
DEVICE disk_dev = { DEVICE disk_dev = {
@ -163,7 +163,7 @@ t_stat disk_reset (DEVICE *dptr)
return SCPE_OK; return SCPE_OK;
} }
t_stat disk_attach (UNIT *u, char *cptr) t_stat disk_attach (UNIT *u, CONST char *cptr)
{ {
t_stat s; t_stat s;
int32 saved_switches = sim_switches; int32 saved_switches = sim_switches;
@ -174,7 +174,7 @@ t_stat disk_attach (UNIT *u, char *cptr)
if ((s == SCPE_OK) && (sim_switches & SWMASK ('N'))) { if ((s == SCPE_OK) && (sim_switches & SWMASK ('N'))) {
t_value control[4]; /* block (zone) number, key, userid, checksum */ t_value control[4]; /* block (zone) number, key, userid, checksum */
int diskno, blkno, word; int diskno, blkno, word;
char *pos; const char *pos;
/* Using the rightmost sequence of digits within the filename /* Using the rightmost sequence of digits within the filename
* as a volume number, e.g. "/var/tmp/besm6/2052.bin" -> 2052 * as a volume number, e.g. "/var/tmp/besm6/2052.bin" -> 2052
*/ */

View file

@ -82,7 +82,7 @@ MTAB drum_mod[] = {
}; };
t_stat drum_reset (DEVICE *dptr); t_stat drum_reset (DEVICE *dptr);
t_stat drum_attach (UNIT *uptr, char *cptr); t_stat drum_attach (UNIT *uptr, CONST char *cptr);
t_stat drum_detach (UNIT *uptr); t_stat drum_detach (UNIT *uptr);
DEVICE drum_dev = { DEVICE drum_dev = {
@ -107,7 +107,7 @@ t_stat drum_reset (DEVICE *dptr)
return SCPE_OK; return SCPE_OK;
} }
t_stat drum_attach (UNIT *u, char *cptr) t_stat drum_attach (UNIT *u, CONST char *cptr)
{ {
t_stat s; t_stat s;

View file

@ -429,7 +429,7 @@ static void draw_brz_static (int left, int top)
/* /*
* Closing the graphical window. * Closing the graphical window.
*/ */
t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc) t_stat besm6_close_panel (UNIT *u, int32 val, CONST char *cptr, void *desc)
{ {
if (! screen) if (! screen)
return SCPE_NOTATT; return SCPE_NOTATT;
@ -441,7 +441,7 @@ t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, void *dp) t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, CONST void *dp)
{ {
if (screen) if (screen)
fprintf(st, "Panel displayed"); fprintf(st, "Panel displayed");
@ -459,7 +459,7 @@ static SDL_Texture *sdlTexture;
/* /*
* Initializing of the graphical window and the fonts. * Initializing of the graphical window and the fonts.
*/ */
t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc) t_stat besm6_init_panel (UNIT *u, int32 val, CONST char *cptr, void *desc)
{ {
if (screen) if (screen)
return SCPE_ALATT; return SCPE_ALATT;
@ -678,17 +678,17 @@ void besm6_draw_panel (int force)
#endif /* SDL_MAJOR_VERSION */ #endif /* SDL_MAJOR_VERSION */
#else /* HAVE_LIBSDL */ #else /* HAVE_LIBSDL */
t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc) t_stat besm6_init_panel (UNIT *u, int32 val, CONST char *cptr, void *desc)
{ {
return sim_messagef(SCPE_OPENERR, "Need SDL and SDLttf libraries"); return sim_messagef(SCPE_OPENERR, "Need SDL and SDLttf libraries");
} }
t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc) t_stat besm6_close_panel (UNIT *u, int32 val, CONST char *cptr, void *desc)
{ {
return SCPE_NOTATT; return SCPE_NOTATT;
} }
t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, void *dp) t_stat besm6_show_panel (FILE *st, UNIT *up, int32 v, CONST void *dp)
{ {
return SCPE_NOTATT; return SCPE_NOTATT;
} }

View file

@ -74,7 +74,7 @@ MTAB printer_mod[] = {
}; };
t_stat printer_reset (DEVICE *dptr); t_stat printer_reset (DEVICE *dptr);
t_stat printer_attach (UNIT *uptr, char *cptr); t_stat printer_attach (UNIT *uptr, CONST char *cptr);
t_stat printer_detach (UNIT *uptr); t_stat printer_detach (UNIT *uptr);
DEVICE printer_dev = { DEVICE printer_dev = {
@ -101,7 +101,7 @@ t_stat printer_reset (DEVICE *dptr)
return SCPE_OK; return SCPE_OK;
} }
t_stat printer_attach (UNIT *u, char *cptr) t_stat printer_attach (UNIT *u, CONST char *cptr)
{ {
t_stat s; t_stat s;
int num = u - printer_unit; int num = u - printer_unit;

View file

@ -75,7 +75,7 @@ MTAB fs_mod[] = {
}; };
t_stat fs_reset (DEVICE *dptr); t_stat fs_reset (DEVICE *dptr);
t_stat fs_attach (UNIT *uptr, char *cptr); t_stat fs_attach (UNIT *uptr, CONST char *cptr);
t_stat fs_detach (UNIT *uptr); t_stat fs_detach (UNIT *uptr);
DEVICE fs_dev = { DEVICE fs_dev = {
@ -123,7 +123,7 @@ t_stat fs_reset (DEVICE *dptr)
* Attaches a raw binary file by default, * Attaches a raw binary file by default,
* with a -t switch attaches a prepared text file in UTF-8. * with a -t switch attaches a prepared text file in UTF-8.
*/ */
t_stat fs_attach (UNIT *u, char *cptr) t_stat fs_attach (UNIT *u, CONST char *cptr)
{ {
t_stat s; t_stat s;
int num = u - fs_unit; int num = u - fs_unit;

View file

@ -239,7 +239,7 @@ double besm6_to_ieee (t_value word)
/* /*
* Пропуск пробелов. * Пропуск пробелов.
*/ */
char *skip_spaces (char *p) CONST char *skip_spaces (CONST char *p)
{ {
for (;;) { for (;;) {
if (*p == (char) 0xEF && p[1] == (char) 0xBB && p[2] == (char) 0xBF) { if (*p == (char) 0xEF && p[1] == (char) 0xBB && p[2] == (char) 0xBF) {
@ -259,7 +259,7 @@ char *skip_spaces (char *p)
* Fetch Unicode symbol from UTF-8 string. * Fetch Unicode symbol from UTF-8 string.
* Advance string pointer. * Advance string pointer.
*/ */
int utf8_to_unicode (char **p) int utf8_to_unicode (CONST char **p)
{ {
int c1, c2, c3; int c1, c2, c3;
@ -273,7 +273,7 @@ int utf8_to_unicode (char **p)
return (c1 & 0x0f) << 12 | (c2 & 0x3f) << 6 | (c3 & 0x3f); return (c1 & 0x0f) << 12 | (c2 & 0x3f) << 6 | (c3 & 0x3f);
} }
char *besm6_parse_octal (char *cptr, int *offset) char *besm6_parse_octal (const char *cptr, int *offset)
{ {
char *eptr; char *eptr;
@ -283,7 +283,7 @@ char *besm6_parse_octal (char *cptr, int *offset)
return eptr; return eptr;
} }
static char *get_alnum (char *iptr, char *optr) static CONST char *get_alnum (CONST char *iptr, char *optr)
{ {
while ((*iptr >= 'a' && *iptr<='z') || while ((*iptr >= 'a' && *iptr<='z') ||
(*iptr >= 'A' && *iptr<='Z') || (*iptr >= 'A' && *iptr<='Z') ||
@ -298,7 +298,7 @@ static char *get_alnum (char *iptr, char *optr)
* Parse single instruction (half word). * Parse single instruction (half word).
* Allow mnemonics or octal code. * Allow mnemonics or octal code.
*/ */
char *parse_instruction (char *cptr, uint32 *val) CONST char *parse_instruction (CONST char *cptr, uint32 *val)
{ {
int opcode, reg, addr, negate; int opcode, reg, addr, negate;
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
@ -391,7 +391,7 @@ char *parse_instruction (char *cptr, uint32 *val)
/* /*
* Instruction parse: two commands per word. * Instruction parse: two commands per word.
*/ */
t_stat parse_instruction_word (char *cptr, t_value *val) t_stat parse_instruction_word (CONST char *cptr, t_value *val)
{ {
uint32 left, right; uint32 left, right;
@ -535,7 +535,7 @@ t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
* Outputs: * Outputs:
* status = error status * status = error status
*/ */
t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
{ {
int32 i; int32 i;
@ -569,7 +569,8 @@ t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
*/ */
t_stat besm6_read_line (FILE *input, int *type, t_value *val) t_stat besm6_read_line (FILE *input, int *type, t_value *val)
{ {
char buf [512], *p; char buf [512];
CONST char *p;
int i, c; int i, c;
again: again:
if (! fgets (buf, sizeof (buf), input)) { if (! fgets (buf, sizeof (buf), input)) {
@ -685,7 +686,7 @@ t_stat besm6_load (FILE *input)
/* /*
* Dump memory to file. * Dump memory to file.
*/ */
t_stat besm6_dump (FILE *of, char *fnam) t_stat besm6_dump (FILE *of, const char *fnam)
{ {
int addr, last_addr = -1; int addr, last_addr = -1;
t_value word; t_value word;
@ -728,7 +729,7 @@ t_stat besm6_dump (FILE *of, char *fnam)
/* /*
* Loader/dumper * Loader/dumper
*/ */
t_stat sim_load (FILE *fi, char *cptr, char *fnam, int dump_flag) t_stat sim_load (FILE *fi, CONST char *cptr, CONST char *fnam, int dump_flag)
{ {
if (dump_flag) if (dump_flag)
return besm6_dump (fi, fnam); return besm6_dump (fi, fnam);

View file

@ -94,7 +94,7 @@ char *vt_cptr [LINES_MAX+1];
void tt_print(); void tt_print();
void consul_receive(); void consul_receive();
t_stat vt_clk(UNIT *); t_stat vt_clk(UNIT *);
extern char *get_sim_sw (char *cptr); extern const char *get_sim_sw (const char *cptr);
extern int32 tmr_poll; /* calibrated clock timer poll */ extern int32 tmr_poll; /* calibrated clock timer poll */
int attached_console; int attached_console;
@ -260,7 +260,7 @@ t_stat vt_clk (UNIT * this)
return sim_activate(this, 1000*MSEC/300); return sim_activate(this, 1000*MSEC/300);
} }
t_stat tty_setmode (UNIT *u, int32 val, char *cptr, void *desc) t_stat tty_setmode (UNIT *u, int32 val, CONST char *cptr, void *desc)
{ {
int num = u - tty_unit; int num = u - tty_unit;
TMLN *t = &tty_line [num]; TMLN *t = &tty_line [num];
@ -315,7 +315,7 @@ t_stat tty_setmode (UNIT *u, int32 val, char *cptr, void *desc)
* attach tty <port> * attach tty <port>
* Where <port> is the port number for telnet, e.g. 4199. * Where <port> is the port number for telnet, e.g. 4199.
*/ */
t_stat tty_attach (UNIT *u, char *cptr) t_stat tty_attach (UNIT *u, CONST char *cptr)
{ {
int num = u - tty_unit; int num = u - tty_unit;
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
@ -462,7 +462,7 @@ void vt_puts (int num, const char *s)
return; return;
if (t->rcve) { if (t->rcve) {
/* A telnet connection. */ /* A telnet connection. */
tmxr_linemsg (t, (char*) s); tmxr_linemsg (t, s);
} else { } else {
/* Console output. */ /* Console output. */
while (*s) sim_putchar(*s++); while (*s) sim_putchar(*s++);
@ -686,12 +686,12 @@ static int unicode_to_koi7 (unsigned val)
/* /*
* Set command * Set command
*/ */
static t_stat cmd_set (int32 num, char *cptr) static t_stat cmd_set (int32 num, CONST char *cptr)
{ {
char gbuf [CBUFSIZE]; char gbuf [CBUFSIZE];
int len; int len;
cptr = get_sim_sw (cptr); cptr = (CONST char *)get_sim_sw (cptr);
if (! cptr) if (! cptr)
return SCPE_INVSW; return SCPE_INVSW;
if (! *cptr) if (! *cptr)
@ -734,14 +734,14 @@ static t_stat cmd_set (int32 num, char *cptr)
/* /*
* Show command * Show command
*/ */
static t_stat cmd_show (int32 num, char *cptr) static t_stat cmd_show (int32 num, CONST char *cptr)
{ {
TMLN *t = &tty_line [num]; TMLN *t = &tty_line [num];
char gbuf [CBUFSIZE]; char gbuf [CBUFSIZE];
MTAB *m; MTAB *m;
int len; int len;
cptr = get_sim_sw (cptr); cptr = (CONST char *)get_sim_sw (cptr);
if (! cptr) if (! cptr)
return SCPE_INVSW; return SCPE_INVSW;
if (! *cptr) { if (! *cptr) {
@ -779,12 +779,12 @@ static t_stat cmd_show (int32 num, char *cptr)
/* /*
* Exit command * Exit command
*/ */
static t_stat cmd_exit (int32 num, char *cptr) static t_stat cmd_exit (int32 num, CONST char *cptr)
{ {
return SCPE_EXIT; return SCPE_EXIT;
} }
static t_stat cmd_help (int32 num, char *cptr); static t_stat cmd_help (int32 num, CONST char *cptr);
static CTAB cmd_table[] = { static CTAB cmd_table[] = {
{ "SET", &cmd_set, 0, { "SET", &cmd_set, 0,
@ -834,13 +834,13 @@ static CTAB *lookup_cmd (char *command)
/* /*
* Help command * Help command
*/ */
static t_stat cmd_help (int32 num, char *cptr) static t_stat cmd_help (int32 num, CONST char *cptr)
{ {
TMLN *t = &tty_line [num]; TMLN *t = &tty_line [num];
char gbuf [CBUFSIZE]; char gbuf [CBUFSIZE];
CTAB *c; CTAB *c;
cptr = get_sim_sw (cptr); cptr = (CONST char *)get_sim_sw (cptr);
if (! cptr) if (! cptr)
return SCPE_INVSW; return SCPE_INVSW;
if (! *cptr) { if (! *cptr) {
@ -868,7 +868,8 @@ static t_stat cmd_help (int32 num, char *cptr)
void vt_cmd_exec (int num) void vt_cmd_exec (int num)
{ {
TMLN *t = &tty_line [num]; TMLN *t = &tty_line [num];
char *cptr, gbuf [CBUFSIZE]; char gbuf [CBUFSIZE];
CONST char *cptr;
CTAB *cmdp; CTAB *cmdp;
t_stat err; t_stat err;
extern char *scp_errors[]; extern char *scp_errors[];

View file

@ -190,7 +190,7 @@ REG *scq_r = NULL; /* PC queue reg ptr */
t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_reset (DEVICE *dptr); t_stat cpu_reset (DEVICE *dptr);
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat bus_op (uint32 src, uint32 op, uint32 dst); t_stat bus_op (uint32 src, uint32 op, uint32 dst);
/* Dispatch tables for source, dest, function out, skip on function */ /* Dispatch tables for source, dest, function out, skip on function */
@ -1087,7 +1087,7 @@ M[addr] = val & DMASK;
return SCPE_OK; return SCPE_OK;
} }
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 mc = 0; int32 mc = 0;
uint32 i; uint32 i;

View file

@ -53,7 +53,7 @@ t_stat tti_svc (UNIT *uhsr);
t_stat tto_svc (UNIT *uhsr); t_stat tto_svc (UNIT *uhsr);
t_stat tti_reset (DEVICE *dhsr); t_stat tti_reset (DEVICE *dhsr);
t_stat tto_reset (DEVICE *dhsr); t_stat tto_reset (DEVICE *dhsr);
t_stat tty_set_mode (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat tty_set_mode (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat hsr_svc (UNIT *uhsr); t_stat hsr_svc (UNIT *uhsr);
t_stat hsp_svc (UNIT *uhsr); t_stat hsp_svc (UNIT *uhsr);
t_stat hsr_reset (DEVICE *dhsr); t_stat hsr_reset (DEVICE *dhsr);
@ -295,7 +295,7 @@ sim_cancel (&tto_unit); /* deactivate unit */
return SCPE_OK; return SCPE_OK;
} }
t_stat tty_set_mode (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat tty_set_mode (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
tti_unit.flags = (tti_unit.flags & ~TT_MODE) | val; tti_unit.flags = (tti_unit.flags & ~TT_MODE) | val;
tto_unit.flags = (tto_unit.flags & ~TT_MODE) | val; tto_unit.flags = (tto_unit.flags & ~TT_MODE) | val;

View file

@ -82,7 +82,7 @@ const char *sim_stop_messages[] = {
continue and load all blocks until end of tape. continue and load all blocks until end of tape.
*/ */
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag) t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
{ {
int32 c; int32 c;
uint32 org; uint32 org;
@ -472,7 +472,7 @@ return SCPE_ARG;
get_op get optional bus operator get_op get optional bus operator
*/ */
char *get_fnc (char *cptr, t_value *val) CONST char *get_fnc (CONST char *cptr, t_value *val)
{ {
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
int32 i; int32 i;
@ -509,7 +509,7 @@ val[0] = val[0] | (fncv << I_V_OP); /* store fnc */
return cptr; return cptr;
} }
char *get_ma (char *cptr, t_value *val, char term) CONST char *get_ma (CONST char *cptr, t_value *val, char term)
{ {
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
t_value d; t_value d;
@ -525,7 +525,7 @@ val[1] = d; /* second wd */
return cptr; return cptr;
} }
char *get_sd (char *cptr, t_value *val, char term, t_bool src) CONST char *get_sd (CONST char *cptr, t_value *val, char term, t_bool src)
{ {
char gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
int32 d; int32 d;
@ -546,9 +546,10 @@ val[0] = val[0] | (d << (src? I_V_SRC: I_V_DST)); /* or to inst */
return cptr; return cptr;
} }
char *get_op (char *cptr, t_value *val, char term) CONST char *get_op (CONST char *cptr, t_value *val, char term)
{ {
char gbuf[CBUFSIZE], *tptr; char gbuf[CBUFSIZE];
CONST char *tptr;
int32 i; int32 i;
tptr = get_glyph (cptr, gbuf, term); /* get glyph */ tptr = get_glyph (cptr, gbuf, term); /* get glyph */
@ -573,10 +574,10 @@ return cptr; /* original ptr */
status = error status status = error status
*/ */
t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
{ {
int32 i, j, k; int32 i, j, k;
char *tptr, gbuf[CBUFSIZE]; char gbuf[CBUFSIZE];
while (isspace (*cptr)) cptr++; /* absorb spaces */ while (isspace (*cptr)) cptr++; /* absorb spaces */
if ((sw & SWMASK ('A')) || ((*cptr == '\'') && cptr++)) { /* ASCII char? */ if ((sw & SWMASK ('A')) || ((*cptr == '\'') && cptr++)) { /* ASCII char? */
@ -604,14 +605,11 @@ j = (opc_val[i] >> F_V_FL) & F_M_FL; /* get class */
switch (j) { /* case on class */ switch (j) { /* case on class */
case F_V_FO: /* func out */ case F_V_FO: /* func out */
tptr = strchr (cptr, ','); /* find dst */ cptr = get_glyph (cptr, gbuf, ','); /* fo # */
if (!tptr) /* none? */ if ((!cptr) || (!*cptr)) /* none? */
return SCPE_ARG; return SCPE_ARG;
*tptr = 0; /* split fields */ get_fnc (gbuf, val); /* fo # */
cptr = get_fnc (cptr, val); /* fo # */ cptr = get_sd (cptr, val, 0, FALSE); /* dst */
if (!cptr)
return SCPE_ARG;
cptr = get_sd (tptr + 1, val, 0, FALSE); /* dst */
break; break;
case F_V_FOI: /* func out impl */ case F_V_FOI: /* func out impl */

View file

@ -302,15 +302,15 @@ int32 undio (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_ex (t_value *vptr, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw); t_stat cpu_dep (t_value val, t_addr addr, UNIT *uptr, int32 sw);
t_stat cpu_reset (DEVICE *dptr); t_stat cpu_reset (DEVICE *dptr);
t_stat cpu_set_noext (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_set_noext (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_set_hist (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat cpu_show_dma (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat cpu_show_dma (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat cpu_set_nchan (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_set_nchan (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat cpu_show_nchan (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat cpu_show_nchan (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat cpu_set_interrupts (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat cpu_set_interrupts (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat cpu_show_interrupts (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat cpu_show_interrupts (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
int32 sim_ota_2024 (int32 inst, int32 fnc, int32 dat, int32 dev); int32 sim_ota_2024 (int32 inst, int32 fnc, int32 dat, int32 dev);
int32 cpu_interrupt (int32 vec); int32 cpu_interrupt (int32 vec);
int32 cpu_ext_interrupt (void); int32 cpu_ext_interrupt (void);
@ -1479,14 +1479,14 @@ return SCPE_OK;
/* Option processors */ /* Option processors */
t_stat cpu_set_noext (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_noext (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (MEMSIZE > (NX_AMASK + 1)) if (MEMSIZE > (NX_AMASK + 1))
return SCPE_ARG; return SCPE_ARG;
return SCPE_OK; return SCPE_OK;
} }
t_stat cpu_set_size (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 mc = 0; int32 mc = 0;
uint32 i; uint32 i;
@ -1506,7 +1506,7 @@ return SCPE_OK;
/* [RLA] Set/Show number of interrupts supported */ /* [RLA] Set/Show number of interrupts supported */
t_stat cpu_set_interrupts (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_interrupts (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
uint32 newint; t_stat ret; uint32 newint; t_stat ret;
if (cptr == NULL) return SCPE_ARG; if (cptr == NULL) return SCPE_ARG;
@ -1517,7 +1517,7 @@ t_stat cpu_set_interrupts (UNIT *uptr, int32 val, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat cpu_show_interrupts (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat cpu_show_interrupts (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (ext_ints == 0) if (ext_ints == 0)
fprintf(st,"standard interrupts"); fprintf(st,"standard interrupts");
@ -1526,7 +1526,7 @@ t_stat cpu_show_interrupts (FILE *st, UNIT *uptr, int32 val, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat cpu_set_nchan (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_nchan (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
uint32 i, newmax; uint32 i, newmax;
t_stat r; t_stat r;
@ -1546,7 +1546,7 @@ return SCPE_OK;
/* Show DMA channels */ /* Show DMA channels */
t_stat cpu_show_nchan (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat cpu_show_nchan (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (dma_nch) if (dma_nch)
fprintf (st, "DMA channels = %d", dma_nch); fprintf (st, "DMA channels = %d", dma_nch);
@ -1556,7 +1556,7 @@ return SCPE_OK;
/* Show channel state */ /* Show channel state */
t_stat cpu_show_dma (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat cpu_show_dma (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if ((val < 0) || (val >= DMA_MAX)) if ((val < 0) || (val >= DMA_MAX))
return SCPE_IERR; return SCPE_IERR;
@ -1568,7 +1568,7 @@ return SCPE_OK;
/* Set I/O device to IOBUS / DMA channel / DMC channel */ /* Set I/O device to IOBUS / DMA channel / DMC channel */
t_stat io_set_iobus (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat io_set_iobus (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
DIB *dibp; DIB *dibp;
@ -1585,7 +1585,7 @@ dibp->chan = 0;
return SCPE_OK; return SCPE_OK;
} }
t_stat io_set_dma (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat io_set_dma (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
DIB *dibp; DIB *dibp;
@ -1609,7 +1609,7 @@ dibp->chan = (newc - DMA_MIN) + DMA_V_DMA1 + 1; /* store */
return SCPE_OK; return SCPE_OK;
} }
t_stat io_set_dmc (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat io_set_dmc (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
DIB *dibp; DIB *dibp;
@ -1635,7 +1635,7 @@ return SCPE_OK;
/* Show channel configuration */ /* Show channel configuration */
t_stat io_show_chan (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat io_show_chan (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
DEVICE *dptr; DEVICE *dptr;
DIB *dibp; DIB *dibp;
@ -1722,7 +1722,7 @@ return FALSE;
/* Set history */ /* Set history */
t_stat cpu_set_hist (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat cpu_set_hist (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 i, lnt; int32 i, lnt;
t_stat r; t_stat r;
@ -1753,10 +1753,10 @@ return SCPE_OK;
/* Show history */ /* Show history */
t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
int32 cr, k, di, op, lnt; int32 cr, k, di, op, lnt;
char *cptr = (char *) desc; const char *cptr = (const char *) desc;
t_value sim_eval; t_value sim_eval;
t_stat r; t_stat r;
InstHistory *h; InstHistory *h;

View file

@ -219,9 +219,9 @@ typedef struct h316_dib DIB;
/* Prototypes */ /* Prototypes */
t_stat io_set_iobus (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat io_set_iobus (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat io_set_dma (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat io_set_dma (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat io_set_dmc (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat io_set_dmc (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat io_show_chan (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat io_show_chan (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
#endif #endif

View file

@ -195,7 +195,7 @@
#define CAP_4720 (CYL_4720*SURF_4720*DP_TRKLEN) #define CAP_4720 (CYL_4720*SURF_4720*DP_TRKLEN)
struct drvtyp { struct drvtyp {
char *name; const char *name;
uint32 numu; uint32 numu;
uint32 cyl; uint32 cyl;
uint32 surf; uint32 surf;
@ -247,9 +247,9 @@ uint16 dpxb[DP_TRKLEN]; /* track buffer */
int32 dpio (int32 inst, int32 fnc, int32 dat, int32 dev); int32 dpio (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat dp_svc (UNIT *uptr); t_stat dp_svc (UNIT *uptr);
t_stat dp_reset (DEVICE *dptr); t_stat dp_reset (DEVICE *dptr);
t_stat dp_attach (UNIT *uptr, char *cptr); t_stat dp_attach (UNIT *uptr, CONST char *cptr);
t_stat dp_settype (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat dp_settype (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat dp_go (uint32 dma); t_stat dp_go (uint32 dma);
t_stat dp_go1 (uint32 dat); t_stat dp_go1 (uint32 dat);
t_stat dp_go2 (uint32 dat); t_stat dp_go2 (uint32 dat);
@ -259,8 +259,8 @@ t_bool dp_findrec (uint32 addr);
t_stat dp_wrwd (UNIT *uptr, uint32 dat); t_stat dp_wrwd (UNIT *uptr, uint32 dat);
t_stat dp_wrdone (UNIT *uptr, uint32 flg); t_stat dp_wrdone (UNIT *uptr, uint32 flg);
t_stat dp_done (uint32 req, uint32 f); t_stat dp_done (uint32 req, uint32 f);
t_stat dp_setformat (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat dp_setformat (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat dp_showformat (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat dp_showformat (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* DP data structures /* DP data structures
@ -912,7 +912,7 @@ return SCPE_OK;
/* Attach routine, test formating */ /* Attach routine, test formating */
t_stat dp_attach (UNIT *uptr, char *cptr) t_stat dp_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
r = attach_unit (uptr, cptr); r = attach_unit (uptr, cptr);
@ -923,7 +923,7 @@ return dp_showformat (stdout, uptr, 0, NULL);
/* Set controller type */ /* Set controller type */
t_stat dp_settype (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dp_settype (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 i; int32 i;
@ -940,7 +940,7 @@ return SCPE_OK;
/* Show controller type */ /* Show controller type */
t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (dp_ctype >= DP_NUMTYP) if (dp_ctype >= DP_NUMTYP)
return SCPE_IERR; return SCPE_IERR;
@ -970,7 +970,7 @@ return SCPE_OK;
per record. per record.
*/ */
t_stat dp_setformat (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dp_setformat (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
uint32 h, c, cntr, rptr; uint32 h, c, cntr, rptr;
int32 i, nr, nw, inp; int32 i, nr, nw, inp;
@ -1027,7 +1027,7 @@ return SCPE_OK;
/* Show format */ /* Show format */
t_stat dp_showformat (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat dp_showformat (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
uint32 c, h, rptr, rlnt, sec; uint32 c, h, rptr, rlnt, sec;
uint32 minrec = DP_TRKLEN; uint32 minrec = DP_TRKLEN;

View file

@ -97,8 +97,8 @@ int32 fhd_time = 10; /* time per word */
int32 fhdio (int32 inst, int32 fnc, int32 dat, int32 dev); int32 fhdio (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat fhd_svc (UNIT *uptr); t_stat fhd_svc (UNIT *uptr);
t_stat fhd_reset (DEVICE *dptr); t_stat fhd_reset (DEVICE *dptr);
t_stat fhd_attach (UNIT *uptr, char *cptr); t_stat fhd_attach (UNIT *uptr, CONST char *cptr);
t_stat fhd_set_size (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat fhd_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
void fhd_go (uint32 dma); void fhd_go (uint32 dma);
void fhd_go1 (uint32 dat); void fhd_go1 (uint32 dat);
void fhd_go2 (uint32 dat); void fhd_go2 (uint32 dat);
@ -398,7 +398,7 @@ uint32 tk = CW1_GETTK (fhd_cw1); /* track */
uint32 ca = CW2_GETCA (fhd_cw2); /* char addr */ uint32 ca = CW2_GETCA (fhd_cw2); /* char addr */
uint32 wa = ca >> 1; /* word addr */ uint32 wa = ca >> 1; /* word addr */
uint32 ba = (((sf * FH_NUMTK) + tk) * FH_NUMWD) + wa; /* buffer offset */ uint32 ba = (((sf * FH_NUMTK) + tk) * FH_NUMWD) + wa; /* buffer offset */
uint16 *fbuf = uptr->filebuf; /* buffer base */ uint16 *fbuf = (uint16 *)uptr->filebuf; /* buffer base */
ch = ch & 0377; /* mask char */ ch = ch & 0377; /* mask char */
if (fhd_bad_wa (wa)) /* addr bad? */ if (fhd_bad_wa (wa)) /* addr bad? */
@ -456,7 +456,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat fhd_attach (UNIT *uptr, char *cptr) t_stat fhd_attach (UNIT *uptr, CONST char *cptr)
{ {
uint32 sz, sf; uint32 sz, sf;
uint32 ds_bytes = FH_WDPSF * sizeof (int16); uint32 ds_bytes = FH_WDPSF * sizeof (int16);
@ -474,7 +474,7 @@ return attach_unit (uptr, cptr);
/* Set size routine */ /* Set size routine */
t_stat fhd_set_size (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat fhd_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (val < 0) if (val < 0)
return SCPE_IERR; return SCPE_IERR;

View file

@ -68,7 +68,7 @@ int32 hi3_io (int32 inst, int32 fnc, int32 dat, int32 dev);
int32 hi4_io (int32 inst, int32 fnc, int32 dat, int32 dev); int32 hi4_io (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat hi_service (UNIT *uptr); t_stat hi_service (UNIT *uptr);
t_stat hi_reset (DEVICE *dptr); t_stat hi_reset (DEVICE *dptr);
t_stat hi_attach (UNIT *uptr, char *cptr); t_stat hi_attach (UNIT *uptr, CONST char *cptr);
t_stat hi_detach (UNIT *uptr); t_stat hi_detach (UNIT *uptr);
@ -303,7 +303,7 @@ t_stat hi_reset (DEVICE *dptr)
} }
// Attach (connect) ... // Attach (connect) ...
t_stat hi_attach (UNIT *uptr, char *cptr) t_stat hi_attach (UNIT *uptr, CONST char *cptr)
{ {
// simh calls this routine for (what else?) the ATTACH command. // simh calls this routine for (what else?) the ATTACH command.
uint16 host = uptr->hline; uint16 host = uptr->hline;

View file

@ -62,10 +62,10 @@ extern int32 stop_inst; // needed by IOBADFNC()
int32 imp_io (int32 inst, int32 fnc, int32 dat, int32 dev); int32 imp_io (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat imp_service (UNIT *uptr); t_stat imp_service (UNIT *uptr);
t_stat imp_reset (DEVICE *dptr); t_stat imp_reset (DEVICE *dptr);
t_stat imp_show_station (FILE *st, UNIT *uptr, int32 val, void *dp); t_stat imp_show_station (FILE *st, UNIT *uptr, int32 val, CONST void *dp);
t_stat io_show_int (FILE *st, UNIT *uptr, int32 val, void *dp); t_stat io_show_int (FILE *st, UNIT *uptr, int32 val, CONST void *dp);
t_stat imp_set_station (UNIT *uptr, int32 val, char *cptr, void *dp); t_stat imp_set_station (UNIT *uptr, int32 val, CONST char *cptr, void *dp);
t_stat io_set_int (UNIT *uptr, int32 val, char *cptr, void *dp); t_stat io_set_int (UNIT *uptr, int32 val, CONST char *cptr, void *dp);
@ -172,14 +172,14 @@ t_stat imp_reset (DEVICE *dptr)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Show the station number ... // Show the station number ...
t_stat imp_show_station (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat imp_show_station (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fprintf(st,"station=%d", imp_station); fprintf(st,"station=%d", imp_station);
return SCPE_OK; return SCPE_OK;
} }
// Set the station number ... // Set the station number ...
t_stat imp_set_station (UNIT *uptr, int32 val, char *cptr, void *dp) t_stat imp_set_station (UNIT *uptr, int32 val, CONST char *cptr, void *dp)
{ {
uint32 newnum; t_stat sts; uint32 newnum; t_stat sts;
if (cptr == NULL) return SCPE_ARG; if (cptr == NULL) return SCPE_ARG;

View file

@ -189,7 +189,7 @@ extern t_stat mi_tx_service (uint32 quantum);
// Prototypes for UDP modem/host interface emulation routines ... // Prototypes for UDP modem/host interface emulation routines ...
#define NOLINK (-1) #define NOLINK (-1)
t_stat udp_create (DEVICE *pdtr, char *premote, int32 *plink); t_stat udp_create (DEVICE *pdtr, const char *premote, int32 *plink);
t_stat udp_release (DEVICE *dptr, int32 link); t_stat udp_release (DEVICE *dptr, int32 link);
t_stat udp_send (DEVICE *pdtr, int32 link, uint16 *pdata, uint16 count); t_stat udp_send (DEVICE *pdtr, int32 link, uint16 *pdata, uint16 count);
t_stat udp_set_link_loopback (DEVICE *dptr, int32 link, t_bool enable_loopback); t_stat udp_set_link_loopback (DEVICE *dptr, int32 link, t_bool enable_loopback);

View file

@ -187,10 +187,10 @@ int32 mi5_io (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat mi_rx_service (UNIT *uptr); t_stat mi_rx_service (UNIT *uptr);
void mi_rx_local (uint16 line, uint16 txnext, uint16 txcount); void mi_rx_local (uint16 line, uint16 txnext, uint16 txcount);
t_stat mi_reset (DEVICE *dptr); t_stat mi_reset (DEVICE *dptr);
t_stat mi_attach (UNIT *uptr, char *cptr); t_stat mi_attach (UNIT *uptr, CONST char *cptr);
t_stat mi_detach (UNIT *uptr); t_stat mi_detach (UNIT *uptr);
t_stat mi_set_loopback (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat mi_set_loopback (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat mi_show_loopback (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat mi_show_loopback (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
@ -678,7 +678,7 @@ t_stat mi_reset (DEVICE *dptr)
} }
// Attach device ... // Attach device ...
t_stat mi_attach (UNIT *uptr, char *cptr) t_stat mi_attach (UNIT *uptr, CONST char *cptr)
{ {
// simh calls this routine for (what else?) the ATTACH command. There are // simh calls this routine for (what else?) the ATTACH command. There are
// three distinct formats for ATTACH - // three distinct formats for ATTACH -
@ -730,7 +730,7 @@ t_stat mi_detach (UNIT *uptr)
return mi_reset(PDEVICE(line)); return mi_reset(PDEVICE(line));
} }
t_stat mi_set_loopback (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat mi_set_loopback (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
t_stat ret = SCPE_OK; uint16 line = uptr->mline; t_stat ret = SCPE_OK; uint16 line = uptr->mline;
@ -752,7 +752,7 @@ t_stat mi_set_loopback (UNIT *uptr, int32 val, char *cptr, void *desc)
return ret; return ret;
} }
t_stat mi_show_loopback (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat mi_show_loopback (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
uint16 line = uptr->mline; uint16 line = uptr->mline;

View file

@ -107,7 +107,7 @@ int32 mtio (int32 inst, int32 fnc, int32 dat, int32 dev);
void mt_updint (uint32 rdy, uint32 mdone); void mt_updint (uint32 rdy, uint32 mdone);
t_stat mt_svc (UNIT *uptr); t_stat mt_svc (UNIT *uptr);
t_stat mt_reset (DEVICE *dptr); t_stat mt_reset (DEVICE *dptr);
t_stat mt_attach (UNIT *uptr, char *cptr); t_stat mt_attach (UNIT *uptr, CONST char *cptr);
t_stat mt_detach (UNIT *uptr); t_stat mt_detach (UNIT *uptr);
t_stat mt_map_err (UNIT *uptr, t_stat st); t_stat mt_map_err (UNIT *uptr, t_stat st);
void mt_wrwd (UNIT *uptr, uint32 dat); void mt_wrwd (UNIT *uptr, uint32 dat);
@ -596,7 +596,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat mt_attach (UNIT *uptr, char *cptr) t_stat mt_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;

View file

@ -89,12 +89,12 @@ t_stat rtc_reset (DEVICE *dptr);
int32 wdt_io (int32 inst, int32 fnc, int32 dat, int32 dev); int32 wdt_io (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat wdt_service (UNIT *uptr); t_stat wdt_service (UNIT *uptr);
t_stat wdt_reset (DEVICE *dptr); t_stat wdt_reset (DEVICE *dptr);
t_stat rtc_set_interval (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat rtc_set_interval (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat rtc_show_interval (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat rtc_show_interval (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat rtc_set_quantum(UNIT *uptr, int32 val, char *cptr, void *desc); t_stat rtc_set_quantum(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat rtc_show_quantum (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat rtc_show_quantum (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat wdt_set_delay (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat wdt_set_delay (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat wdt_show_delay (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat wdt_show_delay (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
@ -315,7 +315,7 @@ t_stat wdt_reset (DEVICE *dptr)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Set/Show RTC interval ... // Set/Show RTC interval ...
t_stat rtc_set_interval (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat rtc_set_interval (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
uint32 newint, newtps; t_stat ret; uint32 newint, newtps; t_stat ret;
if (cptr == NULL) return SCPE_ARG; if (cptr == NULL) return SCPE_ARG;
@ -329,14 +329,14 @@ t_stat rtc_set_interval (UNIT *uptr, int32 val, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat rtc_show_interval (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat rtc_show_interval (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fprintf(st,"interval=%d (us)", rtc_interval); fprintf(st,"interval=%d (us)", rtc_interval);
return SCPE_OK; return SCPE_OK;
} }
// Set/Show RTC quantum ... // Set/Show RTC quantum ...
t_stat rtc_set_quantum (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat rtc_set_quantum (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
uint32 newquant, newtps; t_stat ret; uint32 newquant, newtps; t_stat ret;
if (cptr == NULL) return SCPE_ARG; if (cptr == NULL) return SCPE_ARG;
@ -350,14 +350,14 @@ t_stat rtc_set_quantum (UNIT *uptr, int32 val, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat rtc_show_quantum (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat rtc_show_quantum (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fprintf(st,"quantum=%d (ticks)", rtc_quantum); fprintf(st,"quantum=%d (ticks)", rtc_quantum);
return SCPE_OK; return SCPE_OK;
} }
// Set/Show WDT delay ... // Set/Show WDT delay ...
t_stat wdt_set_delay (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat wdt_set_delay (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
uint32 newint; t_stat ret; uint32 newint; t_stat ret;
if (cptr == NULL) return SCPE_ARG; if (cptr == NULL) return SCPE_ARG;
@ -372,7 +372,7 @@ t_stat wdt_set_delay (UNIT *uptr, int32 val, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat wdt_show_delay (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat wdt_show_delay (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (wdt_delay > 0) if (wdt_delay > 0)
fprintf(st,"delay=%d (ms)", wdt_delay); fprintf(st,"delay=%d (ms)", wdt_delay);

View file

@ -140,15 +140,15 @@ int32 ttyio (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat tti_svc (UNIT *uptr); t_stat tti_svc (UNIT *uptr);
t_stat tto_svc (UNIT *uptr); t_stat tto_svc (UNIT *uptr);
t_stat tty_reset (DEVICE *dptr); t_stat tty_reset (DEVICE *dptr);
t_stat ttio_set_mode (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ttio_set_mode (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat ttrp_set_mode (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ttrp_set_mode (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat ttrp_set_start_stop (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ttrp_set_start_stop (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
int32 clkio (int32 inst, int32 fnc, int32 dat, int32 dev); int32 clkio (int32 inst, int32 fnc, int32 dat, int32 dev);
t_stat clk_svc (UNIT *uptr); t_stat clk_svc (UNIT *uptr);
t_stat clk_reset (DEVICE *dptr); t_stat clk_reset (DEVICE *dptr);
t_stat clk_set_freq (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat clk_set_freq (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat clk_show_freq (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat clk_show_freq (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat pt_attach (UNIT *uptr, char *cptr); t_stat pt_attach (UNIT *uptr, CONST char *cptr);
t_stat pt_detach (UNIT *uptr); t_stat pt_detach (UNIT *uptr);
t_stat tto_write (int32 c); t_stat tto_write (int32 c);
t_stat ttp_write (int32 c); t_stat ttp_write (int32 c);
@ -418,7 +418,7 @@ return SCPE_OK;
/* Paper tape attach routine - set or clear ASC/UASC flags if specified /* Paper tape attach routine - set or clear ASC/UASC flags if specified
Can be called for TTY units at well, hence, check for attachability */ Can be called for TTY units at well, hence, check for attachability */
t_stat pt_attach (UNIT *uptr, char *cptr) t_stat pt_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
@ -832,7 +832,7 @@ return SCPE_OK;
/* Set keyboard/printer mode - make sure flags agree */ /* Set keyboard/printer mode - make sure flags agree */
t_stat ttio_set_mode (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ttio_set_mode (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (uptr->flags & UNIT_ATTABLE) /* not TTR, TTP */ if (uptr->flags & UNIT_ATTABLE) /* not TTR, TTP */
return SCPE_NOFNC; return SCPE_NOFNC;
@ -845,7 +845,7 @@ return SCPE_OK;
/* Set reader/punch mode */ /* Set reader/punch mode */
t_stat ttrp_set_mode (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ttrp_set_mode (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (!(uptr->flags & UNIT_ATTABLE)) /* PTR, PTP, TTR, TTP only */ if (!(uptr->flags & UNIT_ATTABLE)) /* PTR, PTP, TTR, TTP only */
return SCPE_NOFNC; return SCPE_NOFNC;
@ -856,7 +856,7 @@ return SCPE_OK;
/* Set reader/punch start/stop */ /* Set reader/punch start/stop */
t_stat ttrp_set_start_stop (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ttrp_set_start_stop (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (!(uptr->flags & UNIT_ATTABLE)) /* TTR, TTP only */ if (!(uptr->flags & UNIT_ATTABLE)) /* TTR, TTP only */
return SCPE_NOFNC; return SCPE_NOFNC;
@ -948,7 +948,7 @@ return SCPE_OK;
/* Set frequency */ /* Set frequency */
t_stat clk_set_freq (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat clk_set_freq (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (cptr) if (cptr)
return SCPE_ARG; return SCPE_ARG;
@ -960,7 +960,7 @@ return SCPE_OK;
/* Show frequency */ /* Show frequency */
t_stat clk_show_freq (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat clk_show_freq (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fprintf (st, (clk_tps == 50)? "50Hz": "60Hz"); fprintf (st, (clk_tps == 50)? "50Hz": "60Hz");
return SCPE_OK; return SCPE_OK;

View file

@ -106,7 +106,7 @@ const char *sim_stop_messages[] = {
Tbs. Tbs.
*/ */
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag) t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
{ {
return SCPE_FMT; return SCPE_FMT;
} }
@ -232,13 +232,13 @@ static const int32 opc_val[] = {
#define fputs(_s,f) Fprintf(f,"%s",_s) #define fputs(_s,f) Fprintf(f,"%s",_s)
#define fputc(_c,f) Fprintf(f,"%c",_c) #define fputc(_c,f) Fprintf(f,"%c",_c)
void fprint_opr (FILE *of, int32 inst, int32 class) void fprint_opr (FILE *of, int32 inst, int32 Class)
{ {
int32 i, j, sp; int32 i, j, sp;
for (i = sp = 0; opc_val[i] >= 0; i++) { /* loop thru ops */ for (i = sp = 0; opc_val[i] >= 0; i++) { /* loop thru ops */
j = (opc_val[i] >> I_V_FL) & I_M_FL; /* get class */ j = (opc_val[i] >> I_V_FL) & I_M_FL; /* get class */
if ((j == class) && (opc_val[i] & inst)) { /* same class? */ if ((j == Class) && (opc_val[i] & inst)) { /* same class? */
inst = inst & ~opc_val[i]; /* mask bit set? */ inst = inst & ~opc_val[i]; /* mask bit set? */
fprintf (of, (sp? " %s": "%s"), opcode[i]); fprintf (of, (sp? " %s": "%s"), opcode[i]);
sp = 1; sp = 1;
@ -343,7 +343,7 @@ return SCPE_ARG;
status = error status status = error status
*/ */
t_stat parse_sym (char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) t_stat parse_sym (CONST char *cptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
{ {
int32 cflag, d, i, j, k; int32 cflag, d, i, j, k;
t_stat r; t_stat r;

View file

@ -197,7 +197,7 @@ int32 udp_find_free_link (void)
return NOLINK; return NOLINK;
} }
t_stat udp_parse_remote (int32 link, char *premote) t_stat udp_parse_remote (int32 link, const char *premote)
{ {
// This routine will parse a remote address string in any of these forms - // This routine will parse a remote address string in any of these forms -
// //
@ -255,7 +255,7 @@ t_stat udp_error (int32 link, const char *msg)
return SCPE_IOERR; return SCPE_IOERR;
} }
t_stat udp_create (DEVICE *dptr, char *premote, int32 *pln) t_stat udp_create (DEVICE *dptr, const char *premote, int32 *pln)
{ {
// Create a logical UDP link to the specified remote system. The "remote" // Create a logical UDP link to the specified remote system. The "remote"
// string specifies both the remote host name or IP and a port number. The // string specifies both the remote host name or IP and a port number. The

View file

@ -1,6 +1,6 @@
/* hp2100_baci.c: HP 12966A buffered asynchronous communications interface simulator /* hp2100_baci.c: HP 12966A buffered asynchronous communications interface simulator
Copyright (c) 2007-2014, J. David Bryan Copyright (c) 2007-2016, J. David Bryan
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 @@
BACI 12966A BACI card BACI 12966A BACI card
13-May-16 JDB Modified for revised SCP API function parameter types
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
10-Jan-13 MP Added DEV_MUX and additional DEVICE field values 10-Jan-13 MP Added DEV_MUX and additional DEVICE field values
10-Feb-12 JDB Deprecated DEVNO in favor of SC 10-Feb-12 JDB Deprecated DEVNO in favor of SC
@ -378,7 +379,7 @@ IOHANDLER baci_io;
t_stat baci_term_svc (UNIT *uptr); t_stat baci_term_svc (UNIT *uptr);
t_stat baci_poll_svc (UNIT *uptr); t_stat baci_poll_svc (UNIT *uptr);
t_stat baci_reset (DEVICE *dptr); t_stat baci_reset (DEVICE *dptr);
t_stat baci_attach (UNIT *uptr, char *cptr); t_stat baci_attach (UNIT *uptr, CONST char *cptr);
t_stat baci_detach (UNIT *uptr); t_stat baci_detach (UNIT *uptr);
@ -1049,7 +1050,7 @@ return SCPE_OK;
/* Attach controller */ /* Attach controller */
t_stat baci_attach (UNIT *uptr, char *cptr) t_stat baci_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat status = SCPE_OK; t_stat status = SCPE_OK;

View file

@ -1,6 +1,6 @@
/* hp2100_cpu.c: HP 21xx/1000 CPU simulator /* hp2100_cpu.c: HP 21xx/1000 CPU simulator
Copyright (c) 1993-2014, Robert M. Supnik Copyright (c) 1993-2016, 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"),
@ -29,6 +29,7 @@
DMA1,DMA2 12607B/12578A/12895A direct memory access controller DMA1,DMA2 12607B/12578A/12895A direct memory access controller
DCPC1,DCPC2 12897B dual channel port controller DCPC1,DCPC2 12897B dual channel port controller
13-May-16 JDB Modified for revised SCP API function parameter types
31-Dec-14 JDB Corrected devdisp data parameters 31-Dec-14 JDB Corrected devdisp data parameters
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
@ -589,14 +590,14 @@ t_stat cpu_reset (DEVICE *dptr);
t_stat cpu_boot (int32 unitno, DEVICE *dptr); t_stat cpu_boot (int32 unitno, DEVICE *dptr);
t_stat mp_reset (DEVICE *dptr); t_stat mp_reset (DEVICE *dptr);
t_stat dma_reset (DEVICE *dptr); t_stat dma_reset (DEVICE *dptr);
t_stat cpu_set_size (UNIT *uptr, int32 new_size, char *cptr, void *desc); t_stat cpu_set_size (UNIT *uptr, int32 new_size, CONST char *cptr, void *desc);
t_stat cpu_set_model (UNIT *uptr, int32 new_model, char *cptr, void *desc); t_stat cpu_set_model (UNIT *uptr, int32 new_model, CONST char *cptr, void *desc);
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat cpu_set_opt (UNIT *uptr, int32 option, char *cptr, void *desc); t_stat cpu_set_opt (UNIT *uptr, int32 option, CONST char *cptr, void *desc);
t_stat cpu_clr_opt (UNIT *uptr, int32 option, char *cptr, void *desc); t_stat cpu_clr_opt (UNIT *uptr, int32 option, CONST char *cptr, void *desc);
t_stat cpu_set_ldr (UNIT *uptr, int32 enable, char *cptr, void *desc); t_stat cpu_set_ldr (UNIT *uptr, int32 enable, CONST char *cptr, void *desc);
t_stat cpu_set_idle (UNIT *uptr, int32 option, char *cptr, void *desc); t_stat cpu_set_idle (UNIT *uptr, int32 option, CONST char *cptr, void *desc);
t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
void hp_post_cmd (t_bool from_scp); void hp_post_cmd (t_bool from_scp);
IOHANDLER cpuio; IOHANDLER cpuio;
@ -3666,7 +3667,7 @@ return is_conflict;
- If new size < old size, truncation accepted. - If new size < old size, truncation accepted.
*/ */
t_stat cpu_set_size (UNIT *uptr, int32 new_size, char *cptr, void *desc) t_stat cpu_set_size (UNIT *uptr, int32 new_size, CONST char *cptr, void *desc)
{ {
int32 mc = 0; int32 mc = 0;
uint32 i; uint32 i;
@ -3715,7 +3716,7 @@ return SCPE_OK;
- Disables loader on 21xx machines. - Disables loader on 21xx machines.
*/ */
t_stat cpu_set_model (UNIT *uptr, int32 new_model, char *cptr, void *desc) t_stat cpu_set_model (UNIT *uptr, int32 new_model, CONST char *cptr, void *desc)
{ {
uint32 old_family = UNIT_CPU_FAMILY; /* current CPU type */ uint32 old_family = UNIT_CPU_FAMILY; /* current CPU type */
uint32 new_family = new_model & UNIT_FAMILY_MASK; /* new CPU family */ uint32 new_family = new_model & UNIT_FAMILY_MASK; /* new CPU family */
@ -3799,9 +3800,9 @@ return result;
Loader status is displayed for 21xx models and suppressed for 1000 models. Loader status is displayed for 21xx models and suppressed for 1000 models.
*/ */
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fputs ((char *) desc, st); /* write model name */ fputs ((const char *) desc, st); /* write model name */
if (UNIT_CPU_FAMILY == UNIT_FAMILY_21XX) /* valid only for 21xx */ if (UNIT_CPU_FAMILY == UNIT_FAMILY_21XX) /* valid only for 21xx */
if (fwanxm < MEMSIZE) /* loader area non-existent? */ if (fwanxm < MEMSIZE) /* loader area non-existent? */
@ -3822,7 +3823,7 @@ return SCPE_OK;
(FP is required for FFP installation). (FP is required for FFP installation).
*/ */
t_stat cpu_set_opt (UNIT *uptr, int32 option, char *cptr, void *desc) t_stat cpu_set_opt (UNIT *uptr, int32 option, CONST char *cptr, void *desc)
{ {
uint32 model = CPU_MODEL_INDEX; /* current CPU model index */ uint32 model = CPU_MODEL_INDEX; /* current CPU model index */
@ -3858,7 +3859,7 @@ return SCPE_OK;
(FP is required for FFP installation). (FP is required for FFP installation).
*/ */
t_bool cpu_clr_opt (UNIT *uptr, int32 option, char *cptr, void *desc) t_bool cpu_clr_opt (UNIT *uptr, int32 option, CONST char *cptr, void *desc)
{ {
uint32 model = CPU_MODEL_INDEX; /* current CPU model index */ uint32 model = CPU_MODEL_INDEX; /* current CPU model index */
@ -3904,7 +3905,7 @@ return SCPE_OK;
breakpoints within and single-stepping through the loaders. breakpoints within and single-stepping through the loaders.
*/ */
t_stat cpu_set_ldr (UNIT *uptr, int32 enable, char *cptr, void *desc) t_stat cpu_set_ldr (UNIT *uptr, int32 enable, CONST char *cptr, void *desc)
{ {
static BOOT_ROM loader; static BOOT_ROM loader;
int32 i; int32 i;
@ -3934,7 +3935,7 @@ return SCPE_OK;
/* Idle enable/disable */ /* Idle enable/disable */
t_stat cpu_set_idle (UNIT *uptr, int32 option, char *cptr, void *desc) t_stat cpu_set_idle (UNIT *uptr, int32 option, CONST char *cptr, void *desc)
{ {
if (option) if (option)
return sim_set_idle (uptr, 10, NULL, NULL); return sim_set_idle (uptr, 10, NULL, NULL);
@ -3945,7 +3946,7 @@ t_stat cpu_set_idle (UNIT *uptr, int32 option, char *cptr, void *desc)
/* Idle display */ /* Idle display */
t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat cpu_show_idle (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
return sim_show_idle (st, uptr, val, desc); return sim_show_idle (st, uptr, val, desc);
} }

View file

@ -1,6 +1,6 @@
/* hp2100_defs.h: HP 2100 simulator definitions /* hp2100_defs.h: HP 2100 simulator definitions
Copyright (c) 1993-2015, Robert M. Supnik Copyright (c) 1993-2016, 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"),
@ -23,6 +23,7 @@
be used in advertising or otherwise to promote the sale, use or other dealings 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. in this Software without prior written authorization from Robert M Supnik.
13-May-16 JDB Modified for revised SCP API function parameter types
19-Jun-15 JDB Conditionally use Global_PC for PC for version 4.0 and on 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 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 28-Dec-14 JDB Changed suppression from #pragma GCC to #pragma clang
@ -79,8 +80,8 @@
#define HP2100_DEFS_H_ 0 #define HP2100_DEFS_H_ 0
#include "sim_defs.h"
#include "sim_rev.h" #include "sim_rev.h"
#include "sim_defs.h"
#if (SIM_MAJOR >= 4) #if (SIM_MAJOR >= 4)
@ -485,10 +486,10 @@ extern void hp_enbdis_pair (DEVICE *ccp, DEVICE *dcp);
/* System functions */ /* System functions */
extern const char *fmt_char (uint8 ch); extern const char *fmt_char (uint8 ch);
extern t_stat hp_setsc (UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat hp_setsc (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat hp_showsc (FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat hp_setdev (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat hp_setdev (UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat hp_showsc (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern t_stat hp_showdev (FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat hp_showdev (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
extern t_bool hp_fprint_stopped (FILE *st, t_stat reason); extern t_bool hp_fprint_stopped (FILE *st, t_stat reason);
/* Device-specific functions */ /* Device-specific functions */

View file

@ -1,6 +1,6 @@
/* hp2100_di.c: HP 12821A HP-IB Disc Interface simulator /* hp2100_di.c: HP 12821A HP-IB Disc Interface simulator
Copyright (c) 2010-2014, J. David Bryan Copyright (c) 2010-2016, J. David Bryan
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 @@
DI 12821A Disc Interface DI 12821A Disc Interface
13-May-16 JDB Modified for revised SCP API function parameter types
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
Removed redundant global declarations Removed redundant global declarations
13-Feb-12 JDB First release 13-Feb-12 JDB First release
@ -805,7 +806,7 @@ return SCPE_OK;
at power-up. at power-up.
*/ */
t_stat di_set_address (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat di_set_address (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
t_stat status; t_stat status;
uint32 index, new_address; uint32 index, new_address;
@ -849,9 +850,9 @@ return status; /* return the result
address (0) or a card's bus address (1). address (0) or a card's bus address (1).
*/ */
t_stat di_show_address (FILE *st, UNIT *uptr, int32 value, void *desc) t_stat di_show_address (FILE *st, UNIT *uptr, int32 value, CONST void *desc)
{ {
DEVICE *dptr = (DEVICE *) desc; const DEVICE *dptr = (const DEVICE *) desc;
if (value) /* do we want the card address? */ if (value) /* do we want the card address? */
fprintf (st, "address=%d", GET_DIADR (dptr->flags)); /* get it from the device flags */ fprintf (st, "address=%d", GET_DIADR (dptr->flags)); /* get it from the device flags */
@ -880,15 +881,17 @@ return SCPE_OK;
will no longer be necessary. will no longer be necessary.
*/ */
t_stat di_set_cable (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat di_set_cable (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
DEVICE *dptr = (DEVICE *) desc;
if (value) { /* is the diagnostic cable selected? */ if (value) { /* is the diagnostic cable selected? */
((DEVICE *) desc)->flags |= DEV_DIAG; /* set the diagnostic flag */ dptr->flags |= DEV_DIAG; /* set the diagnostic flag */
dc_dev.flags &= ~DEV_DIS; /* enable the dummy device */ dc_dev.flags &= ~DEV_DIS; /* enable the dummy device */
dc_dev.flags |= DEV_DIAG; /* and set its flag as well */ dc_dev.flags |= DEV_DIAG; /* and set its flag as well */
} }
else { /* the peripheral cable is selected */ else { /* the peripheral cable is selected */
((DEVICE *) desc)->flags &= ~DEV_DIAG; /* clear the diagnostic flag */ dptr->flags &= ~DEV_DIAG; /* clear the diagnostic flag */
dc_dev.flags |= DEV_DIS; /* disable the dummy device */ dc_dev.flags |= DEV_DIS; /* disable the dummy device */
dc_dev.flags &= ~DEV_DIAG; /* and clear its flag */ dc_dev.flags &= ~DEV_DIAG; /* and clear its flag */
} }
@ -903,9 +906,11 @@ return SCPE_OK;
normal use (0) or to another card for diagnostics (1). normal use (0) or to another card for diagnostics (1).
*/ */
t_stat di_show_cable (FILE *st, UNIT *uptr, int32 value, void *desc) t_stat di_show_cable (FILE *st, UNIT *uptr, int32 value, CONST void *desc)
{ {
if (((DEVICE *) desc)->flags & DEV_DIAG) /* is the cable connected for diagnostics? */ const DEVICE *dptr = (const DEVICE *) desc;
if (dptr->flags & DEV_DIAG) /* is the cable connected for diagnostics? */
fputs ("diagnostic cable", st); /* report it */ fputs ("diagnostic cable", st); /* report it */
else /* the cable is connected for device use */ else /* the cable is connected for device use */
fputs ("HP-IB cable", st); /* report the condition */ fputs ("HP-IB cable", st); /* report the condition */

View file

@ -1,6 +1,6 @@
/* hp2100_di.h: HP 12821A HP-IB Disc Interface simulator definitions /* hp2100_di.h: HP 12821A HP-IB Disc Interface simulator definitions
Copyright (c) 2010-2012, J. David Bryan Copyright (c) 2010-2016, J. David Bryan
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 @@
DI 12821A Disc Interface DI 12821A Disc Interface
13-May-16 JDB Modified for revised SCP API function parameter types
14-Feb-12 JDB First release 14-Feb-12 JDB First release
16-Nov-10 JDB Created DI common definitions file 16-Nov-10 JDB Created DI common definitions file
@ -261,10 +262,11 @@ extern t_stat di_reset (DEVICE *dptr);
/* Disc interface global SCP routines */ /* Disc interface global SCP routines */
extern t_stat di_set_address (UNIT *uptr, int32 value, char *cptr, void *desc); extern t_stat di_set_address (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
extern t_stat di_show_address (FILE *st, UNIT *uptr, int32 value, void *desc); extern t_stat di_set_cable (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
extern t_stat di_set_cable (UNIT *uptr, int32 value, char *cptr, void *desc);
extern t_stat di_show_cable (FILE *st, UNIT *uptr, int32 value, void *desc); extern t_stat di_show_address (FILE *st, UNIT *uptr, int32 value, CONST void *desc);
extern t_stat di_show_cable (FILE *st, UNIT *uptr, int32 value, CONST void *desc);
/* Disc interface global bus routines */ /* Disc interface global bus routines */
@ -291,8 +293,8 @@ extern t_stat ma_boot (int32 unitno, DEVICE *dptr);
/* Amigo mag tape global SCP routines */ /* Amigo mag tape global SCP routines */
extern t_stat ma_set_timing (UNIT *uptr, int32 val, char *cptr, void *desc); extern t_stat ma_set_timing (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
extern t_stat ma_show_timing (FILE *st, UNIT *uptr, int32 val, void *desc); extern t_stat ma_show_timing (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* Amigo mag tape global bus routines */ /* Amigo mag tape global bus routines */

View file

@ -25,6 +25,7 @@
DA 12821A Disc Interface with Amigo disc drives DA 12821A Disc Interface with Amigo disc drives
13-May-16 JDB Modified for revised SCP API function parameter types
04-Mar-16 JDB Name changed to "hp2100_disclib" until HP 3000 integration 04-Mar-16 JDB Name changed to "hp2100_disclib" until HP 3000 integration
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Use T_ADDR_FMT with t_addr values for 64-bit compatibility 24-Dec-14 JDB Use T_ADDR_FMT with t_addr values for 64-bit compatibility
@ -467,12 +468,12 @@ static CNTLR_VARS icd_cntlr [DA_UNITS] = /* ICD controllers: */
/* Amigo disc global VM routines */ /* Amigo disc global VM routines */
t_stat da_reset (DEVICE *dptr); t_stat da_reset (DEVICE *dptr);
t_stat da_attach (UNIT *uptr, char *cptr); t_stat da_attach (UNIT *uptr, CONST char *cptr);
t_stat da_detach (UNIT *uptr); t_stat da_detach (UNIT *uptr);
/* Amigo disc global SCP routines */ /* Amigo disc global SCP routines */
t_stat da_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat da_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
/* Amigo disc local utility routines */ /* Amigo disc local utility routines */
@ -1083,7 +1084,7 @@ return status;
validation routine. validation routine.
*/ */
t_stat da_attach (UNIT *uptr, char *cptr) t_stat da_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat result; t_stat result;
const int32 unit = uptr - da_unit; /* calculate the unit number */ const int32 unit = uptr - da_unit; /* calculate the unit number */
@ -1253,7 +1254,7 @@ else
we match the diagnostic expectation below. we match the diagnostic expectation below.
*/ */
t_stat da_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat da_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
const int32 unit = uptr - da_unit; /* calculate the unit number */ const int32 unit = uptr - da_unit; /* calculate the unit number */
const t_bool load = (value != UNIT_UNLOAD); /* true if the heads are loading */ const t_bool load = (value != UNIT_UNLOAD); /* true if the heads are loading */

View file

@ -24,6 +24,7 @@
used in advertising or otherwise to promote the sale, use or other dealings used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the authors. in this Software without prior written authorization from the authors.
13-May-16 JDB Modified for revised SCP API function parameter types
04-Mar-16 JDB Name changed to "hp2100_disclib" until HP 3000 integration 04-Mar-16 JDB Name changed to "hp2100_disclib" until HP 3000 integration
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
27-Oct-14 JDB Corrected the relative movement calculation in start_seek 27-Oct-14 JDB Corrected the relative movement calculation in start_seek
@ -1658,7 +1659,7 @@ else /* the phase is illegal,
retained. retained.
*/ */
t_stat dl_attach (CVPTR cvptr, UNIT *uptr, char *cptr) t_stat dl_attach (CVPTR cvptr, UNIT *uptr, CONST char *cptr)
{ {
uint32 id, size; uint32 id, size;
t_stat result; t_stat result;
@ -1708,7 +1709,7 @@ return detach_unit (uptr); /* and detach the unit
the unit capacity is set to the size indicated. the unit capacity is set to the size indicated.
*/ */
t_stat dl_set_model (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat dl_set_model (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
if (uptr->flags & UNIT_ATT) /* we cannot alter the disc model */ if (uptr->flags & UNIT_ATT) /* we cannot alter the disc model */
return SCPE_ALATT; /* if the unit is attached */ return SCPE_ALATT; /* if the unit is attached */

View file

@ -1,6 +1,6 @@
/* hp_disclib.h: HP MAC/ICD disc controller simulator library definitions /* hp_disclib.h: HP MAC/ICD disc controller simulator library definitions
Copyright (c) 2011-2012, J. David Bryan Copyright (c) 2011-2016, J. David Bryan
Copyright (c) 2004-2011, Robert M. Supnik Copyright (c) 2004-2011, 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
@ -24,6 +24,7 @@
used in advertising or otherwise to promote the sale, use or other dealings used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the authors. in this Software without prior written authorization from the authors.
13-May-16 JDB Modified for revised SCP API function parameter types
24-Oct-12 JDB Changed CNTLR_OPCODE to title case to avoid name clash 24-Oct-12 JDB Changed CNTLR_OPCODE to title case to avoid name clash
07-May-12 JDB Added end-of-track delay time as a controller variable 07-May-12 JDB Added end-of-track delay time as a controller variable
02-May-12 JDB First release 02-May-12 JDB First release
@ -384,6 +385,6 @@ extern const char *dl_phase_name (CNTLR_PHASE phase);
/* Disc library global VM routines */ /* Disc library global VM routines */
extern t_stat dl_attach (CVPTR cvptr, UNIT *uptr, char *cptr); extern t_stat dl_attach (CVPTR cvptr, UNIT *uptr, CONST char *cptr);
extern t_stat dl_detach (CVPTR cvptr, UNIT *uptr); extern t_stat dl_detach (CVPTR cvptr, UNIT *uptr);
extern t_stat dl_set_model (UNIT *uptr, int32 value, char *cptr, void *desc); extern t_stat dl_set_model (UNIT *uptr, int32 value, CONST char *cptr, void *desc);

View file

@ -1,6 +1,6 @@
/* hp2100_dp.c: HP 2100 12557A/13210A disk simulator /* hp2100_dp.c: HP 2100 12557A/13210A disk simulator
Copyright (c) 1993-2014, Robert M. Supnik Copyright (c) 1993-2016, 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 @@
DP 12557A 2871 disk subsystem DP 12557A 2871 disk subsystem
13210A 7900 disk subsystem 13210A 7900 disk subsystem
13-May-16 JDB Modified for revised SCP API function parameter types
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
18-Dec-12 MP Now calls sim_activate_time to get remaining seek time 18-Dec-12 MP Now calls sim_activate_time to get remaining seek time
@ -265,14 +266,14 @@ IOHANDLER dpcio;
t_stat dpc_svc (UNIT *uptr); t_stat dpc_svc (UNIT *uptr);
t_stat dpd_svc (UNIT *uptr); t_stat dpd_svc (UNIT *uptr);
t_stat dpc_reset (DEVICE *dptr); t_stat dpc_reset (DEVICE *dptr);
t_stat dpc_attach (UNIT *uptr, char *cptr); t_stat dpc_attach (UNIT *uptr, CONST char *cptr);
t_stat dpc_detach (UNIT* uptr); t_stat dpc_detach (UNIT* uptr);
t_stat dpc_boot (int32 unitno, DEVICE *dptr); t_stat dpc_boot (int32 unitno, DEVICE *dptr);
void dp_god (int32 fnc, int32 drv, int32 time); void dp_god (int32 fnc, int32 drv, int32 time);
void dp_goc (int32 fnc, int32 drv, int32 time); void dp_goc (int32 fnc, int32 drv, int32 time);
t_stat dpc_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat dpc_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
t_stat dp_settype (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat dp_settype (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* DPD data structures /* DPD data structures
@ -1041,7 +1042,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat dpc_attach (UNIT *uptr, char *cptr) t_stat dpc_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
@ -1062,7 +1063,7 @@ return detach_unit (uptr); /* detach unit */
/* Load and unload heads */ /* Load and unload heads */
t_stat dpc_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat dpc_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
int32 drv; int32 drv;
@ -1083,7 +1084,7 @@ return SCPE_OK;
/* Set controller type */ /* Set controller type */
t_stat dp_settype (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dp_settype (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 i; int32 i;
@ -1105,7 +1106,7 @@ return SCPE_OK;
/* Show controller type */ /* Show controller type */
t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat dp_showtype (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (dp_ctype == A13210) if (dp_ctype == A13210)
fprintf (st, "13210A"); fprintf (st, "13210A");

View file

@ -1,7 +1,7 @@
/* hp2100_dq.c: HP 2100 12565A disk simulator /* hp2100_dq.c: HP 2100 12565A disk simulator
Copyright (c) 1993-2006, Bill McDermith Copyright (c) 1993-2006, Bill McDermith
Copyright (c) 2004-2014 J. David Bryan Copyright (c) 2004-2016 J. David Bryan
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 @@
DQ 12565A 2883 disk system DQ 12565A 2883 disk system
13-May-16 JDB Modified for revised SCP API function parameter types
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
18-Dec-12 MP Now calls sim_activate_time to get remaining seek time 18-Dec-12 MP Now calls sim_activate_time to get remaining seek time
@ -193,9 +194,9 @@ IOHANDLER dqcio;
t_stat dqc_svc (UNIT *uptr); t_stat dqc_svc (UNIT *uptr);
t_stat dqd_svc (UNIT *uptr); t_stat dqd_svc (UNIT *uptr);
t_stat dqc_reset (DEVICE *dptr); t_stat dqc_reset (DEVICE *dptr);
t_stat dqc_attach (UNIT *uptr, char *cptr); t_stat dqc_attach (UNIT *uptr, CONST char *cptr);
t_stat dqc_detach (UNIT* uptr); t_stat dqc_detach (UNIT* uptr);
t_stat dqc_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat dqc_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
t_stat dqc_boot (int32 unitno, DEVICE *dptr); t_stat dqc_boot (int32 unitno, DEVICE *dptr);
void dq_god (int32 fnc, int32 drv, int32 time); void dq_god (int32 fnc, int32 drv, int32 time);
void dq_goc (int32 fnc, int32 drv, int32 time); void dq_goc (int32 fnc, int32 drv, int32 time);
@ -865,7 +866,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat dqc_attach (UNIT *uptr, char *cptr) t_stat dqc_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
@ -884,7 +885,7 @@ return detach_unit (uptr); /* detach unit */
/* Load and unload heads */ /* Load and unload heads */
t_stat dqc_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat dqc_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
if ((uptr->flags & UNIT_ATT) == 0) return SCPE_UNATT; /* must be attached to load */ if ((uptr->flags & UNIT_ATT) == 0) return SCPE_UNATT; /* must be attached to load */
if (value == UNIT_UNLOAD) /* unload heads? */ if (value == UNIT_UNLOAD) /* unload heads? */

View file

@ -1,6 +1,6 @@
/* hp2100_dr.c: HP 2100 12606B/12610B fixed head disk/drum simulator /* hp2100_dr.c: HP 2100 12606B/12610B fixed head disk/drum simulator
Copyright (c) 1993-2014, Robert M. Supnik Copyright (c) 1993-2016, 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 @@
DR 12606B 2770/2771 fixed head disk DR 12606B 2770/2771 fixed head disk
12610B 2773/2774/2775 drum 12610B 2773/2774/2775 drum
13-May-16 JDB Modified for revised SCP API function parameter types
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
10-Feb-12 JDB Deprecated DEVNO in favor of SC 10-Feb-12 JDB Deprecated DEVNO in favor of SC
@ -204,13 +205,13 @@ IOHANDLER drcio;
t_stat drc_svc (UNIT *uptr); t_stat drc_svc (UNIT *uptr);
t_stat drc_reset (DEVICE *dptr); t_stat drc_reset (DEVICE *dptr);
t_stat drc_attach (UNIT *uptr, char *cptr); t_stat drc_attach (UNIT *uptr, CONST char *cptr);
t_stat drc_boot (int32 unitno, DEVICE *dptr); t_stat drc_boot (int32 unitno, DEVICE *dptr);
int32 dr_incda (int32 trk, int32 sec, int32 ptr); int32 dr_incda (int32 trk, int32 sec, int32 ptr);
int32 dr_seccntr (double simtime); int32 dr_seccntr (double simtime);
t_stat dr_set_prot (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat dr_set_prot (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat dr_show_prot (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat dr_show_prot (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat dr_set_size (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat dr_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
DEVICE drd_dev, drc_dev; DEVICE drd_dev, drc_dev;
@ -630,7 +631,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat drc_attach (UNIT *uptr, char *cptr) t_stat drc_attach (UNIT *uptr, CONST char *cptr)
{ {
int32 sz = sz_tab[DR_GETSZ (uptr->flags)]; int32 sz = sz_tab[DR_GETSZ (uptr->flags)];
@ -641,7 +642,7 @@ return attach_unit (uptr, cptr);
/* Set protected track count */ /* Set protected track count */
t_stat dr_set_prot (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dr_set_prot (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 count; int32 count;
t_stat status; t_stat status;
@ -677,7 +678,7 @@ return SCPE_OK;
/* Show protected track count */ /* Show protected track count */
t_stat dr_show_prot (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat dr_show_prot (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fprintf (st, "protected tracks=%d", drc_pcount); fprintf (st, "protected tracks=%d", drc_pcount);
return SCPE_OK; return SCPE_OK;
@ -685,7 +686,7 @@ return SCPE_OK;
/* Set size routine */ /* Set size routine */
t_stat dr_set_size (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat dr_set_size (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 sz; int32 sz;
int32 szindex; int32 szindex;

View file

@ -26,6 +26,7 @@
DS 13037D/13175D disc controller/interface DS 13037D/13175D disc controller/interface
13-May-16 JDB Modified for revised SCP API function parameter types
04-Mar-16 JDB Name changed to "hp2100_disclib" until HP 3000 integration 04-Mar-16 JDB Name changed to "hp2100_disclib" until HP 3000 integration
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Use T_ADDR_FMT with t_addr values for 64-bit compatibility 24-Dec-14 JDB Use T_ADDR_FMT with t_addr values for 64-bit compatibility
@ -187,13 +188,13 @@ t_stat ds_service_drive (UNIT *uptr);
t_stat ds_service_controller (UNIT *uptr); t_stat ds_service_controller (UNIT *uptr);
t_stat ds_service_timer (UNIT *uptr); t_stat ds_service_timer (UNIT *uptr);
t_stat ds_reset (DEVICE *dptr); t_stat ds_reset (DEVICE *dptr);
t_stat ds_attach (UNIT *uptr, char *cptr); t_stat ds_attach (UNIT *uptr, CONST char *cptr);
t_stat ds_detach (UNIT *uptr); t_stat ds_detach (UNIT *uptr);
t_stat ds_boot (int32 unitno, DEVICE *dptr); t_stat ds_boot (int32 unitno, DEVICE *dptr);
/* MAC disc global SCP routines */ /* MAC disc global SCP routines */
t_stat ds_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat ds_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
/* MAC disc local utility routines */ /* MAC disc local utility routines */
@ -1033,7 +1034,7 @@ return SCPE_OK;
changed, so polling the drives will have no effect. changed, so polling the drives will have no effect.
*/ */
t_stat ds_attach (UNIT *uptr, char *cptr) t_stat ds_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat result; t_stat result;
@ -1196,7 +1197,7 @@ else
status. status.
*/ */
t_stat ds_load_unload (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat ds_load_unload (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
const t_bool load = (value != UNIT_UNLOAD); /* true if the heads are loading */ const t_bool load = (value != UNIT_UNLOAD); /* true if the heads are loading */

View file

@ -1,6 +1,6 @@
/* hp2100_ipl.c: HP 2000 interprocessor link simulator /* hp2100_ipl.c: HP 2000 interprocessor link simulator
Copyright (c) 2002-2015, Robert M Supnik Copyright (c) 2002-2016, 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 @@
IPLI, IPLO 12875A interprocessor link IPLI, IPLO 12875A interprocessor link
13-May-16 JDB Modified for revised SCP API function parameter types
14-Sep-15 JDB Exposed "ipl_edtdelay" via a REG_HIDDEN to allow user tuning 14-Sep-15 JDB Exposed "ipl_edtdelay" via a REG_HIDDEN to allow user tuning
Corrected typos in comments and strings Corrected typos in comments and strings
05-Jun-15 JDB Merged 3.x and 4.x versions using conditionals 05-Jun-15 JDB Merged 3.x and 4.x versions using conditionals
@ -126,11 +127,11 @@ IOHANDLER iplio;
t_stat ipl_svc (UNIT *uptr); t_stat ipl_svc (UNIT *uptr);
t_stat ipl_reset (DEVICE *dptr); t_stat ipl_reset (DEVICE *dptr);
t_stat ipl_attach (UNIT *uptr, char *cptr); t_stat ipl_attach (UNIT *uptr, CONST char *cptr);
t_stat ipl_detach (UNIT *uptr); t_stat ipl_detach (UNIT *uptr);
t_stat ipl_boot (int32 unitno, DEVICE *dptr); t_stat ipl_boot (int32 unitno, DEVICE *dptr);
t_stat ipl_dscln (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ipl_dscln (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat ipl_setdiag (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ipl_setdiag (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_bool ipl_check_conn (UNIT *uptr); t_bool ipl_check_conn (UNIT *uptr);
/* Debug flags table */ /* Debug flags table */
@ -585,7 +586,7 @@ return SCPE_OK;
attach -c - connect to ip address and port attach -c - connect to ip address and port
*/ */
t_stat ipl_attach (UNIT *uptr, char *cptr) t_stat ipl_attach (UNIT *uptr, CONST char *cptr)
{ {
SOCKET newsock; SOCKET newsock;
char *tptr = NULL; char *tptr = NULL;
@ -752,7 +753,7 @@ return SCPE_OK;
/* Disconnect routine */ /* Disconnect routine */
t_stat ipl_dscln (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ipl_dscln (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (cptr) if (cptr)
return SCPE_ARG; return SCPE_ARG;
@ -768,7 +769,7 @@ return SCPE_OK;
/* Diagnostic/normal mode routine */ /* Diagnostic/normal mode routine */
t_stat ipl_setdiag (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ipl_setdiag (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if (val) { if (val) {
ipli_unit.flags = ipli_unit.flags | UNIT_DIAG; ipli_unit.flags = ipli_unit.flags | UNIT_DIAG;

View file

@ -1,6 +1,6 @@
/* hp2100_lps.c: HP 2100 12653A/2767 line printer simulator /* hp2100_lps.c: HP 2100 12653A/2767 line printer simulator
Copyright (c) 1993-2012, Robert M. Supnik Copyright (c) 1993-2016, 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 @@
LPS 12653A 2767 line printer LPS 12653A 2767 line printer
12566B microcircuit interface with loopback diagnostic connector 12566B microcircuit interface with loopback diagnostic connector
13-May-16 JDB Modified for revised SCP API function parameter types
10-Feb-12 JDB Deprecated DEVNO in favor of SC 10-Feb-12 JDB Deprecated DEVNO in favor of SC
28-Mar-11 JDB Tidied up signal handling 28-Mar-11 JDB Tidied up signal handling
26-Oct-10 JDB Changed I/O signal handler for revised signal model 26-Oct-10 JDB Changed I/O signal handler for revised signal model
@ -210,12 +211,12 @@ IOHANDLER lpsio;
t_stat lps_svc (UNIT *uptr); t_stat lps_svc (UNIT *uptr);
t_stat lps_reset (DEVICE *dptr); t_stat lps_reset (DEVICE *dptr);
t_stat lps_restart (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat lps_restart (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
t_stat lps_poweroff (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat lps_poweroff (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
t_stat lps_poweron (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat lps_poweron (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
t_stat lps_attach (UNIT *uptr, char *cptr); t_stat lps_attach (UNIT *uptr, CONST char *cptr);
t_stat lps_set_timing (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat lps_set_timing (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat lps_show_timing (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat lps_show_timing (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* LPS data structures /* LPS data structures
@ -537,7 +538,7 @@ return SCPE_OK;
original I/O request. original I/O request.
*/ */
t_stat lps_restart (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat lps_restart (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
if (lps.control && !sim_is_active (uptr)) if (lps.control && !sim_is_active (uptr))
sim_activate (uptr, 0); /* reschedule I/O */ sim_activate (uptr, 0); /* reschedule I/O */
@ -546,7 +547,7 @@ return SCPE_OK;
/* Printer power off */ /* Printer power off */
t_stat lps_poweroff (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat lps_poweroff (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
lps_power = LPS_OFF; /* change state */ lps_power = LPS_OFF; /* change state */
if (DEBUG_PRS (lps_dev)) fputs (">>LPS set: Power state is OFF\n", sim_deb); if (DEBUG_PRS (lps_dev)) fputs (">>LPS set: Power state is OFF\n", sim_deb);
@ -555,7 +556,7 @@ return SCPE_OK;
/* Printer power on */ /* Printer power on */
t_stat lps_poweron (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat lps_poweron (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
if (lps_unit.flags & UNIT_DIAG) { /* diag mode? */ if (lps_unit.flags & UNIT_DIAG) { /* diag mode? */
lps_power = LPS_ON; /* no delay */ lps_power = LPS_ON; /* no delay */
@ -575,7 +576,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat lps_attach (UNIT *uptr, char *cptr) t_stat lps_attach (UNIT *uptr, CONST char *cptr)
{ {
lps_ccnt = lps_lcnt = 0; /* top of form */ lps_ccnt = lps_lcnt = 0; /* top of form */
lps_restart (uptr, 0, NULL, NULL); /* restart I/O if hung */ lps_restart (uptr, 0, NULL, NULL); /* restart I/O if hung */
@ -587,7 +588,7 @@ return attach_unit (uptr, cptr);
Realistic timing is factored, depending on CPU model, to account for the Realistic timing is factored, depending on CPU model, to account for the
timing method employed by the diagnostic. */ timing method employed by the diagnostic. */
t_stat lps_set_timing (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat lps_set_timing (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
uint32 i, factor = 1; uint32 i, factor = 1;
@ -603,7 +604,7 @@ return SCPE_OK;
/* Show printer timing */ /* Show printer timing */
t_stat lps_show_timing (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat lps_show_timing (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (lps_timing) fputs ("fast timing", st); if (lps_timing) fputs ("fast timing", st);
else fputs ("realistic timing", st); else fputs ("realistic timing", st);

View file

@ -1,6 +1,6 @@
/* hp2100_lpt.c: HP 2100 12845B line printer simulator /* hp2100_lpt.c: HP 2100 12845B line printer simulator
Copyright (c) 1993-2012, Robert M. Supnik Copyright (c) 1993-2016, 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 @@
LPT 12845B 2607 line printer LPT 12845B 2607 line printer
13-May-16 JDB Modified for revised SCP API function parameter types
10-Feb-12 JDB Deprecated DEVNO in favor of SC 10-Feb-12 JDB Deprecated DEVNO in favor of SC
28-Mar-11 JDB Tidied up signal handling 28-Mar-11 JDB Tidied up signal handling
26-Oct-10 JDB Changed I/O signal handler for revised signal model 26-Oct-10 JDB Changed I/O signal handler for revised signal model
@ -112,8 +113,8 @@ IOHANDLER lptio;
t_stat lpt_svc (UNIT *uptr); t_stat lpt_svc (UNIT *uptr);
t_stat lpt_reset (DEVICE *dptr); t_stat lpt_reset (DEVICE *dptr);
t_stat lpt_restart (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat lpt_restart (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
t_stat lpt_attach (UNIT *uptr, char *cptr); t_stat lpt_attach (UNIT *uptr, CONST char *cptr);
/* LPT data structures /* LPT data structures
@ -332,7 +333,7 @@ return SCPE_OK;
original I/O request. original I/O request.
*/ */
t_stat lpt_restart (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat lpt_restart (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
if (lpt.control && !sim_is_active (uptr)) if (lpt.control && !sim_is_active (uptr))
sim_activate (uptr, 0); /* reschedule I/O */ sim_activate (uptr, 0); /* reschedule I/O */
@ -342,7 +343,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat lpt_attach (UNIT *uptr, char *cptr) t_stat lpt_attach (UNIT *uptr, CONST char *cptr)
{ {
lpt_lcnt = 0; /* top of form */ lpt_lcnt = 0; /* top of form */
lpt_restart (uptr, 0, NULL, NULL); /* restart I/O if hung */ lpt_restart (uptr, 0, NULL, NULL); /* restart I/O if hung */

View file

@ -1,6 +1,6 @@
/* hp2100_mpx.c: HP 12792C eight-channel asynchronous multiplexer simulator /* hp2100_mpx.c: HP 12792C eight-channel asynchronous multiplexer simulator
Copyright (c) 2008-2014, J. David Bryan Copyright (c) 2008-2016, J. David Bryan
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 @@
MPX 12792C 8-channel multiplexer card MPX 12792C 8-channel multiplexer card
13-May-16 JDB Modified for revised SCP API function parameter types
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
10-Jan-13 MP Added DEV_MUX and additional DEVICE field values 10-Jan-13 MP Added DEV_MUX and additional DEVICE field values
28-Dec-12 JDB Allow direct attach to the poll unit only when restoring 28-Dec-12 JDB Allow direct attach to the poll unit only when restoring
@ -594,11 +595,11 @@ t_stat mpx_line_svc (UNIT *uptr);
t_stat mpx_cntl_svc (UNIT *uptr); t_stat mpx_cntl_svc (UNIT *uptr);
t_stat mpx_poll_svc (UNIT *uptr); t_stat mpx_poll_svc (UNIT *uptr);
t_stat mpx_reset (DEVICE *dptr); t_stat mpx_reset (DEVICE *dptr);
t_stat mpx_attach (UNIT *uptr, char *cptr); t_stat mpx_attach (UNIT *uptr, CONST char *cptr);
t_stat mpx_detach (UNIT *uptr); t_stat mpx_detach (UNIT *uptr);
t_stat mpx_status (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat mpx_status (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat mpx_set_frev (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat mpx_set_frev (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat mpx_show_frev (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat mpx_show_frev (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* MPX data structures. /* MPX data structures.
@ -2074,7 +2075,7 @@ return SCPE_OK;
devices in the simulator to facilitate idling. devices in the simulator to facilitate idling.
*/ */
t_stat mpx_attach (UNIT *uptr, char *cptr) t_stat mpx_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat status = SCPE_OK; t_stat status = SCPE_OK;
@ -2129,7 +2130,7 @@ return status;
/* Show multiplexer status */ /* Show multiplexer status */
t_stat mpx_status (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat mpx_status (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (mpx_poll.flags & UNIT_ATT) /* attached to socket? */ if (mpx_poll.flags & UNIT_ATT) /* attached to socket? */
fprintf (st, "attached to port %s, ", mpx_poll.filename); fprintf (st, "attached to port %s, ", mpx_poll.filename);
@ -2148,7 +2149,7 @@ return SCPE_OK;
will enable changing the firmware revision. will enable changing the firmware revision.
*/ */
t_stat mpx_set_frev (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat mpx_set_frev (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if ((cptr == NULL) || /* no parameter? */ if ((cptr == NULL) || /* no parameter? */
(*cptr < 'C') || (*cptr > 'D') || /* or not C or D? */ (*cptr < 'C') || (*cptr > 'D') || /* or not C or D? */
@ -2168,7 +2169,7 @@ else {
/* Show firmware revision */ /* Show firmware revision */
t_stat mpx_show_frev (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat mpx_show_frev (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (mpx_dev.flags & DEV_REV_D) if (mpx_dev.flags & DEV_REV_D)
fputs ("12792D", st); fputs ("12792D", st);

View file

@ -1,6 +1,6 @@
/* hp2100_ms.c: HP 2100 13181A/13183A magnetic tape simulator /* hp2100_ms.c: HP 2100 13181A/13183A magnetic tape simulator
Copyright (c) 1993-2014, Robert M. Supnik Copyright (c) 1993-2016, 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 @@
MS 13181A 7970B 800bpi nine track magnetic tape MS 13181A 7970B 800bpi nine track magnetic tape
13183A 7970E 1600bpi nine track magnetic tape 13183A 7970E 1600bpi nine track magnetic tape
13-May-16 JDB Modified for revised SCP API function parameter types
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Use T_ADDR_FMT with t_addr values for 64-bit compatibility 24-Dec-14 JDB Use T_ADDR_FMT with t_addr values for 64-bit compatibility
Added casts for explicit downward conversions Added casts for explicit downward conversions
@ -235,18 +236,18 @@ IOHANDLER mscio;
t_stat msc_svc (UNIT *uptr); t_stat msc_svc (UNIT *uptr);
t_stat msc_reset (DEVICE *dptr); t_stat msc_reset (DEVICE *dptr);
t_stat msc_attach (UNIT *uptr, char *cptr); t_stat msc_attach (UNIT *uptr, CONST char *cptr);
t_stat msc_detach (UNIT *uptr); t_stat msc_detach (UNIT *uptr);
t_stat msc_online (UNIT *uptr, int32 value, char *cptr, void *desc); t_stat msc_online (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
t_stat msc_boot (int32 unitno, DEVICE *dptr); t_stat msc_boot (int32 unitno, DEVICE *dptr);
t_stat ms_write_gap (UNIT *uptr); t_stat ms_write_gap (UNIT *uptr);
t_stat ms_map_err (UNIT *uptr, t_stat st); t_stat ms_map_err (UNIT *uptr, t_stat st);
t_stat ms_settype (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ms_settype (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat ms_showtype (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat ms_showtype (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat ms_set_timing (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ms_set_timing (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat ms_show_timing (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat ms_show_timing (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
t_stat ms_set_reelsize (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat ms_set_reelsize (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat ms_show_reelsize (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat ms_show_reelsize (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
void ms_config_timing (void); void ms_config_timing (void);
char *ms_cmd_name (uint32 cmd); char *ms_cmd_name (uint32 cmd);
t_stat ms_clear (void); t_stat ms_clear (void);
@ -1061,7 +1062,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat msc_attach (UNIT *uptr, char *cptr) t_stat msc_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;
@ -1082,7 +1083,7 @@ return sim_tape_detach (uptr); /* detach unit */
/* Online routine */ /* Online routine */
t_stat msc_online (UNIT *uptr, int32 value, char *cptr, void *desc) t_stat msc_online (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
if (uptr->flags & UNIT_ATT) return SCPE_OK; if (uptr->flags & UNIT_ATT) return SCPE_OK;
else return SCPE_UNATT; else return SCPE_UNATT;
@ -1101,7 +1102,7 @@ for (i = 0; i < (sizeof (timers) / sizeof (timers[0])); i++)
/* Set controller timing */ /* Set controller timing */
t_stat ms_set_timing (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ms_set_timing (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if ((val < 0) || (val > 1) || (cptr != NULL)) return SCPE_ARG; if ((val < 0) || (val > 1) || (cptr != NULL)) return SCPE_ARG;
ms_timing = val; ms_timing = val;
@ -1111,7 +1112,7 @@ return SCPE_OK;
/* Show controller timing */ /* Show controller timing */
t_stat ms_show_timing (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat ms_show_timing (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (ms_timing) fputs ("fast timing", st); if (ms_timing) fputs ("fast timing", st);
else fputs ("realistic timing", st); else fputs ("realistic timing", st);
@ -1120,7 +1121,7 @@ return SCPE_OK;
/* Set controller type */ /* Set controller type */
t_stat ms_settype (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ms_settype (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 i; int32 i;
@ -1139,7 +1140,7 @@ return SCPE_OK;
/* Show controller type */ /* Show controller type */
t_stat ms_showtype (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat ms_showtype (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (ms_ctype == A13183) if (ms_ctype == A13183)
fprintf (st, "13183A"); fprintf (st, "13183A");
@ -1153,7 +1154,7 @@ return SCPE_OK;
val = 0 -> SET MSCn CAPACITY=n val = 0 -> SET MSCn CAPACITY=n
val = 1 -> SET MSCn REEL=n */ val = 1 -> SET MSCn REEL=n */
t_stat ms_set_reelsize (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat ms_set_reelsize (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 reel; int32 reel;
t_stat status; t_stat status;
@ -1198,7 +1199,7 @@ return SCPE_OK;
val = 0 -> SHOW MSC or SHOW MSCn or SHOW MSCn CAPACITY val = 0 -> SHOW MSC or SHOW MSCn or SHOW MSCn CAPACITY
val = 1 -> SHOW MSCn REEL */ val = 1 -> SHOW MSCn REEL */
t_stat ms_show_reelsize (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat ms_show_reelsize (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
t_stat status = SCPE_OK; t_stat status = SCPE_OK;

View file

@ -1,6 +1,6 @@
/* hp2100_mt.c: HP 2100 12559A magnetic tape simulator /* hp2100_mt.c: HP 2100 12559A magnetic tape simulator
Copyright (c) 1993-2014, Robert M. Supnik Copyright (c) 1993-2016, 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 @@
MT 12559A 3030 nine track magnetic tape MT 12559A 3030 nine track magnetic tape
13-May-16 JDB Modified for revised SCP API function parameter types
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
10-Jan-13 MP Added DEV_TAPE to DEVICE flags 10-Jan-13 MP Added DEV_TAPE to DEVICE flags
09-May-12 JDB Separated assignments from conditional expressions 09-May-12 JDB Separated assignments from conditional expressions
@ -145,7 +146,7 @@ IOHANDLER mtcio;
t_stat mtc_svc (UNIT *uptr); t_stat mtc_svc (UNIT *uptr);
t_stat mt_reset (DEVICE *dptr); t_stat mt_reset (DEVICE *dptr);
t_stat mtc_attach (UNIT *uptr, char *cptr); t_stat mtc_attach (UNIT *uptr, CONST char *cptr);
t_stat mtc_detach (UNIT *uptr); t_stat mtc_detach (UNIT *uptr);
t_stat mt_map_err (UNIT *uptr, t_stat st); t_stat mt_map_err (UNIT *uptr, t_stat st);
t_stat mt_clear (void); t_stat mt_clear (void);
@ -678,7 +679,7 @@ return SCPE_OK;
/* Attach routine */ /* Attach routine */
t_stat mtc_attach (UNIT *uptr, char *cptr) t_stat mtc_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat r; t_stat r;

View file

@ -1,6 +1,6 @@
/* hp2100_mux.c: HP 2100 12920A terminal multiplexor simulator /* hp2100_mux.c: HP 2100 12920A terminal multiplexor simulator
Copyright (c) 2002-2015, Robert M Supnik Copyright (c) 2002-2016, 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 @@
MUX,MUXL,MUXM 12920A terminal multiplexor MUX,MUXL,MUXM 12920A terminal multiplexor
13-May-16 JDB Modified for revised SCP API function parameter types
29-Jun-15 JDB Corrected typo in RTS macro definition 29-Jun-15 JDB Corrected typo in RTS macro definition
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
10-Jan-13 MP Added DEV_MUX and additional DEVICE field values 10-Jan-13 MP Added DEV_MUX and additional DEVICE field values
@ -328,9 +329,9 @@ IOHANDLER muxcio;
t_stat muxi_svc (UNIT *uptr); t_stat muxi_svc (UNIT *uptr);
t_stat muxo_svc (UNIT *uptr); t_stat muxo_svc (UNIT *uptr);
t_stat muxc_reset (DEVICE *dptr); t_stat muxc_reset (DEVICE *dptr);
t_stat mux_attach (UNIT *uptr, char *cptr); t_stat mux_attach (UNIT *uptr, CONST char *cptr);
t_stat mux_detach (UNIT *uptr); t_stat mux_detach (UNIT *uptr);
t_stat mux_setdiag (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat mux_setdiag (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
/* MUXL/MUXU device information block. /* MUXL/MUXU device information block.
@ -1339,7 +1340,7 @@ return SCPE_OK;
/* Attach master unit */ /* Attach master unit */
t_stat mux_attach (UNIT *uptr, char *cptr) t_stat mux_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat status = SCPE_OK; t_stat status = SCPE_OK;
@ -1390,7 +1391,7 @@ return r;
here.) here.)
*/ */
t_stat mux_setdiag (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat mux_setdiag (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 ln; int32 ln;

View file

@ -1,6 +1,6 @@
/* hp2100_pif.c: HP 12620A/12936A privileged interrupt fence simulator /* hp2100_pif.c: HP 12620A/12936A privileged interrupt fence simulator
Copyright (c) 2008-2012, J. David Bryan Copyright (c) 2008-2016, J. David Bryan
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 @@
PIF 12620A/12936A privileged interrupt fence PIF 12620A/12936A privileged interrupt fence
13-May-16 JDB Modified for revised SCP API function parameter types
10-Feb-12 JDB Deprecated DEVNO in favor of SC 10-Feb-12 JDB Deprecated DEVNO in favor of SC
28-Mar-11 JDB Tidied up signal handling 28-Mar-11 JDB Tidied up signal handling
26-Oct-10 JDB Changed I/O signal handler for revised signal model 26-Oct-10 JDB Changed I/O signal handler for revised signal model
@ -118,8 +119,8 @@ struct {
IOHANDLER pif_io; IOHANDLER pif_io;
t_stat pif_reset (DEVICE *dptr); t_stat pif_reset (DEVICE *dptr);
t_stat pif_set_card (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat pif_set_card (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat pif_show_card (FILE *st, UNIT *uptr, int32 val, void *desc); t_stat pif_show_card (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* PIF data structures. /* PIF data structures.
@ -347,7 +348,7 @@ return SCPE_OK;
val == 1 --> set to 12620A (RTE PIF) val == 1 --> set to 12620A (RTE PIF)
*/ */
t_stat pif_set_card (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat pif_set_card (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
if ((val < 0) || (val > 1) || (cptr != NULL)) /* sanity check */ if ((val < 0) || (val > 1) || (cptr != NULL)) /* sanity check */
return SCPE_ARG; /* bad argument */ return SCPE_ARG; /* bad argument */
@ -363,7 +364,7 @@ return SCPE_OK;
/* Show card type */ /* Show card type */
t_stat pif_show_card (FILE *st, UNIT *uptr, int32 val, void *desc) t_stat pif_show_card (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
if (pif_dev.flags & DEV_12936) if (pif_dev.flags & DEV_12936)
fputs ("12936A", st); fputs ("12936A", st);

View file

@ -1,6 +1,6 @@
/* hp2100_stddev.c: HP2100 standard devices simulator /* hp2100_stddev.c: HP2100 standard devices simulator
Copyright (c) 1993-2014, Robert M. Supnik Copyright (c) 1993-2016, 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"),
@ -28,6 +28,7 @@
TTY 12531C buffered teleprinter interface TTY 12531C buffered teleprinter interface
TBG 12539C time base generator TBG 12539C time base generator
13-May-16 JDB Modified for revised SCP API function parameter types
30-Dec-14 JDB Added S-register parameters to ibl_copy 30-Dec-14 JDB Added S-register parameters to ibl_copy
24-Dec-14 JDB Added casts for explicit downward conversions 24-Dec-14 JDB Added casts for explicit downward conversions
28-Dec-12 JDB Allocate the TBG logical name during power-on reset 28-Dec-12 JDB Allocate the TBG logical name during power-on reset
@ -188,7 +189,7 @@ DEVICE ptr_dev, ptp_dev, tty_dev, clk_dev;
IOHANDLER ptrio; IOHANDLER ptrio;
t_stat ptr_svc (UNIT *uptr); t_stat ptr_svc (UNIT *uptr);
t_stat ptr_attach (UNIT *uptr, char *cptr); t_stat ptr_attach (UNIT *uptr, CONST char *cptr);
t_stat ptr_reset (DEVICE *dptr); t_stat ptr_reset (DEVICE *dptr);
t_stat ptr_boot (int32 unitno, DEVICE *dptr); t_stat ptr_boot (int32 unitno, DEVICE *dptr);
@ -200,8 +201,8 @@ IOHANDLER ttyio;
t_stat tti_svc (UNIT *uptr); t_stat tti_svc (UNIT *uptr);
t_stat tto_svc (UNIT *uptr); t_stat tto_svc (UNIT *uptr);
t_stat tty_reset (DEVICE *dptr); t_stat tty_reset (DEVICE *dptr);
t_stat tty_set_opt (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat tty_set_opt (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat tty_set_alf (UNIT *uptr, int32 val, char *cptr, void *desc); t_stat tty_set_alf (UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat tto_out (int32 c); t_stat tto_out (int32 c);
t_stat ttp_out (int32 c); t_stat ttp_out (int32 c);
@ -538,7 +539,7 @@ return SCPE_OK;
/* Attach routine - clear the trailer counter */ /* Attach routine - clear the trailer counter */
t_stat ptr_attach (UNIT *uptr, char *cptr) t_stat ptr_attach (UNIT *uptr, CONST char *cptr)
{ {
ptr_trlcnt = 0; ptr_trlcnt = 0;
return attach_unit (uptr, cptr); return attach_unit (uptr, cptr);
@ -991,7 +992,7 @@ return SCPE_OK;
} }
t_stat tty_set_opt (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat tty_set_opt (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 u = uptr - tty_unit; int32 u = uptr - tty_unit;
@ -1003,7 +1004,7 @@ return SCPE_OK;
} }
t_stat tty_set_alf (UNIT *uptr, int32 val, char *cptr, void *desc) t_stat tty_set_alf (UNIT *uptr, int32 val, CONST char *cptr, void *desc)
{ {
int32 u = uptr - tty_unit; int32 u = uptr - tty_unit;

View file

@ -1,6 +1,6 @@
/* hp2100_sys.c: HP 2100 simulator interface /* hp2100_sys.c: HP 2100 simulator interface
Copyright (c) 1993-2015, Robert M. Supnik Copyright (c) 1993-2016, 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"),
@ -23,6 +23,7 @@
used in advertising or otherwise to promote the sale, use or other dealings used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from Robert M Supnik. in this Software without prior written authorization from Robert M Supnik.
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 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 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 24-Dec-14 JDB Added casts to t_addr and t_value for 64-bit compatibility
@ -67,7 +68,6 @@
#include <ctype.h> #include <ctype.h>
#include "hp2100_defs.h" #include "hp2100_defs.h"
#include "hp2100_cpu.h" #include "hp2100_cpu.h"
#include "sim_rev.h"
#if (SIM_MAJOR >= 4) #if (SIM_MAJOR >= 4)
@ -208,7 +208,7 @@ if ((c2 = fgetc (fileref)) == EOF) return -1;
return ((c1 & 0377) << 8) | (c2 & 0377); return ((c1 & 0377) << 8) | (c2 & 0377);
} }
t_stat sim_load (FILE *fileref, char *cptr, char *fnam, int flag) t_stat sim_load (FILE *fileref, CONST char *cptr, CONST char *fnam, int flag)
{ {
int32 origin, csum, zerocnt, count, word, i; int32 origin, csum, zerocnt, count, word, i;
@ -584,7 +584,7 @@ return SCPE_ARG;
-1 if error -1 if error
*/ */
static int32 get_addr (char *cptr) static int32 get_addr (CONST char *cptr)
{ {
int32 d; int32 d;
t_stat r; t_stat r;
@ -614,11 +614,12 @@ return d;
status = error status status = error status
*/ */
t_stat parse_sym (char *iptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw) t_stat parse_sym (CONST char *iptr, t_addr addr, UNIT *uptr, t_value *val, int32 sw)
{ {
int32 cflag, d, i, j, k, clef, tbits; int32 cflag, d, i, j, k, clef, tbits;
t_stat r, ret; t_stat r, ret;
char *cptr, gbuf[CBUFSIZE]; CONST char *cptr;
char gbuf[CBUFSIZE];
cflag = (uptr == NULL) || (uptr == &cpu_unit); cflag = (uptr == NULL) || (uptr == &cpu_unit);
while (isspace ((int) *iptr)) iptr++; /* absorb spaces */ while (isspace ((int) *iptr)) iptr++; /* absorb spaces */
@ -825,7 +826,7 @@ else { /* printable character *
/* Set select code */ /* Set select code */
t_stat hp_setsc (UNIT *uptr, int32 num, char *cptr, void *desc) t_stat hp_setsc (UNIT *uptr, int32 num, CONST char *cptr, void *desc)
{ {
DEVICE *dptr = (DEVICE *) desc; DEVICE *dptr = (DEVICE *) desc;
DIB *dibptr; DIB *dibptr;
@ -860,9 +861,9 @@ return SCPE_OK;
/* Show select code */ /* Show select code */
t_stat hp_showsc (FILE *st, UNIT *uptr, int32 num, void *desc) t_stat hp_showsc (FILE *st, UNIT *uptr, int32 num, CONST void *desc)
{ {
DEVICE *dptr = (DEVICE *) desc; const DEVICE *dptr = (const DEVICE *) desc;
DIB *dibptr; DIB *dibptr;
int32 i; int32 i;
@ -885,7 +886,7 @@ return SCPE_OK;
/* Set device number */ /* Set device number */
t_stat hp_setdev (UNIT *uptr, int32 num, char *cptr, void *desc) t_stat hp_setdev (UNIT *uptr, int32 num, CONST char *cptr, void *desc)
{ {
return hp_setsc (uptr, num, cptr, desc); return hp_setsc (uptr, num, cptr, desc);
} }
@ -893,7 +894,7 @@ return hp_setsc (uptr, num, cptr, desc);
/* Show device number */ /* Show device number */
t_stat hp_showdev (FILE *st, UNIT *uptr, int32 num, void *desc) t_stat hp_showdev (FILE *st, UNIT *uptr, int32 num, CONST void *desc)
{ {
t_stat result; t_stat result;

View file

@ -26,6 +26,7 @@
ATCD,ATCC HP 30032B Asynchronous Terminal Controller ATCD,ATCC HP 30032B Asynchronous Terminal Controller
13-May-16 JDB Modified for revised SCP API function parameter types
26-Aug-15 JDB First release version 26-Aug-15 JDB First release version
31-Jul-15 JDB Passes the terminal control diagnostic (D438A) 31-Jul-15 JDB Passes the terminal control diagnostic (D438A)
11-Aug-14 JDB Passes the terminal data diagnostic (D427A) 11-Aug-14 JDB Passes the terminal data diagnostic (D427A)
@ -754,15 +755,15 @@ static uint8 cntl_param [TERM_COUNT]; /* ES2/ES1/S2/S1 parameter RAM *
static CNTLR_INTRF atcd_interface; static CNTLR_INTRF atcd_interface;
static CNTLR_INTRF atcc_interface; static CNTLR_INTRF atcc_interface;
static t_stat atc_set_endis (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat atc_set_endis (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat atc_set_mode (UNIT *uptr, int32 value, char *cptr, void *desc); static t_stat atc_set_mode (UNIT *uptr, int32 value, CONST char *cptr, void *desc);
static t_stat atc_show_mode (FILE *st, UNIT *uptr, int32 value, void *desc); static t_stat atc_show_mode (FILE *st, UNIT *uptr, int32 value, CONST void *desc);
static t_stat atc_show_status (FILE *st, UNIT *uptr, int32 value, void *desc); static t_stat atc_show_status (FILE *st, UNIT *uptr, int32 value, CONST void *desc);
static t_stat atcd_reset (DEVICE *dptr); static t_stat atcd_reset (DEVICE *dptr);
static t_stat atcc_reset (DEVICE *dptr); static t_stat atcc_reset (DEVICE *dptr);
static t_stat atcd_attach (UNIT *uptr, char *cptr); static t_stat atcd_attach (UNIT *uptr, CONST char *cptr);
static t_stat atcd_detach (UNIT *uptr); static t_stat atcd_detach (UNIT *uptr);
@ -1550,7 +1551,7 @@ return IORETURN (outbound_signals, outbound_value); /* return the outbound s
as appropriate. as appropriate.
*/ */
static t_stat atc_set_endis (UNIT *uptr, int32 value, char *cptr, void *desc) static t_stat atc_set_endis (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
if (value) /* if this is an ENABLE request */ if (value) /* if this is an ENABLE request */
if (atcd_dev.flags & DEV_DIS) { /* then if the device is disabled */ if (atcd_dev.flags & DEV_DIS) { /* then if the device is disabled */
@ -1593,7 +1594,7 @@ return atcd_reset (&atcd_dev); /* reset the TDI and res
the internal loopback connections from the send to the receive channels. the internal loopback connections from the send to the receive channels.
*/ */
static t_stat atc_set_mode (UNIT *uptr, int32 value, char *cptr, void *desc) static t_stat atc_set_mode (UNIT *uptr, int32 value, CONST char *cptr, void *desc)
{ {
DEVICE * const dptr = (DEVICE *) desc; /* a pointer to the device */ DEVICE * const dptr = (DEVICE *) desc; /* a pointer to the device */
@ -1634,9 +1635,9 @@ return SCPE_OK;
the TCI. The unit pointer is not used. the TCI. The unit pointer is not used.
*/ */
static t_stat atc_show_mode (FILE *st, UNIT *uptr, int32 value, void *desc) static t_stat atc_show_mode (FILE *st, UNIT *uptr, int32 value, CONST void *desc)
{ {
DEVICE * const dptr = (DEVICE *) desc; /* a pointer to the device */ const DEVICE * const dptr = (const DEVICE *) desc; /* a pointer to the device */
if (value == 0) /* if this is the TDI */ if (value == 0) /* if this is the TDI */
if (dptr->flags & DEV_REALTIME) /* then if the real-time flag is set */ if (dptr->flags & DEV_REALTIME) /* then if the real-time flag is set */
@ -1661,7 +1662,7 @@ return SCPE_OK;
and value parameters are not used. and value parameters are not used.
*/ */
static t_stat atc_show_status (FILE *st, UNIT *uptr, int32 value, void *desc) static t_stat atc_show_status (FILE *st, UNIT *uptr, int32 value, CONST void *desc)
{ {
if (poll_unit.flags & UNIT_ATT) /* if the poll unit is attached */ if (poll_unit.flags & UNIT_ATT) /* if the poll unit is attached */
fprintf (st, "attached to port %s, ", /* then report it */ fprintf (st, "attached to port %s, ", /* then report it */
@ -1779,7 +1780,7 @@ return status;
saved session via the RESTORE command. saved session via the RESTORE command.
*/ */
static t_stat atcd_attach (UNIT *uptr, char *cptr) static t_stat atcd_attach (UNIT *uptr, CONST char *cptr)
{ {
t_stat status; t_stat status;

View file

@ -25,6 +25,7 @@
CPU HP 3000 Series III Central Processing Unit CPU HP 3000 Series III Central Processing Unit
13-May-16 JDB Modified for revised SCP API function parameter types
11-Mar-16 JDB Fixed byte EA calculations with negative indexes 11-Mar-16 JDB Fixed byte EA calculations with negative indexes
22-Dec-15 JDB First release version 22-Dec-15 JDB First release version
01-Apr-15 JDB First successful run of MPE-V/R through account login 01-Apr-15 JDB First successful run of MPE-V/R through account login
@ -934,13 +935,13 @@ static t_stat cpu_reset (DEVICE *dptr);
static t_stat cpu_examine (t_value *eval_array, t_addr address, UNIT *uptr, int32 switches); static t_stat cpu_examine (t_value *eval_array, t_addr address, UNIT *uptr, int32 switches);
static t_stat cpu_deposit (t_value value, t_addr address, UNIT *uptr, int32 switches); static t_stat cpu_deposit (t_value value, t_addr address, UNIT *uptr, int32 switches);
static t_stat set_stops (UNIT *uptr, int32 option, char *cptr, void *desc); static t_stat set_stops (UNIT *uptr, int32 option, CONST char *cptr, void *desc);
static t_stat set_size (UNIT *uptr, int32 new_size, char *cptr, void *desc); static t_stat set_size (UNIT *uptr, int32 new_size, CONST char *cptr, void *desc);
static t_stat set_model (UNIT *uptr, int32 new_model, char *cptr, void *desc); static t_stat set_model (UNIT *uptr, int32 new_model, CONST char *cptr, void *desc);
static t_stat set_option (UNIT *uptr, int32 new_option, char *cptr, void *desc); static t_stat set_option (UNIT *uptr, int32 new_option, CONST char *cptr, void *desc);
static t_stat show_stops (FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat show_stops (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
static t_stat show_speed (FILE *st, UNIT *uptr, int32 val, void *desc); static t_stat show_speed (FILE *st, UNIT *uptr, int32 val, CONST void *desc);
/* CPU local utility routine declarations */ /* CPU local utility routine declarations */
@ -3286,7 +3287,7 @@ else { /* otherwise */
execution only. execution only.
*/ */
static t_stat set_stops (UNIT *uptr, int32 option, char *cptr, void *desc) static t_stat set_stops (UNIT *uptr, int32 option, CONST char *cptr, void *desc)
{ {
char gbuf [CBUFSIZE]; char gbuf [CBUFSIZE];
uint32 stop; uint32 stop;
@ -3352,9 +3353,9 @@ return SCPE_OK; /* the stops were succes
explicitly zeroed. explicitly zeroed.
*/ */
static t_stat set_size (UNIT *uptr, int32 new_size, char *cptr, void *desc) static t_stat set_size (UNIT *uptr, int32 new_size, CONST char *cptr, void *desc)
{ {
static const char confirm [] = "Really truncate memory [N]?"; static CONST char confirm [] = "Really truncate memory [N]?";
const uint32 model = CPU_MODEL (uptr->flags); /* the current CPU model index */ const uint32 model = CPU_MODEL (uptr->flags); /* the current CPU model index */
uint32 address; uint32 address;
@ -3399,7 +3400,7 @@ return SCPE_OK; /* confirm that the chan
initial CPU model. The current memory size will be 0 when this call is made. initial CPU model. The current memory size will be 0 when this call is made.
*/ */
static t_stat set_model (UNIT *uptr, int32 new_model, char *cptr, void *desc) static t_stat set_model (UNIT *uptr, int32 new_model, CONST char *cptr, void *desc)
{ {
const uint32 new_index = CPU_MODEL (new_model); /* the new index into the CPU features table */ const uint32 new_index = CPU_MODEL (new_model); /* the new index into the CPU features table */
uint32 new_memsize; uint32 new_memsize;
@ -3436,7 +3437,7 @@ return status; /* return the validation
rejected. rejected.
*/ */
static t_stat set_option (UNIT *uptr, int32 new_option, char *cptr, void *desc) static t_stat set_option (UNIT *uptr, int32 new_option, CONST char *cptr, void *desc)
{ {
const uint32 model = CPU_MODEL (uptr->flags); /* the current CPU model index */ const uint32 model = CPU_MODEL (uptr->flags); /* the current CPU model index */
@ -3460,7 +3461,7 @@ else /* otherwise */
newline to the output before returning. newline to the output before returning.
*/ */
static t_stat show_stops (FILE *st, UNIT *uptr, int32 val, void *desc) static t_stat show_stops (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
uint32 stop; uint32 stop;
t_bool need_spacer = FALSE; t_bool need_spacer = FALSE;
@ -3499,7 +3500,7 @@ return SCPE_OK; /* report the success of
(which suspends the normal fetch/execute instruction cycle). (which suspends the normal fetch/execute instruction cycle).
*/ */
static t_stat show_speed (FILE *st, UNIT *uptr, int32 val, void *desc) static t_stat show_speed (FILE *st, UNIT *uptr, int32 val, CONST void *desc)
{ {
fprintf (st, "Simulation speed = %dx\n", cpu_speed); /* display the current CPU speed */ fprintf (st, "Simulation speed = %dx\n", cpu_speed); /* display the current CPU speed */
return SCPE_OK; /* and report success */ return SCPE_OK; /* and report success */

Some files were not shown because too many files have changed in this diff Show more