ISYS8020: Created iSBC80-20.c file

This commit is contained in:
Bill Beech 2015-05-08 15:34:01 -07:00
parent 06f9cbe41d
commit 7dc9c86846

View file

@ -1,38 +1,38 @@
/* iSBC80-20.c: Intel iSBC 80/30 Processor simulator /* iSBC80-20.c: Intel iSBC 80/20 Processor simulator
Copyright (c) 2010, William A. Beech Copyright (c) 2010, William A. Beech
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"),
to deal in the Software without restriction, including without limitation to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions: Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
WILLIAM A. BEECH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER WILLIAM A. BEECH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of William A. Beech shall not be Except as contained in this notice, the name of William A. Beech shall not be
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 William A. Beech. in this Software without prior written authorization from William A. Beech.
This software was written by Bill Beech, Dec 2010, to allow emulation of Multibus NOTES:
Computer Systems.
?? ??? 10 - Original file. This software was written by Bill Beech, Dec 2010, to allow emulation of Multibus
Computer Systems.
*/ */
#include "system_defs.h" #include "system_defs.h"
/* set the base I/O address for the 8259 */ /* set the base I/O address for the 8259 */
#define I8259_BASE 0xD8 #define I8259_BASE 0xD8
/* set the base I/O address for the first 8255 */ /* set the base I/O address for the first 8255 */
#define I8255_BASE_0 0xE4 #define I8255_BASE_0 0xE4
@ -41,7 +41,7 @@
#define I8255_BASE_1 0xE8 #define I8255_BASE_1 0xE8
/* set the base I/O address for the 8251 */ /* set the base I/O address for the 8251 */
#define I8251_BASE 0xEC #define I8251_BASE 0xEC
/* set the base and size for the EPROM on the iSBC 80/20 */ /* set the base and size for the EPROM on the iSBC 80/20 */
#define ROM_SIZE 0x1000 #define ROM_SIZE 0x1000
@ -86,12 +86,12 @@ t_stat SBC_reset (DEVICE *dptr)
{ {
sim_printf("Initializing iSBC-80/20\n"); sim_printf("Initializing iSBC-80/20\n");
i8080_reset(NULL); i8080_reset(NULL);
i8259_reset(NULL, I8259_BASE); i8259_reset(NULL, I8259_BASE);
i8255_reset(NULL, I8255_BASE_0); i8255_reset(NULL, I8255_BASE_0);
i8255_reset(NULL, I8255_BASE_1); i8255_reset(NULL, I8255_BASE_1);
i8251_reset(NULL, I8251_BASE); i8251_reset(NULL, I8251_BASE);
EPROM_reset(NULL, ROM_SIZE); EPROM_reset(NULL, ROM_SIZE);
RAM_reset(NULL, RAM_BASE, RAM_SIZE); RAM_reset(NULL, RAM_BASE, RAM_SIZE);
return SCPE_OK; return SCPE_OK;
} }
@ -102,10 +102,12 @@ int32 get_mbyte(int32 addr)
int32 val, org, len; int32 val, org, len;
/* if local EPROM handle it */ /* if local EPROM handle it */
if ((i8255_unit.u6 & 0x01) && (addr >= EPROM_unit.u3) && (addr < (EPROM_unit.u3 + EPROM_unit.capac))) { if ((i8255_unit.u6 & 0x01) && /* EPROM enabled? */
(addr >= EPROM_unit.u3) && (addr < (EPROM_unit.u3 + EPROM_unit.capac))) {
return EPROM_get_mbyte(addr); return EPROM_get_mbyte(addr);
} /* if local RAM handle it */ } /* if local RAM handle it */
if ((i8255_unit.u6 & 0x02) && (addr >= RAM_unit.u3) && (addr < (RAM_unit.u3 + RAM_unit.capac))) { if ((i8255_unit.u6 & 0x02) && /* local RAM enabled? */
(addr >= RAM_unit.u3) && (addr < (RAM_unit.u3 + RAM_unit.capac))) {
return RAM_get_mbyte(addr); return RAM_get_mbyte(addr);
} /* otherwise, try the multibus */ } /* otherwise, try the multibus */
return multibus_get_mbyte(addr); return multibus_get_mbyte(addr);
@ -127,11 +129,13 @@ int32 get_mword(int32 addr)
void put_mbyte(int32 addr, int32 val) void put_mbyte(int32 addr, int32 val)
{ {
/* if local EPROM handle it */ /* if local EPROM handle it */
if ((i8255_unit.u6 & 0x01) && (addr >= EPROM_unit.u3) && (addr <= (EPROM_unit.u3 + EPROM_unit.capac))) { if ((i8255_unit.u6 & 0x01) && /* EPROM enabled? */
(addr >= EPROM_unit.u3) && (addr <= (EPROM_unit.u3 + EPROM_unit.capac))) {
sim_printf("Write to R/O memory address %04X - ignored\n", addr); sim_printf("Write to R/O memory address %04X - ignored\n", addr);
return; return;
} /* if local RAM handle it */ } /* if local RAM handle it */
if ((i8255_unit.u6 & 0x02) && (addr >= RAM_unit.u3) && (addr <= (RAM_unit.u3 + RAM_unit.capac))) { if ((i8255_unit.u6 & 0x02) && /* local RAM enabled? */
(addr >= RAM_unit.u3) && (addr <= (RAM_unit.u3 + RAM_unit.capac))) {
RAM_put_mbyte(addr, val); RAM_put_mbyte(addr, val);
return; return;
} /* otherwise, try the multibus */ } /* otherwise, try the multibus */
@ -146,4 +150,4 @@ void put_mword(int32 addr, int32 val)
put_mbyte(addr+1, val >> 8); put_mbyte(addr+1, val >> 8);
} }
/* end of iSBC80-10.c */ /* end of iSBC80-20.c */