1
0
mirror of https://github.com/simh/simh.git synced 2026-04-26 12:07:16 +00:00

Issue cleanup after v3.9-0-rc3 merge

This commit is contained in:
Mark Pizzolato
2012-04-23 06:02:37 -07:00
parent 73bd8c36e7
commit e9aa507082
9 changed files with 123 additions and 75 deletions

View File

@@ -144,7 +144,7 @@ t_stat BOOTROM_config (UNIT *uptr, int32 val, char *cptr, void *desc)
if (val == UNIT_NONE)
BOOTROM_unit.capac = 0; /* set EPROM size */
else
BOOTROM_unit.capac = 0x200 << (val >> UNIT_V_MSIZE) - 1; /* set EPROM size */
BOOTROM_unit.capac = 0x200 << ((val >> UNIT_V_MSIZE) - 1); /* set EPROM size */
if (BOOTROM_unit.filebuf) { /* free buffer */
free (BOOTROM_unit.filebuf);
BOOTROM_unit.filebuf = NULL;
@@ -161,9 +161,9 @@ t_stat BOOTROM_config (UNIT *uptr, int32 val, char *cptr, void *desc)
t_stat BOOTROM_reset (DEVICE *dptr)
{
int j, c;
t_addr j;
int c;
FILE *fp;
t_stat r;
if (BOOTROM_dev.dctrl & DEBUG_flow)
printf("BOOTROM_reset: \n");
@@ -195,7 +195,7 @@ t_stat BOOTROM_reset (DEVICE *dptr)
j = 0; /* load EPROM file */
c = fgetc(fp);
while (c != EOF) {
*(uint8 *)(BOOTROM_unit.filebuf + j++) = c & 0xFF;
*((uint8 *)(BOOTROM_unit.filebuf) + j++) = c & 0xFF;
c = fgetc(fp);
if (j > BOOTROM_unit.capac) {
printf("\tImage is too large - Load truncated!!!\n");
@@ -222,7 +222,7 @@ int32 BOOTROM_get_mbyte(int32 offset)
}
if (BOOTROM_dev.dctrl & DEBUG_read)
printf("BOOTROM_get_mbyte: offset=%04X\n", offset);
val = *(uint8 *)(BOOTROM_unit.filebuf + offset) & 0xFF;
val = *((uint8 *)(BOOTROM_unit.filebuf) + offset) & 0xFF;
if (BOOTROM_dev.dctrl & DEBUG_read)
printf("BOOTROM_get_mbyte: Normal val=%02X\n", val);
return val;

View File

@@ -368,7 +368,6 @@ t_stat dsk_reset (DEVICE *dptr)
int32 fdcdrv(int32 io, int32 data)
{
static long pos;
char buf[128];
if (io) { /* write to DC-4 drive register */
if (dsk_dev.dctrl & DEBUG_write)
@@ -394,9 +393,9 @@ int32 fdcdrv(int32 io, int32 data)
sim_fread(dsk_unit[cur_dsk].filebuf, SECSIZ, 1, dsk_unit[cur_dsk].fileref); /* read in buffer */
dsk_unit[cur_dsk].u3 |= BUSY | DRQ; /* set DRQ & BUSY */
dsk_unit[cur_dsk].pos = 0; /* clear counter */
spt = *(uint8 *)(dsk_unit[cur_dsk].filebuf + MAXSEC) & 0xFF;
spt = *((uint8 *)(dsk_unit[cur_dsk].filebuf) + MAXSEC) & 0xFF;
heds = 0;
cpd = *(uint8 *)(dsk_unit[cur_dsk].filebuf + MAXCYL) & 0xFF;
cpd = *((uint8 *)(dsk_unit[cur_dsk].filebuf) + MAXCYL) & 0xFF;
trksiz = spt * SECSIZ;
dsksiz = trksiz * cpd;
if (dsk_dev.dctrl & DEBUG_read)
@@ -538,7 +537,7 @@ int32 fdcdata(int32 io, int32 data)
if (dsk_unit[cur_dsk].pos < SECSIZ) { /* copy bytes to buffer */
if (dsk_dev.dctrl & DEBUG_write)
printf("\nfdcdata: Writing byte %d of %02X", dsk_unit[cur_dsk].pos, data);
*(uint8 *)(dsk_unit[cur_dsk].filebuf + dsk_unit[cur_dsk].pos) = data; /* byte into buffer */
*((uint8 *)(dsk_unit[cur_dsk].filebuf) + dsk_unit[cur_dsk].pos) = data; /* byte into buffer */
dsk_unit[cur_dsk].pos++; /* step counter */
if (dsk_unit[cur_dsk].pos == SECSIZ) {
dsk_unit[cur_dsk].u3 &= ~(BUSY | DRQ);
@@ -555,7 +554,7 @@ int32 fdcdata(int32 io, int32 data)
if (dsk_unit[cur_dsk].pos < SECSIZ) { /* copy bytes from buffer */
if (dsk_dev.dctrl & DEBUG_read)
printf("\nfdcdata: Reading byte %d u3=%02X", dsk_unit[cur_dsk].pos, dsk_unit[cur_dsk].u3);
val = *(uint8 *)(dsk_unit[cur_dsk].filebuf + dsk_unit[cur_dsk].pos) & 0xFF;
val = *((uint8 *)(dsk_unit[cur_dsk].filebuf) + dsk_unit[cur_dsk].pos) & 0xFF;
dsk_unit[cur_dsk].pos++; /* step counter */
if (dsk_unit[cur_dsk].pos == SECSIZ) { /* done? */
dsk_unit[cur_dsk].u3 &= ~(BUSY | DRQ); /* clear flags */

View File

@@ -121,7 +121,7 @@ t_stat i2716_attach (UNIT *uptr, char *cptr)
printf("\tOpen file\n");
fp = fopen(uptr->filename, "rb"); /* open EPROM file */
if (fp == NULL) {
printf("i2716%d: Unable to open ROM file %s\n", uptr - i2716_dev.units, uptr->filename);
printf("i2716%d: Unable to open ROM file %s\n", (int)(uptr - i2716_dev.units), uptr->filename);
printf("\tNo ROM image loaded!!!\n");
return SCPE_OK;
}
@@ -130,7 +130,7 @@ t_stat i2716_attach (UNIT *uptr, char *cptr)
j = 0; /* load EPROM file */
c = fgetc(fp);
while (c != EOF) {
*(uint8 *)(uptr->filebuf + j++) = c & 0xFF;
*((uint8 *)(uptr->filebuf) + j++) = c & 0xFF;
c = fgetc(fp);
if (j > 2048) {
printf("\tImage is too large - Load truncated!!!\n");
@@ -150,8 +150,7 @@ t_stat i2716_attach (UNIT *uptr, char *cptr)
t_stat i2716_reset (DEVICE *dptr)
{
int32 i, j, c, base;
t_stat r;
int32 i, base;
UNIT *uptr;
if (i2716_dev.dctrl & DEBUG_flow)
@@ -207,7 +206,7 @@ int32 i2716_get_mbyte(int32 offset)
printf("i2716_get_mbyte: EPROM not configured\n");
return 0xFF;
} else {
val = *(uint8 *)(uptr->filebuf + (offset - org));
val = *((uint8 *)(uptr->filebuf) + (offset - org));
if (i2716_dev.dctrl & DEBUG_read)
printf(" val=%04X\n", val);
return (val & 0xFF);

View File

@@ -120,7 +120,7 @@ int32 int_req = 0; /* Interrupt request */
int32 mem_fault = 0; /* memory fault flag */
extern int32 sim_int_char;
extern int32 sim_brk_types, sim_brk_dflt, sim_brk_summ; /* breakpoint info */
extern uint32 sim_brk_types, sim_brk_dflt, sim_brk_summ; /* breakpoint info */
/* function prototypes */
@@ -1892,7 +1892,7 @@ void condevalVa(int32 op1, int32 op2)
{
if (get_flag(CF))
COND_SET_FLAG_V(((op1 & 0x80) && (op2 & 0x80)) || (
(op1 & 0x80 == 0) && (op2 & 0x80 == 0)));
((op1 & 0x80) == 0) && ((op2 & 0x80) == 0)));
}
/* test and set V for subtraction */
@@ -1900,8 +1900,8 @@ void condevalVa(int32 op1, int32 op2)
void condevalVs(int32 op1, int32 op2)
{
if (get_flag(CF))
COND_SET_FLAG_V(((op1 & 0x80) && (op2 & 0x80 == 0)) ||
((op1 & 0x80 == 0) && (op2 & 0x80)));
COND_SET_FLAG_V(((op1 & 0x80) && ((op2 & 0x80) == 0)) ||
(((op1 & 0x80) == 0) && (op2 & 0x80)));
}
/* calls from the simulator */

View File

@@ -111,12 +111,12 @@ t_stat m6810_reset (DEVICE *dptr)
int32 m6810_get_mbyte(int32 offset)
{
int32 val, org, len;
int32 val;
if (m6810_dev.dctrl & DEBUG_read)
printf("m6810_get_mbyte: offset=%04X\n", offset);
if (offset < m6810_unit.capac) {
val = *(uint8 *)(m6810_unit.filebuf + offset) & 0xFF;
if (((t_addr)offset) < m6810_unit.capac) {
val = *((uint8 *)(m6810_unit.filebuf) + offset) & 0xFF;
if (m6810_dev.dctrl & DEBUG_read)
printf("val=%04X\n", val);
return val;
@@ -133,8 +133,8 @@ void m6810_put_mbyte(int32 offset, int32 val)
{
if (m6810_dev.dctrl & DEBUG_write)
printf("m6810_put_mbyte: offset=%04X, val=%02X\n", offset, val);
if (offset < m6810_unit.capac) {
*(uint8 *)(m6810_unit.filebuf + offset) = val & 0xFF;
if ((t_addr)offset < m6810_unit.capac) {
*((uint8 *)(m6810_unit.filebuf) + offset) = val & 0xFF;
return;
} else {
if (m6810_dev.dctrl & DEBUG_write)

View File

@@ -120,7 +120,7 @@ t_stat mp_8m_reset (DEVICE *dptr)
}
for (j=0; j<8192; j++) { /* fill pattern for testing */
val = (0xA0 | i);
*(uint8 *)(uptr->filebuf + j) = val & 0xFF;
*((uint8 *)(uptr->filebuf) + j) = val & 0xFF;
}
}
if (mp_8m_dev.dctrl & DEBUG_flow)
@@ -151,7 +151,7 @@ int32 mp_8m_get_mbyte(int32 addr)
org = uptr->u3;
len = uptr->capac - 1;
if ((addr >= org) && (addr <= org + len)) {
val = *(uint8 *)(uptr->filebuf + (addr - org));
val = *((uint8 *)(uptr->filebuf) + (addr - org));
if (mp_8m_dev.dctrl & DEBUG_read)
printf(" val=%04X\n", val);
return (val & 0xFF);
@@ -177,7 +177,7 @@ int32 mp_8m_get_mword(int32 addr)
void mp_8m_put_mbyte(int32 addr, int32 val)
{
int32 org, len, type;
int32 org, len;
int32 i;
UNIT *uptr;
@@ -188,7 +188,7 @@ void mp_8m_put_mbyte(int32 addr, int32 val)
org = uptr->u3;
len = uptr->capac - 1;
if ((addr >= org) && (addr < org + len)) {
*(uint8 *)(uptr->filebuf + (addr - org)) = val & 0xFF;
*((uint8 *)(uptr->filebuf) + (addr - org)) = val & 0xFF;
if (mp_8m_dev.dctrl & DEBUG_write)
printf("\n");
return;

View File

@@ -25,7 +25,7 @@ Copyright (c) 2005-2012, William Beech
*/
#include <ctype.h>
#include "../../sim_defs.h" // simulator defs
#include "sim_defs.h" // simulator defs
/* Memory */