trunk/src/emu/machine/omti5100.c
| r0 | r241977 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | SMS OMTI 5100 |
| 4 | |
| 5 | license: MAME, GPL-2.0+ |
| 6 | copyright-holders: Dirk Best |
| 7 | |
| 8 | SCSI/SASI Intelligent Data Controller |
| 9 | |
| 10 | Note: - Skeleton device |
| 11 | - Supports up to two ST-506/412 hard drives |
| 12 | - Z8681 (Z8) |
| 13 | - 8 KB RAM |
| 14 | - 2 KB Buffer RAM |
| 15 | |
| 16 | ***************************************************************************/ |
| 17 | |
| 18 | #include "omti5100.h" |
| 19 | |
| 20 | |
| 21 | //************************************************************************** |
| 22 | // CONSTANTS |
| 23 | //************************************************************************** |
| 24 | |
| 25 | #define VERBOSE 1 |
| 26 | |
| 27 | |
| 28 | //************************************************************************** |
| 29 | // DEVICE DEFINITIONS |
| 30 | //************************************************************************** |
| 31 | |
| 32 | const device_type OMTI5100 = &device_creator<omti5100_device>; |
| 33 | |
| 34 | //------------------------------------------------- |
| 35 | // rom_region - device-specific ROM region |
| 36 | //------------------------------------------------- |
| 37 | |
| 38 | ROM_START( omti5100_firmware ) |
| 39 | ROM_REGION(0x2000, "firmware", 0) |
| 40 | ROM_LOAD("1002401-n.7a", 0x0000, 0x2000, CRC(d531e25c) SHA1(22e4762a70841b80e843a5d76175c1fdb6838e18)) |
| 41 | ROM_END |
| 42 | |
| 43 | const rom_entry *omti5100_device::device_rom_region() const |
| 44 | { |
| 45 | return ROM_NAME( omti5100_firmware ); |
| 46 | } |
| 47 | |
| 48 | //------------------------------------------------- |
| 49 | // machine_config_additions - device-specific |
| 50 | // machine configurations |
| 51 | //------------------------------------------------- |
| 52 | |
| 53 | static MACHINE_CONFIG_FRAGMENT( omti5100_z8 ) |
| 54 | // MCFG_CPU_ADD("z8", Z8681, XTAL_20MHz / 3 /* ??? */) |
| 55 | MACHINE_CONFIG_END |
| 56 | |
| 57 | machine_config_constructor omti5100_device::device_mconfig_additions() const |
| 58 | { |
| 59 | return MACHINE_CONFIG_NAME( omti5100_z8 ); |
| 60 | } |
| 61 | |
| 62 | |
| 63 | //************************************************************************** |
| 64 | // LIVE DEVICE |
| 65 | //************************************************************************** |
| 66 | |
| 67 | //------------------------------------------------- |
| 68 | // omti5100_device - constructor |
| 69 | //------------------------------------------------- |
| 70 | |
| 71 | omti5100_device::omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 72 | device_t(mconfig, OMTI5100, "OMTI 5100 SCSI/SASI Controller", tag, owner, clock, "omti5100", __FILE__), |
| 73 | // m_cpu(*this, "z8"), |
| 74 | m_bsy_w(*this), |
| 75 | m_cd_w(*this), |
| 76 | m_io_w(*this), |
| 77 | m_req_w(*this), |
| 78 | m_msg_w(*this) |
| 79 | { |
| 80 | } |
| 81 | |
| 82 | //------------------------------------------------- |
| 83 | // device_start - device-specific startup |
| 84 | //------------------------------------------------- |
| 85 | |
| 86 | void omti5100_device::device_start() |
| 87 | { |
| 88 | // resolve callbacks |
| 89 | m_bsy_w.resolve_safe(); |
| 90 | m_cd_w.resolve_safe(); |
| 91 | m_io_w.resolve_safe(); |
| 92 | m_req_w.resolve_safe(); |
| 93 | m_msg_w.resolve_safe(); |
| 94 | } |
| 95 | |
| 96 | //------------------------------------------------- |
| 97 | // device_reset - device-specific reset |
| 98 | //------------------------------------------------- |
| 99 | |
| 100 | void omti5100_device::device_reset() |
| 101 | { |
| 102 | } |
| 103 | |
| 104 | |
| 105 | //************************************************************************** |
| 106 | // IMPLEMENTATION |
| 107 | //************************************************************************** |
| 108 | |
| 109 | READ8_MEMBER( omti5100_device::data_r ) |
| 110 | { |
| 111 | if (VERBOSE) |
| 112 | logerror("%s: data_r\n", tag()); |
| 113 | |
| 114 | return 0xff; |
| 115 | } |
| 116 | |
| 117 | WRITE8_MEMBER( omti5100_device::data_w ) |
| 118 | { |
| 119 | if (VERBOSE) |
| 120 | logerror("%s: rst_w: %02x\n", tag(), data); |
| 121 | } |
| 122 | |
| 123 | READ_LINE_MEMBER( omti5100_device::parity_r ) |
| 124 | { |
| 125 | if (VERBOSE) |
| 126 | logerror("%s: parity_r\n", tag()); |
| 127 | |
| 128 | return 1; |
| 129 | } |
| 130 | |
| 131 | WRITE_LINE_MEMBER( omti5100_device::parity_w ) |
| 132 | { |
| 133 | if (VERBOSE) |
| 134 | logerror("%s: parity_w: %d\n", tag(), state); |
| 135 | } |
| 136 | |
| 137 | WRITE_LINE_MEMBER( omti5100_device::rst_w ) |
| 138 | { |
| 139 | if (VERBOSE) |
| 140 | logerror("%s: rst_w: %d\n", tag(), state); |
| 141 | } |
| 142 | |
| 143 | WRITE_LINE_MEMBER( omti5100_device::sel_w ) |
| 144 | { |
| 145 | if (VERBOSE) |
| 146 | logerror("%s: sel_w: %d\n", tag(), state); |
| 147 | } |
| 148 | |
| 149 | WRITE_LINE_MEMBER( omti5100_device::ack_w ) |
| 150 | { |
| 151 | if (VERBOSE) |
| 152 | logerror("%s: ack_w: %d\n", tag(), state); |
| 153 | } |
trunk/src/emu/machine/omti5100.h
| r0 | r241977 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | SMS OMTI 5100 |
| 4 | |
| 5 | license: MAME, GPL-2.0+ |
| 6 | copyright-holders: Dirk Best |
| 7 | |
| 8 | SCSI/SASI Intelligent Data Controller |
| 9 | |
| 10 | ***************************************************************************/ |
| 11 | |
| 12 | #pragma once |
| 13 | |
| 14 | #ifndef __OMTI5100_H__ |
| 15 | #define __OMTI5100_H__ |
| 16 | |
| 17 | #include "emu.h" |
| 18 | #include "cpu/z8/z8.h" |
| 19 | |
| 20 | |
| 21 | //************************************************************************** |
| 22 | // INTERFACE CONFIGURATION MACROS |
| 23 | //************************************************************************** |
| 24 | |
| 25 | #define MCFG_OMTI5100_ADD(_tag) \ |
| 26 | MCFG_DEVICE_ADD(_tag, OMTI5100, 0) |
| 27 | |
| 28 | #define MCFG_OMTI5100_BSY_HANDLER(_devcb) \ |
| 29 | devcb = &omti5100_device::set_bsy_handler(*device, DEVCB_##_devcb); |
| 30 | |
| 31 | #define MCFG_OMTI5100_CD_HANDLER(_devcb) \ |
| 32 | devcb = &omti5100_device::set_cd_handler(*device, DEVCB_##_devcb); |
| 33 | |
| 34 | #define MCFG_OMTI5100_IO_HANDLER(_devcb) \ |
| 35 | devcb = &omti5100_device::set_io_handler(*device, DEVCB_##_devcb); |
| 36 | |
| 37 | #define MCFG_OMTI5100_REQ_HANDLER(_devcb) \ |
| 38 | devcb = &omti5100_device::set_req_handler(*device, DEVCB_##_devcb); |
| 39 | |
| 40 | #define MCFG_OMTI5100_MSG_HANDLER(_devcb) \ |
| 41 | devcb = &omti5100_device::set_msg_handler(*device, DEVCB_##_devcb); |
| 42 | |
| 43 | |
| 44 | //************************************************************************** |
| 45 | // TYPE DEFINITIONS |
| 46 | //************************************************************************** |
| 47 | |
| 48 | // ======================> omti5100_device |
| 49 | |
| 50 | class omti5100_device : public device_t |
| 51 | { |
| 52 | public: |
| 53 | // construction/destruction |
| 54 | omti5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 55 | |
| 56 | // callbacks |
| 57 | template<class _Object> static devcb_base &set_bsy_handler(device_t &device, _Object object) |
| 58 | { return downcast<omti5100_device &>(device).m_bsy_w.set_callback(object); } |
| 59 | |
| 60 | template<class _Object> static devcb_base &set_cd_handler(device_t &device, _Object object) |
| 61 | { return downcast<omti5100_device &>(device).m_cd_w.set_callback(object); } |
| 62 | |
| 63 | template<class _Object> static devcb_base &set_io_handler(device_t &device, _Object object) |
| 64 | { return downcast<omti5100_device &>(device).m_io_w.set_callback(object); } |
| 65 | |
| 66 | template<class _Object> static devcb_base &set_req_handler(device_t &device, _Object object) |
| 67 | { return downcast<omti5100_device &>(device).m_req_w.set_callback(object); } |
| 68 | |
| 69 | template<class _Object> static devcb_base &set_msg_handler(device_t &device, _Object object) |
| 70 | { return downcast<omti5100_device &>(device).m_msg_w.set_callback(object); } |
| 71 | |
| 72 | // data |
| 73 | DECLARE_READ8_MEMBER( data_r ); |
| 74 | DECLARE_WRITE8_MEMBER( data_w ); |
| 75 | DECLARE_READ_LINE_MEMBER( parity_r ); |
| 76 | DECLARE_WRITE_LINE_MEMBER( parity_w ); |
| 77 | |
| 78 | // control |
| 79 | DECLARE_WRITE_LINE_MEMBER( rst_w ); |
| 80 | DECLARE_WRITE_LINE_MEMBER( sel_w ); |
| 81 | DECLARE_WRITE_LINE_MEMBER( ack_w ); |
| 82 | |
| 83 | protected: |
| 84 | // device_t overrides |
| 85 | virtual const rom_entry *device_rom_region() const; |
| 86 | virtual machine_config_constructor device_mconfig_additions() const; |
| 87 | virtual void device_start(); |
| 88 | virtual void device_reset(); |
| 89 | |
| 90 | private: |
| 91 | // required_device<z8681_device> m_cpu; |
| 92 | |
| 93 | devcb_write_line m_bsy_w; |
| 94 | devcb_write_line m_cd_w; |
| 95 | devcb_write_line m_io_w; |
| 96 | devcb_write_line m_req_w; |
| 97 | devcb_write_line m_msg_w; |
| 98 | }; |
| 99 | |
| 100 | // device type definition |
| 101 | extern const device_type OMTI5100; |
| 102 | |
| 103 | #endif // __OMTI5100_H__ |
trunk/src/mess/drivers/pcd.c
| r241976 | r241977 | |
| 15 | 15 | #include "machine/nvram.h" |
| 16 | 16 | #include "machine/pic8259.h" |
| 17 | 17 | #include "machine/mc2661.h" |
| 18 | #include "machine/omti5100.h" |
| 18 | 19 | #include "machine/wd_fdc.h" |
| 19 | 20 | #include "machine/mc146818.h" |
| 20 | 21 | #include "sound/speaker.h" |
| r241976 | r241977 | |
| 33 | 34 | m_pic1(*this, "pic1"), |
| 34 | 35 | m_pic2(*this, "pic2"), |
| 35 | 36 | m_speaker(*this, "speaker"), |
| 37 | m_sasi(*this, "sasi"), |
| 36 | 38 | m_fdc(*this, "fdc"), |
| 37 | 39 | m_rtc(*this, "rtc") |
| 38 | 40 | { } |
| r241976 | r241977 | |
| 55 | 57 | required_device<pic8259_device> m_pic1; |
| 56 | 58 | required_device<pic8259_device> m_pic2; |
| 57 | 59 | required_device<speaker_sound_device> m_speaker; |
| 60 | required_device<omti5100_device> m_sasi; |
| 58 | 61 | required_device<wd2793_t> m_fdc; |
| 59 | 62 | required_device<mc146818_device> m_rtc; |
| 60 | 63 | }; |
| r241976 | r241977 | |
| 125 | 128 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("nvram") |
| 126 | 129 | AM_RANGE(0xf840, 0xf841) AM_DEVREADWRITE8("pic1", pic8259_device, read, write, 0xff00) |
| 127 | 130 | AM_RANGE(0xf900, 0xf907) AM_DEVREADWRITE8("fdc", wd2793_t, read, write, 0x00ff) |
| 131 | // AM_RANGE(0xf940, 0xf941) // sasi controller here? |
| 128 | 132 | AM_RANGE(0xf980, 0xf981) AM_READWRITE8(crt_data_r, crt_data_w, 0x00ff) AM_READ8(crt_status_r, 0xff00) |
| 129 | 133 | // AM_RANGE(0xfa00, 0xfa7f) // pcs4-n (peripheral chip select) |
| 130 | 134 | ADDRESS_MAP_END |
| r241976 | r241977 | |
| 159 | 163 | // nvram |
| 160 | 164 | MCFG_NVRAM_ADD_1FILL("nvram") |
| 161 | 165 | |
| 166 | // sasi controller |
| 167 | MCFG_OMTI5100_ADD("sasi") |
| 168 | |
| 162 | 169 | // floppy disk controller |
| 163 | 170 | MCFG_WD2793x_ADD("fdc", XTAL_16MHz/2/8) |
| 164 | 171 | MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE("pic1", pic8259_device, ir6_w)) |
| r241976 | r241977 | |
| 196 | 203 | ROM_LOAD16_BYTE("s26361-d359.d42", 0x0001, 0x2000, CRC(e20244dd) SHA1(0ebc5ddb93baacd9106f1917380de58aac64fe73)) |
| 197 | 204 | ROM_LOAD16_BYTE("s26361-d359.d43", 0x0000, 0x2000, CRC(e03db2ec) SHA1(fcae8b0c9e7543706817b0a53872826633361fda)) |
| 198 | 205 | |
| 199 | | // hdd (omti 5100) |
| 200 | | ROM_REGION(0x2000, "hdd", 0) |
| 201 | | ROM_LOAD("1002401-n.bin", 0x0000, 0x2000, CRC(d531e25c) SHA1(22e4762a70841b80e843a5d76175c1fdb6838e18)) |
| 202 | | |
| 203 | 206 | // gfx card (scn2674 with 8741), to be moved |
| 204 | 207 | ROM_REGION(0x400, "graphics", 0) |
| 205 | 208 | ROM_LOAD("s36361-d321-v1.bin", 0x000, 0x400, CRC(69baeb2a) SHA1(98b9cd0f38c51b4988a3aed0efcf004bedd115ff)) |