SWTP6800: Address Converity identified problems
This commit is contained in:
parent
a3a1db40fe
commit
f10f8bc9c5
3 changed files with 30 additions and 5 deletions
|
@ -142,6 +142,10 @@ t_stat BOOTROM_attach (UNIT *uptr, CONST char *cptr)
|
|||
return r;
|
||||
}
|
||||
image_size = (t_addr)sim_fsize_ex (BOOTROM_unit.fileref);
|
||||
if (image_size <= 0) {
|
||||
sim_printf("BOOTROM_attach: File error\n");
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
for (capac = 0x200, i=1; capac < image_size; capac <<= 1, i++);
|
||||
if (i > (UNIT_2764>>UNIT_V_MSIZE)) {
|
||||
detach_unit (uptr);
|
||||
|
|
|
@ -374,6 +374,7 @@ t_stat dsk_reset (DEVICE *dptr)
|
|||
int32 fdcdrv(int32 io, int32 data)
|
||||
{
|
||||
static long pos;
|
||||
static int32 err;
|
||||
|
||||
if (io) { /* write to DC-4 drive register */
|
||||
sim_debug (DEBUG_write, &dsk_dev, "\nfdcdrv: Drive selected %d cur_dsk=%d",
|
||||
|
@ -392,7 +393,11 @@ int32 fdcdrv(int32 io, int32 data)
|
|||
pos = 0x200; /* Read in SIR */
|
||||
sim_debug (DEBUG_read, &dsk_dev, "\nfdcdrv: Read pos = %ld ($%04X)",
|
||||
pos, (unsigned int) pos);
|
||||
sim_fseek(dsk_unit[cur_dsk].fileref, pos, SEEK_SET); /* seek to offset */
|
||||
err = sim_fseek(dsk_unit[cur_dsk].fileref, pos, SEEK_SET); /* seek to offset */
|
||||
if (err) {
|
||||
sim_printf("\nfdccmd: File error\n");
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
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 */
|
||||
|
@ -416,6 +421,7 @@ int32 fdccmd(int32 io, int32 data)
|
|||
{
|
||||
static int32 val = 0, val1 = NOTRDY;
|
||||
static long pos;
|
||||
static int32 err;
|
||||
|
||||
if ((dsk_unit[cur_dsk].flags & UNIT_ATT) == 0) { /* not attached */
|
||||
dsk_unit[cur_dsk].u3 |= NOTRDY; /* set not ready flag */
|
||||
|
@ -434,7 +440,11 @@ int32 fdccmd(int32 io, int32 data)
|
|||
pos += SECSIZ * (dsk_unit[cur_dsk].u5 - 1);
|
||||
sim_debug (DEBUG_read, &dsk_dev, "\nfdccmd: Read pos = %ld ($%08X)",
|
||||
pos, (unsigned int) pos);
|
||||
sim_fseek(dsk_unit[cur_dsk].fileref, pos, SEEK_SET); /* seek to offset */
|
||||
err = sim_fseek(dsk_unit[cur_dsk].fileref, pos, SEEK_SET); /* seek to offset */
|
||||
if (err) {
|
||||
sim_printf("\nfdccmd: File error\n");
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
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 */
|
||||
|
@ -449,7 +459,11 @@ int32 fdccmd(int32 io, int32 data)
|
|||
pos += SECSIZ * (dsk_unit[cur_dsk].u5 - 1);
|
||||
sim_debug (DEBUG_write, &dsk_dev, "\nfdccmd: Write pos = %ld ($%08X)",
|
||||
pos, (unsigned int) pos);
|
||||
sim_fseek(dsk_unit[cur_dsk].fileref, pos, SEEK_SET); /* seek to offset */
|
||||
err = sim_fseek(dsk_unit[cur_dsk].fileref, pos, SEEK_SET); /* seek to offset */
|
||||
if (err) {
|
||||
sim_printf("\nfdccmd: File error\n");
|
||||
return SCPE_IOERR;
|
||||
}
|
||||
wrt_flag = 1; /* set write flag */
|
||||
dsk_unit[cur_dsk].u3 |= BUSY | DRQ;/* set DRQ & BUSY */
|
||||
dsk_unit[cur_dsk].pos = 0; /* clear counter */
|
||||
|
|
|
@ -193,6 +193,7 @@ int32 MB_get_mbyte(int32 addr)
|
|||
return val;
|
||||
} else
|
||||
return 0xFF;
|
||||
/* fall through */
|
||||
case 0x2000:
|
||||
case 0x3000:
|
||||
if (MB_unit.flags & UNIT_RAM_2000) {
|
||||
|
@ -201,6 +202,7 @@ int32 MB_get_mbyte(int32 addr)
|
|||
return val;
|
||||
} else
|
||||
return 0xFF;
|
||||
/* fall through */
|
||||
case 0x4000:
|
||||
case 0x5000:
|
||||
if (MB_unit.flags & UNIT_RAM_4000) {
|
||||
|
@ -211,6 +213,7 @@ int32 MB_get_mbyte(int32 addr)
|
|||
return val;
|
||||
} else
|
||||
return 0xFF;
|
||||
/* fall through */
|
||||
case 0x6000:
|
||||
case 0x7000:
|
||||
if (MB_unit.flags & UNIT_RAM_6000) {
|
||||
|
@ -219,6 +222,7 @@ int32 MB_get_mbyte(int32 addr)
|
|||
return val;
|
||||
} else
|
||||
return 0xFF;
|
||||
/* fall through */
|
||||
case 0x8000:
|
||||
if (addr < 0x8020)
|
||||
val = (dev_table[addr - 0x8000].routine(0, 0)) & 0xFF;
|
||||
|
@ -227,6 +231,7 @@ int32 MB_get_mbyte(int32 addr)
|
|||
sim_debug (DEBUG_read, &MB_dev, "MB_get_mbyte: I/O addr=%04X val=%02X\n",
|
||||
addr, val);
|
||||
return val;
|
||||
/* fall through */
|
||||
case 0xA000:
|
||||
case 0xB000:
|
||||
if (MB_unit.flags & UNIT_RAM_A000) {
|
||||
|
@ -235,6 +240,7 @@ int32 MB_get_mbyte(int32 addr)
|
|||
return val;
|
||||
} else
|
||||
return 0xFF;
|
||||
/* fall through */
|
||||
case 0xC000:
|
||||
case 0xD000:
|
||||
if (MB_unit.flags & UNIT_RAM_C000) {
|
||||
|
@ -243,6 +249,7 @@ int32 MB_get_mbyte(int32 addr)
|
|||
return val;
|
||||
} else
|
||||
return 0xFF;
|
||||
/* fall through */
|
||||
default:
|
||||
return 0xFF;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue