ISYS8020: Created iSBC80-20.c file
This commit is contained in:
parent
06f9cbe41d
commit
7dc9c86846
1 changed files with 38 additions and 34 deletions
|
@ -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
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
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:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
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
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
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
|
||||
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
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from William A. Beech.
|
||||
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
|
||||
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
|
||||
Computer Systems.
|
||||
NOTES:
|
||||
|
||||
?? ??? 10 - Original file.
|
||||
This software was written by Bill Beech, Dec 2010, to allow emulation of Multibus
|
||||
Computer Systems.
|
||||
*/
|
||||
|
||||
#include "system_defs.h"
|
||||
|
||||
/* 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 */
|
||||
#define I8255_BASE_0 0xE4
|
||||
|
@ -41,7 +41,7 @@
|
|||
#define I8255_BASE_1 0xE8
|
||||
|
||||
/* 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 */
|
||||
#define ROM_SIZE 0x1000
|
||||
|
@ -86,12 +86,12 @@ t_stat SBC_reset (DEVICE *dptr)
|
|||
{
|
||||
sim_printf("Initializing iSBC-80/20\n");
|
||||
i8080_reset(NULL);
|
||||
i8259_reset(NULL, I8259_BASE);
|
||||
i8255_reset(NULL, I8255_BASE_0);
|
||||
i8255_reset(NULL, I8255_BASE_1);
|
||||
i8251_reset(NULL, I8251_BASE);
|
||||
EPROM_reset(NULL, ROM_SIZE);
|
||||
RAM_reset(NULL, RAM_BASE, RAM_SIZE);
|
||||
i8259_reset(NULL, I8259_BASE);
|
||||
i8255_reset(NULL, I8255_BASE_0);
|
||||
i8255_reset(NULL, I8255_BASE_1);
|
||||
i8251_reset(NULL, I8251_BASE);
|
||||
EPROM_reset(NULL, ROM_SIZE);
|
||||
RAM_reset(NULL, RAM_BASE, RAM_SIZE);
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
@ -102,10 +102,12 @@ int32 get_mbyte(int32 addr)
|
|||
int32 val, org, len;
|
||||
|
||||
/* 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);
|
||||
} /* 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);
|
||||
} /* otherwise, try the multibus */
|
||||
return multibus_get_mbyte(addr);
|
||||
|
@ -127,11 +129,13 @@ int32 get_mword(int32 addr)
|
|||
void put_mbyte(int32 addr, int32 val)
|
||||
{
|
||||
/* 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);
|
||||
return;
|
||||
} /* 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);
|
||||
return;
|
||||
} /* otherwise, try the multibus */
|
||||
|
@ -146,4 +150,4 @@ void put_mword(int32 addr, int32 val)
|
|||
put_mbyte(addr+1, val >> 8);
|
||||
}
|
||||
|
||||
/* end of iSBC80-10.c */
|
||||
/* end of iSBC80-20.c */
|
||||
|
|
Loading…
Add table
Reference in a new issue