From 361552f41bdedbb3d576d975829a4d2a62fa6eaa Mon Sep 17 00:00:00 2001 From: Curt Coder Date: Sun, 20 Oct 2013 09:39:59 +0000 Subject: [PATCH] isbx: Added a placeholder for the Intel iSBX bus. [Curt Coder] --- .gitattributes | 3 ++ src/emu/bus/bus.mak | 24 +++++++++ src/emu/bus/isbx/isbx.c | 92 ++++++++++++++++++++++++++++++++ src/emu/bus/isbx/isbx.h | 105 +++++++++++++++++++++++++++++++++++++ src/emu/emu.mak | 11 +++- src/mess/drivers/compis.c | 4 ++ src/mess/includes/compis.h | 7 +++ src/mess/mess.mak | 6 +++ 8 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 src/emu/bus/bus.mak create mode 100644 src/emu/bus/isbx/isbx.c create mode 100644 src/emu/bus/isbx/isbx.h diff --git a/.gitattributes b/.gitattributes index d4db2faf493..bc82cd44f61 100644 --- a/.gitattributes +++ b/.gitattributes @@ -356,6 +356,9 @@ src/emu/attotime.c svneol=native#text/plain src/emu/attotime.h svneol=native#text/plain src/emu/audit.c svneol=native#text/plain src/emu/audit.h svneol=native#text/plain +src/emu/bus/bus.mak svneol=native#text/plain +src/emu/bus/isbx/isbx.c svneol=native#text/plain +src/emu/bus/isbx/isbx.h svneol=native#text/plain src/emu/cheat.c svneol=native#text/plain src/emu/cheat.h svneol=native#text/plain src/emu/clifront.c svneol=native#text/plain diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak new file mode 100644 index 00000000000..c952d19fd2f --- /dev/null +++ b/src/emu/bus/bus.mak @@ -0,0 +1,24 @@ +########################################################################### +# +# bus.mak +# +# Rules for building bus cores +# +# Copyright Nicola Salmoria and the MAME Team. +# Visit http://mamedev.org for licensing and usage restrictions. +# +########################################################################### + + +BUSSRC = $(EMUSRC)/bus +BUSOBJ = $(EMUOBJ)/bus + + +#------------------------------------------------- +# +#@src/emu/bus/isbx.h,BUSES += ISBX +#------------------------------------------------- + +ifneq ($(filter ISBX,$(BUSES)),) +BUSOBJS += $(BUSOBJ)/isbx/isbx.o +endif diff --git a/src/emu/bus/isbx/isbx.c b/src/emu/bus/isbx/isbx.c new file mode 100644 index 00000000000..d4965aaed5d --- /dev/null +++ b/src/emu/bus/isbx/isbx.c @@ -0,0 +1,92 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Intel iSBX bus emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +**********************************************************************/ + +#include "isbx.h" + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type ISBX_SLOT = &device_creator; + + + +//************************************************************************** +// DEVICE C64_EXPANSION CARD INTERFACE +//************************************************************************** + +//------------------------------------------------- +// device_isbx_card_interface - constructor +//------------------------------------------------- + +device_isbx_card_interface::device_isbx_card_interface(const machine_config &mconfig, device_t &device) + : device_slot_card_interface(mconfig, device) +{ + m_slot = dynamic_cast(device.owner()); +} + + +//------------------------------------------------- +// ~device_isbx_card_interface - destructor +//------------------------------------------------- + +device_isbx_card_interface::~device_isbx_card_interface() +{ +} + + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// isbx_slot_device - constructor +//------------------------------------------------- + +isbx_slot_device::isbx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, ISBX_SLOT, "iSBX bus slot", tag, owner, clock, "isbx_slot", __FILE__), + device_slot_interface(mconfig, *this) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void isbx_slot_device::device_start() +{ + m_card = dynamic_cast(get_card_device()); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void isbx_slot_device::device_reset() +{ + if (get_card_device()) + { + get_card_device()->reset(); + } +} + + +//------------------------------------------------- +// SLOT_INTERFACE( isbx_cards ) +//------------------------------------------------- + +SLOT_INTERFACE_START( isbx_cards ) +SLOT_INTERFACE_END diff --git a/src/emu/bus/isbx/isbx.h b/src/emu/bus/isbx/isbx.h new file mode 100644 index 00000000000..4aeb3d99b54 --- /dev/null +++ b/src/emu/bus/isbx/isbx.h @@ -0,0 +1,105 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + Intel iSBX bus emulation + + Copyright MESS Team. + Visit http://mamedev.org for licensing and usage restrictions. + +********************************************************************** + + 1 2 + GND 3 4 +5V + RESET 5 6 + MA2 7 8 MPST/ + MA1 9 10 + MA0 11 12 MINTR1 + /IOWRT 13 14 + /IORD 15 16 MWAIT/ + GND 17 18 +5V + MD7 19 20 MCS1/ + MD6 21 22 MCS0/ + MD5 23 24 + MD4 25 26 TDMA + MD3 27 28 OPT1 + MD2 29 30 OPT0 + MD1 31 32 MDACK/ + MD0 33 34 MDRQT + GND 35 36 +5V + MDE 37 38 MDF + MDC 39 40 MDD + MDA 41 42 MDB + MD8 43 44 MD9 + +**********************************************************************/ + +#pragma once + +#ifndef __ISBX_SLOT__ +#define __ISBX_SLOT__ + +#include "emu.h" + + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_ISBX_SLOT_ADD(_tag, _slot_intf, _def_slot) \ + MCFG_DEVICE_ADD(_tag, ISBX_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) + + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> isbx_slot_device + +class device_isbx_card_interface; + +class isbx_slot_device : public device_t, + public device_slot_interface +{ +public: + // construction/destruction + isbx_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + + device_isbx_card_interface *m_card; +}; + + +// ======================> device_isbx_card_interface + +class device_isbx_card_interface : public device_slot_card_interface +{ + friend class isbx_slot_device; + +public: + // construction/destruction + device_isbx_card_interface(const machine_config &mconfig, device_t &device); + virtual ~device_isbx_card_interface(); + +protected: + isbx_slot_device *m_slot; +}; + + +// device type definition +extern const device_type ISBX_SLOT; + + +// slot devices +SLOT_INTERFACE_EXTERN( isbx_cards ); + + + +#endif diff --git a/src/emu/emu.mak b/src/emu/emu.mak index 0c8fc651f12..9a420e00329 100644 --- a/src/emu/emu.mak +++ b/src/emu/emu.mak @@ -14,6 +14,7 @@ EMUSRC = $(SRC)/emu EMUOBJ = $(OBJ)/emu EMUAUDIO = $(EMUOBJ)/audio +EMUBUS = $(EMUOBJ)/bus EMUDRIVERS = $(EMUOBJ)/drivers EMULAYOUT = $(EMUOBJ)/layout EMUMACHINE = $(EMUOBJ)/machine @@ -26,6 +27,8 @@ OBJDIRS += \ $(EMUOBJ)/debug \ $(EMUOBJ)/debugint \ $(EMUOBJ)/audio \ + $(EMUOBJ)/bus \ + $(EMUOBJ)/bus/isbx \ $(EMUOBJ)/drivers \ $(EMUOBJ)/machine \ $(EMUOBJ)/layout \ @@ -209,11 +212,17 @@ include $(EMUSRC)/video/video.mak include $(EMUSRC)/machine/machine.mak +#------------------------------------------------- +# bus core objects +#------------------------------------------------- + +include $(EMUSRC)/bus/bus.mak + #------------------------------------------------- # core optional library #------------------------------------------------- -$(LIBOPTIONAL): $(CPUOBJS) $(SOUNDOBJS) $(VIDEOOBJS) $(MACHINEOBJS) +$(LIBOPTIONAL): $(CPUOBJS) $(SOUNDOBJS) $(VIDEOOBJS) $(MACHINEOBJS) $(BUSOBJS) #------------------------------------------------- # additional dependencies diff --git a/src/mess/drivers/compis.c b/src/mess/drivers/compis.c index b2cd86eebc7..d2e18355e2c 100644 --- a/src/mess/drivers/compis.c +++ b/src/mess/drivers/compis.c @@ -258,6 +258,8 @@ static MACHINE_CONFIG_START( compis, compis_state ) MCFG_I8274_ADD(I8274_TAG, XTAL_16MHz/4, mpsc_intf) MCFG_RS232_PORT_ADD(RS232_A_TAG, rs232a_intf, default_rs232_devices, NULL) MCFG_RS232_PORT_ADD(RS232_B_TAG, rs232b_intf, default_rs232_devices, NULL) + MCFG_ISBX_SLOT_ADD(ISBX_0_TAG, isbx_cards, NULL) + MCFG_ISBX_SLOT_ADD(ISBX_1_TAG, isbx_cards, NULL) MCFG_COMPIS_KEYBOARD_ADD(NULL) /* software lists */ @@ -299,6 +301,8 @@ static MACHINE_CONFIG_START( compis2, compis_state ) MCFG_I8274_ADD(I8274_TAG, XTAL_16MHz/4, mpsc_intf) MCFG_RS232_PORT_ADD(RS232_A_TAG, rs232a_intf, default_rs232_devices, NULL) MCFG_RS232_PORT_ADD(RS232_B_TAG, rs232b_intf, default_rs232_devices, NULL) + MCFG_ISBX_SLOT_ADD(ISBX_0_TAG, isbx_cards, NULL) + MCFG_ISBX_SLOT_ADD(ISBX_1_TAG, isbx_cards, NULL) MCFG_COMPIS_KEYBOARD_ADD(NULL) /* software lists */ diff --git a/src/mess/includes/compis.h b/src/mess/includes/compis.h index 77bc04047e1..81124e7402d 100644 --- a/src/mess/includes/compis.h +++ b/src/mess/includes/compis.h @@ -13,6 +13,7 @@ #define COMPIS_H_ #include "emu.h" +#include "bus/isbx/isbx.h" #include "cpu/i86/i186.h" #include "cpu/mcs48/mcs48.h" #include "formats/cpis_dsk.h" @@ -33,6 +34,8 @@ #define RS232_A_TAG "rs232a" #define RS232_B_TAG "rs232b" #define CASSETTE_TAG "cassette" +#define ISBX_0_TAG "isbx0" +#define ISBX_1_TAG "isbx1" class compis_state : public driver_device { @@ -51,6 +54,8 @@ public: m_fdc(*this, "i8272a"), m_crtc(*this, "upd7220"), m_cassette(*this, CASSETTE_TAG), + m_isbx0(*this, ISBX_0_TAG), + m_isbx1(*this, ISBX_1_TAG), m_video_ram(*this, "video_ram") { } @@ -66,6 +71,8 @@ public: required_device m_fdc; required_device m_crtc; required_device m_cassette; + required_device m_isbx0; + required_device m_isbx1; DECLARE_WRITE8_MEMBER(vram_w); DECLARE_READ8_MEMBER(compis_ppi_port_b_r); diff --git a/src/mess/mess.mak b/src/mess/mess.mak index 543d16e748d..ceda2cce865 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -472,6 +472,12 @@ MACHINES += Z8536 MACHINES += SECFLASH MACHINES += PCCARD +#------------------------------------------------- +# specify available bus cores +#------------------------------------------------- + +BUSES += ISBX + #------------------------------------------------- # this is the list of driver libraries that # comprise MESS plus messdriv.o which contains