diff options
author | Dirk Best <mail@dirk-best.de> | 2014-11-20 16:28:37 +0100 |
---|---|---|
committer | Dirk Best <mail@dirk-best.de> | 2014-11-20 16:29:27 +0100 |
commit | 2622cd71fc789d94464958c8ce7d1e7f0842e341 (patch) | |
tree | a387e05656118f4ae2268589e0f04bbac7346c4b | |
parent | 10335e957e78fdbd0bac8e2696143e28bf402734 (diff) |
pcd: create omti5100 sasi controller skeleton device
-rw-r--r-- | src/emu/machine/machine.mak | 9 | ||||
-rw-r--r-- | src/emu/machine/omti5100.c | 153 | ||||
-rw-r--r-- | src/emu/machine/omti5100.h | 103 | ||||
-rw-r--r-- | src/mess/drivers/pcd.c | 11 | ||||
-rw-r--r-- | src/mess/mess.mak | 1 |
5 files changed, 273 insertions, 4 deletions
diff --git a/src/emu/machine/machine.mak b/src/emu/machine/machine.mak index bb71176b4b7..13b5e86cecb 100644 --- a/src/emu/machine/machine.mak +++ b/src/emu/machine/machine.mak @@ -1221,6 +1221,15 @@ endif #------------------------------------------------- # +#@src/emu/machine/omti5100.h,MACHINES += OMTI5100 +#------------------------------------------------- + +ifneq ($(filter OMTI5100,$(MACHINES)),) +MACHINEOBJS += $(MACHINEOBJ)/omti5100.o +endif + +#------------------------------------------------- +# #@src/emu/machine/pcf8593.h,MACHINES += PCF8593 #------------------------------------------------- diff --git a/src/emu/machine/omti5100.c b/src/emu/machine/omti5100.c new file mode 100644 index 00000000000..84d00f178e9 --- /dev/null +++ b/src/emu/machine/omti5100.c @@ -0,0 +1,153 @@ +/*************************************************************************** + + SMS OMTI 5100 + + license: MAME, GPL-2.0+ + copyright-holders: Dirk Best + + SCSI/SASI Intelligent Data Controller + + Note: - Skeleton device + - Supports up to two ST-506/412 hard drives + - Z8681 (Z8) + - 8 KB RAM + - 2 KB Buffer RAM + +***************************************************************************/ + +#include "omti5100.h" + + +//************************************************************************** +// CONSTANTS +//************************************************************************** + +#define VERBOSE 1 + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type OMTI5100 = &device_creator<omti5100_device>; + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +ROM_START( omti5100_firmware ) + ROM_REGION(0x2000, "firmware", 0) + ROM_LOAD("1002401-n.7a", 0x0000, 0x2000, CRC(d531e25c) SHA1(22e4762a70841b80e843a5d76175c1fdb6838e18)) +ROM_END + +const rom_entry *omti5100_device::device_rom_region() const +{ + return ROM_NAME( omti5100_firmware ); +} + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( omti5100_z8 ) +// MCFG_CPU_ADD("z8", Z8681, XTAL_20MHz / 3 /* ??? */) +MACHINE_CONFIG_END + +machine_config_constructor omti5100_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( omti5100_z8 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// omti5100_device - constructor +//------------------------------------------------- + +omti5100_device::omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, OMTI5100, "OMTI 5100 SCSI/SASI Controller", tag, owner, clock, "omti5100", __FILE__), +// m_cpu(*this, "z8"), + m_bsy_w(*this), + m_cd_w(*this), + m_io_w(*this), + m_req_w(*this), + m_msg_w(*this) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void omti5100_device::device_start() +{ + // resolve callbacks + m_bsy_w.resolve_safe(); + m_cd_w.resolve_safe(); + m_io_w.resolve_safe(); + m_req_w.resolve_safe(); + m_msg_w.resolve_safe(); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void omti5100_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +READ8_MEMBER( omti5100_device::data_r ) +{ + if (VERBOSE) + logerror("%s: data_r\n", tag()); + + return 0xff; +} + +WRITE8_MEMBER( omti5100_device::data_w ) +{ + if (VERBOSE) + logerror("%s: rst_w: %02x\n", tag(), data); +} + +READ_LINE_MEMBER( omti5100_device::parity_r ) +{ + if (VERBOSE) + logerror("%s: parity_r\n", tag()); + + return 1; +} + +WRITE_LINE_MEMBER( omti5100_device::parity_w ) +{ + if (VERBOSE) + logerror("%s: parity_w: %d\n", tag(), state); +} + +WRITE_LINE_MEMBER( omti5100_device::rst_w ) +{ + if (VERBOSE) + logerror("%s: rst_w: %d\n", tag(), state); +} + +WRITE_LINE_MEMBER( omti5100_device::sel_w ) +{ + if (VERBOSE) + logerror("%s: sel_w: %d\n", tag(), state); +} + +WRITE_LINE_MEMBER( omti5100_device::ack_w ) +{ + if (VERBOSE) + logerror("%s: ack_w: %d\n", tag(), state); +} diff --git a/src/emu/machine/omti5100.h b/src/emu/machine/omti5100.h new file mode 100644 index 00000000000..ede9493880f --- /dev/null +++ b/src/emu/machine/omti5100.h @@ -0,0 +1,103 @@ +/*************************************************************************** + + SMS OMTI 5100 + + license: MAME, GPL-2.0+ + copyright-holders: Dirk Best + + SCSI/SASI Intelligent Data Controller + +***************************************************************************/ + +#pragma once + +#ifndef __OMTI5100_H__ +#define __OMTI5100_H__ + +#include "emu.h" +#include "cpu/z8/z8.h" + + +//************************************************************************** +// INTERFACE CONFIGURATION MACROS +//************************************************************************** + +#define MCFG_OMTI5100_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, OMTI5100, 0) + +#define MCFG_OMTI5100_BSY_HANDLER(_devcb) \ + devcb = &omti5100_device::set_bsy_handler(*device, DEVCB_##_devcb); + +#define MCFG_OMTI5100_CD_HANDLER(_devcb) \ + devcb = &omti5100_device::set_cd_handler(*device, DEVCB_##_devcb); + +#define MCFG_OMTI5100_IO_HANDLER(_devcb) \ + devcb = &omti5100_device::set_io_handler(*device, DEVCB_##_devcb); + +#define MCFG_OMTI5100_REQ_HANDLER(_devcb) \ + devcb = &omti5100_device::set_req_handler(*device, DEVCB_##_devcb); + +#define MCFG_OMTI5100_MSG_HANDLER(_devcb) \ + devcb = &omti5100_device::set_msg_handler(*device, DEVCB_##_devcb); + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> omti5100_device + +class omti5100_device : public device_t +{ +public: + // construction/destruction + omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // callbacks + template<class _Object> static devcb_base &set_bsy_handler(device_t &device, _Object object) + { return downcast<omti5100_device &>(device).m_bsy_w.set_callback(object); } + + template<class _Object> static devcb_base &set_cd_handler(device_t &device, _Object object) + { return downcast<omti5100_device &>(device).m_cd_w.set_callback(object); } + + template<class _Object> static devcb_base &set_io_handler(device_t &device, _Object object) + { return downcast<omti5100_device &>(device).m_io_w.set_callback(object); } + + template<class _Object> static devcb_base &set_req_handler(device_t &device, _Object object) + { return downcast<omti5100_device &>(device).m_req_w.set_callback(object); } + + template<class _Object> static devcb_base &set_msg_handler(device_t &device, _Object object) + { return downcast<omti5100_device &>(device).m_msg_w.set_callback(object); } + + // data + DECLARE_READ8_MEMBER( data_r ); + DECLARE_WRITE8_MEMBER( data_w ); + DECLARE_READ_LINE_MEMBER( parity_r ); + DECLARE_WRITE_LINE_MEMBER( parity_w ); + + // control + DECLARE_WRITE_LINE_MEMBER( rst_w ); + DECLARE_WRITE_LINE_MEMBER( sel_w ); + DECLARE_WRITE_LINE_MEMBER( ack_w ); + +protected: + // device_t overrides + virtual const rom_entry *device_rom_region() const; + virtual machine_config_constructor device_mconfig_additions() const; + virtual void device_start(); + virtual void device_reset(); + +private: +// required_device<z8681_device> m_cpu; + + devcb_write_line m_bsy_w; + devcb_write_line m_cd_w; + devcb_write_line m_io_w; + devcb_write_line m_req_w; + devcb_write_line m_msg_w; +}; + +// device type definition +extern const device_type OMTI5100; + +#endif // __OMTI5100_H__ diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c index 036cb112af2..19ec2338741 100644 --- a/src/mess/drivers/pcd.c +++ b/src/mess/drivers/pcd.c @@ -15,6 +15,7 @@ #include "machine/nvram.h" #include "machine/pic8259.h" #include "machine/mc2661.h" +#include "machine/omti5100.h" #include "machine/wd_fdc.h" #include "machine/mc146818.h" #include "sound/speaker.h" @@ -33,6 +34,7 @@ public: m_pic1(*this, "pic1"), m_pic2(*this, "pic2"), m_speaker(*this, "speaker"), + m_sasi(*this, "sasi"), m_fdc(*this, "fdc"), m_rtc(*this, "rtc") { } @@ -55,6 +57,7 @@ private: required_device<pic8259_device> m_pic1; required_device<pic8259_device> m_pic2; required_device<speaker_sound_device> m_speaker; + required_device<omti5100_device> m_sasi; required_device<wd2793_t> m_fdc; required_device<mc146818_device> m_rtc; }; @@ -125,6 +128,7 @@ static ADDRESS_MAP_START( pcd_io, AS_IO, 16, pcd_state ) AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("nvram") AM_RANGE(0xf840, 0xf841) AM_DEVREADWRITE8("pic1", pic8259_device, read, write, 0xff00) AM_RANGE(0xf900, 0xf907) AM_DEVREADWRITE8("fdc", wd2793_t, read, write, 0x00ff) +// AM_RANGE(0xf940, 0xf941) // sasi controller here? AM_RANGE(0xf980, 0xf981) AM_READWRITE8(crt_data_r, crt_data_w, 0x00ff) AM_READ8(crt_status_r, 0xff00) // AM_RANGE(0xfa00, 0xfa7f) // pcs4-n (peripheral chip select) ADDRESS_MAP_END @@ -159,6 +163,9 @@ static MACHINE_CONFIG_START( pcd, pcd_state ) // nvram MCFG_NVRAM_ADD_1FILL("nvram") + // sasi controller + MCFG_OMTI5100_ADD("sasi") + // floppy disk controller MCFG_WD2793x_ADD("fdc", XTAL_16MHz/2/8) MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("pic1", pic8259_device, ir6_w)) @@ -196,10 +203,6 @@ ROM_START( pcd ) ROM_LOAD16_BYTE("s26361-d359.d42", 0x0001, 0x2000, CRC(e20244dd) SHA1(0ebc5ddb93baacd9106f1917380de58aac64fe73)) ROM_LOAD16_BYTE("s26361-d359.d43", 0x0000, 0x2000, CRC(e03db2ec) SHA1(fcae8b0c9e7543706817b0a53872826633361fda)) - // hdd (omti 5100) - ROM_REGION(0x2000, "hdd", 0) - ROM_LOAD("1002401-n.bin", 0x0000, 0x2000, CRC(d531e25c) SHA1(22e4762a70841b80e843a5d76175c1fdb6838e18)) - // gfx card (scn2674 with 8741), to be moved ROM_REGION(0x400, "graphics", 0) ROM_LOAD("s36361-d321-v1.bin", 0x000, 0x400, CRC(69baeb2a) SHA1(98b9cd0f38c51b4988a3aed0efcf004bedd115ff)) diff --git a/src/mess/mess.mak b/src/mess/mess.mak index dd1009ece40..cba88e1e541 100644 --- a/src/mess/mess.mak +++ b/src/mess/mess.mak @@ -476,6 +476,7 @@ MACHINES += NCR53C7XX MACHINES += NMC9306 MACHINES += NSC810 MACHINES += NSCSI +MACHINES += OMTI5100 MACHINES += PC_FDC MACHINES += PC_LPT MACHINES += PCCARD |