src/mess/machine/abcbus.c
| r13215 | r13216 | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | //************************************************************************** |
| 23 | | // LIVE DEVICE |
| 23 | // DEVICE ABCBUS CARD INTERFACE |
| 24 | 24 | //************************************************************************** |
| 25 | 25 | |
| 26 | 26 | //------------------------------------------------- |
| 27 | | // abcbus_slot_device - constructor |
| 27 | // device_abcbus_card_interface - constructor |
| 28 | 28 | //------------------------------------------------- |
| 29 | 29 | |
| 30 | | abcbus_slot_device::abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 31 | | device_t(mconfig, ABCBUS_SLOT, "ABC bus slot", tag, owner, clock), |
| 32 | | device_slot_interface(mconfig, *this) |
| 30 | device_abcbus_card_interface::device_abcbus_card_interface(const machine_config &mconfig, device_t &device) |
| 31 | : device_slot_card_interface(mconfig, device) |
| 33 | 32 | { |
| 34 | 33 | } |
| 35 | 34 | |
| 36 | 35 | |
| 37 | 36 | //------------------------------------------------- |
| 38 | | // static_set_abcbus_slot - |
| 37 | // ~device_abcbus_card_interface - destructor |
| 39 | 38 | //------------------------------------------------- |
| 40 | 39 | |
| 41 | | void abcbus_slot_device::static_set_abcbus_slot(device_t &device, const char *tag, int num) |
| 40 | device_abcbus_card_interface::~device_abcbus_card_interface() |
| 42 | 41 | { |
| 43 | | abcbus_slot_device &abcbus_card = dynamic_cast<abcbus_slot_device &>(device); |
| 44 | | abcbus_card.m_bus_tag = tag; |
| 45 | | abcbus_card.m_bus_num = num; |
| 46 | 42 | } |
| 47 | 43 | |
| 48 | 44 | |
| 49 | | //------------------------------------------------- |
| 50 | | // device_start - device-specific startup |
| 51 | | //------------------------------------------------- |
| 52 | 45 | |
| 53 | | void abcbus_slot_device::device_start() |
| 54 | | { |
| 55 | | m_bus = machine().device<abcbus_device>(m_bus_tag); |
| 56 | | device_abcbus_card_interface *dev = dynamic_cast<device_abcbus_card_interface *>(get_card_device()); |
| 57 | | if (dev) m_bus->add_abcbus_card(dev, m_bus_num); |
| 58 | | } |
| 59 | | |
| 60 | | |
| 61 | | |
| 62 | 46 | //************************************************************************** |
| 63 | | // GLOBAL VARIABLES |
| 47 | // LIVE DEVICE |
| 64 | 48 | //************************************************************************** |
| 65 | 49 | |
| 66 | | const device_type ABCBUS = &device_creator<abcbus_device>; |
| 50 | //------------------------------------------------- |
| 51 | // abcbus_slot_device - constructor |
| 52 | //------------------------------------------------- |
| 67 | 53 | |
| 68 | | |
| 69 | | void abcbus_device::static_set_cputag(device_t &device, const char *tag) |
| 54 | abcbus_slot_device::abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 55 | device_t(mconfig, ABCBUS_SLOT, "ABC bus slot", tag, owner, clock), |
| 56 | device_slot_interface(mconfig, *this) |
| 70 | 57 | { |
| 71 | | abcbus_device &abcbus = downcast<abcbus_device &>(device); |
| 72 | | abcbus.m_cputag = tag; |
| 73 | 58 | } |
| 74 | 59 | |
| 75 | 60 | |
| r13215 | r13216 | |
| 79 | 64 | // complete |
| 80 | 65 | //------------------------------------------------- |
| 81 | 66 | |
| 82 | | void abcbus_device::device_config_complete() |
| 67 | void abcbus_slot_device::device_config_complete() |
| 83 | 68 | { |
| 84 | 69 | // inherit a copy of the static data |
| 85 | 70 | const abcbus_interface *intf = reinterpret_cast<const abcbus_interface *>(static_config()); |
| r13215 | r13216 | |
| 99 | 84 | } |
| 100 | 85 | |
| 101 | 86 | |
| 102 | | |
| 103 | | //************************************************************************** |
| 104 | | // DEVICE ABCBUS CARD INTERFACE |
| 105 | | //************************************************************************** |
| 106 | | |
| 107 | 87 | //------------------------------------------------- |
| 108 | | // device_abcbus_card_interface - constructor |
| 109 | | //------------------------------------------------- |
| 110 | | |
| 111 | | device_abcbus_card_interface::device_abcbus_card_interface(const machine_config &mconfig, device_t &device) |
| 112 | | : device_slot_card_interface(mconfig, device) |
| 113 | | { |
| 114 | | } |
| 115 | | |
| 116 | | |
| 117 | | //------------------------------------------------- |
| 118 | | // ~device_abcbus_card_interface - destructor |
| 119 | | //------------------------------------------------- |
| 120 | | |
| 121 | | device_abcbus_card_interface::~device_abcbus_card_interface() |
| 122 | | { |
| 123 | | } |
| 124 | | |
| 125 | | |
| 126 | | |
| 127 | | //************************************************************************** |
| 128 | | // LIVE DEVICE |
| 129 | | //************************************************************************** |
| 130 | | |
| 131 | | //------------------------------------------------- |
| 132 | | // abcbus_device - constructor |
| 133 | | //------------------------------------------------- |
| 134 | | |
| 135 | | abcbus_device::abcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 136 | | device_t(mconfig, ABCBUS, "ABC bus", tag, owner, clock) |
| 137 | | { |
| 138 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 139 | | m_abcbus_device[i] = NULL; |
| 140 | | } |
| 141 | | |
| 142 | | |
| 143 | | //------------------------------------------------- |
| 144 | 88 | // device_start - device-specific startup |
| 145 | 89 | //------------------------------------------------- |
| 146 | 90 | |
| 147 | | void abcbus_device::device_start() |
| 91 | void abcbus_slot_device::device_start() |
| 148 | 92 | { |
| 149 | | m_maincpu = machine().device(m_cputag); |
| 93 | m_card = dynamic_cast<device_abcbus_card_interface *>(get_card_device()); |
| 150 | 94 | |
| 151 | 95 | // resolve callbacks |
| 152 | 96 | m_out_int_func.resolve(m_out_int_cb, *this); |
| r13215 | r13216 | |
| 157 | 101 | |
| 158 | 102 | |
| 159 | 103 | //------------------------------------------------- |
| 160 | | // device_reset - device-specific reset |
| 161 | | //------------------------------------------------- |
| 162 | | |
| 163 | | void abcbus_device::device_reset() |
| 164 | | { |
| 165 | | } |
| 166 | | |
| 167 | | |
| 168 | | //------------------------------------------------- |
| 169 | | // add_abcbus_card - add ABC bus card |
| 170 | | //------------------------------------------------- |
| 171 | | |
| 172 | | void abcbus_device::add_abcbus_card(device_abcbus_card_interface *card, int pos) |
| 173 | | { |
| 174 | | m_abcbus_device[pos] = card; |
| 175 | | } |
| 176 | | |
| 177 | | |
| 178 | | //------------------------------------------------- |
| 179 | 104 | // cs_w - |
| 180 | 105 | //------------------------------------------------- |
| 181 | 106 | |
| 182 | | WRITE8_MEMBER( abcbus_device::cs_w ) |
| 107 | WRITE8_MEMBER( abcbus_slot_device::cs_w ) |
| 183 | 108 | { |
| 184 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 109 | if (m_card != NULL) |
| 185 | 110 | { |
| 186 | | if (m_abcbus_device[i] != NULL) |
| 187 | | { |
| 188 | | m_abcbus_device[i]->abcbus_cs(data); |
| 189 | | } |
| 111 | m_card->abcbus_cs(data); |
| 190 | 112 | } |
| 191 | 113 | } |
| 192 | 114 | |
| r13215 | r13216 | |
| 195 | 117 | // rst_r - |
| 196 | 118 | //------------------------------------------------- |
| 197 | 119 | |
| 198 | | READ8_MEMBER( abcbus_device::rst_r ) |
| 120 | READ8_MEMBER( abcbus_slot_device::rst_r ) |
| 199 | 121 | { |
| 200 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 122 | if (m_card != NULL) |
| 201 | 123 | { |
| 202 | | if (m_abcbus_device[i] != NULL) |
| 203 | | { |
| 204 | | m_abcbus_device[i]->abcbus_rst(0); |
| 205 | | m_abcbus_device[i]->abcbus_rst(1); |
| 206 | | } |
| 124 | m_card->abcbus_rst(0); |
| 125 | m_card->abcbus_rst(1); |
| 207 | 126 | } |
| 208 | 127 | |
| 209 | 128 | return 0xff; |
| r13215 | r13216 | |
| 214 | 133 | // inp_r - |
| 215 | 134 | //------------------------------------------------- |
| 216 | 135 | |
| 217 | | READ8_MEMBER( abcbus_device::inp_r ) |
| 136 | READ8_MEMBER( abcbus_slot_device::inp_r ) |
| 218 | 137 | { |
| 219 | 138 | UINT8 data = 0xff; |
| 220 | 139 | |
| 221 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 140 | if (m_card != NULL) |
| 222 | 141 | { |
| 223 | | if (m_abcbus_device[i] != NULL) |
| 224 | | { |
| 225 | | data &= m_abcbus_device[i]->abcbus_inp(); |
| 226 | | } |
| 142 | data &= m_card->abcbus_inp(); |
| 227 | 143 | } |
| 228 | 144 | |
| 229 | 145 | return data; |
| r13215 | r13216 | |
| 234 | 150 | // utp_w - |
| 235 | 151 | //------------------------------------------------- |
| 236 | 152 | |
| 237 | | WRITE8_MEMBER( abcbus_device::utp_w ) |
| 153 | WRITE8_MEMBER( abcbus_slot_device::utp_w ) |
| 238 | 154 | { |
| 239 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 155 | if (m_card != NULL) |
| 240 | 156 | { |
| 241 | | if (m_abcbus_device[i] != NULL) |
| 242 | | { |
| 243 | | m_abcbus_device[i]->abcbus_utp(data); |
| 244 | | } |
| 157 | m_card->abcbus_utp(data); |
| 245 | 158 | } |
| 246 | 159 | } |
| 247 | 160 | |
| r13215 | r13216 | |
| 250 | 163 | // stat_r - |
| 251 | 164 | //------------------------------------------------- |
| 252 | 165 | |
| 253 | | READ8_MEMBER( abcbus_device::stat_r ) |
| 166 | READ8_MEMBER( abcbus_slot_device::stat_r ) |
| 254 | 167 | { |
| 255 | 168 | UINT8 data = 0xff; |
| 256 | 169 | |
| 257 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 170 | if (m_card != NULL) |
| 258 | 171 | { |
| 259 | | if (m_abcbus_device[i] != NULL) |
| 260 | | { |
| 261 | | data &= m_abcbus_device[i]->abcbus_stat(); |
| 262 | | } |
| 172 | data &= m_card->abcbus_stat(); |
| 263 | 173 | } |
| 264 | 174 | |
| 265 | 175 | return data; |
| r13215 | r13216 | |
| 270 | 180 | // c1_w - |
| 271 | 181 | //------------------------------------------------- |
| 272 | 182 | |
| 273 | | WRITE8_MEMBER( abcbus_device::c1_w ) |
| 183 | WRITE8_MEMBER( abcbus_slot_device::c1_w ) |
| 274 | 184 | { |
| 275 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 185 | if (m_card != NULL) |
| 276 | 186 | { |
| 277 | | if (m_abcbus_device[i] != NULL) |
| 278 | | { |
| 279 | | m_abcbus_device[i]->abcbus_c1(data); |
| 280 | | } |
| 187 | m_card->abcbus_c1(data); |
| 281 | 188 | } |
| 282 | 189 | } |
| 283 | 190 | |
| r13215 | r13216 | |
| 286 | 193 | // c2_w - |
| 287 | 194 | //------------------------------------------------- |
| 288 | 195 | |
| 289 | | WRITE8_MEMBER( abcbus_device::c2_w ) |
| 196 | WRITE8_MEMBER( abcbus_slot_device::c2_w ) |
| 290 | 197 | { |
| 291 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 198 | if (m_card != NULL) |
| 292 | 199 | { |
| 293 | | if (m_abcbus_device[i] != NULL) |
| 294 | | { |
| 295 | | m_abcbus_device[i]->abcbus_c2(data); |
| 296 | | } |
| 200 | m_card->abcbus_c2(data); |
| 297 | 201 | } |
| 298 | 202 | } |
| 299 | 203 | |
| r13215 | r13216 | |
| 302 | 206 | // c3_w - |
| 303 | 207 | //------------------------------------------------- |
| 304 | 208 | |
| 305 | | WRITE8_MEMBER( abcbus_device::c3_w ) |
| 209 | WRITE8_MEMBER( abcbus_slot_device::c3_w ) |
| 306 | 210 | { |
| 307 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 211 | if (m_card != NULL) |
| 308 | 212 | { |
| 309 | | if (m_abcbus_device[i] != NULL) |
| 310 | | { |
| 311 | | m_abcbus_device[i]->abcbus_c3(data); |
| 312 | | } |
| 213 | m_card->abcbus_c3(data); |
| 313 | 214 | } |
| 314 | 215 | } |
| 315 | 216 | |
| r13215 | r13216 | |
| 318 | 219 | // c4_w - |
| 319 | 220 | //------------------------------------------------- |
| 320 | 221 | |
| 321 | | WRITE8_MEMBER( abcbus_device::c4_w ) |
| 222 | WRITE8_MEMBER( abcbus_slot_device::c4_w ) |
| 322 | 223 | { |
| 323 | | for (int i = 0; i < MAX_ABCBUS_SLOTS; i++) |
| 224 | if (m_card != NULL) |
| 324 | 225 | { |
| 325 | | if (m_abcbus_device[i] != NULL) |
| 326 | | { |
| 327 | | m_abcbus_device[i]->abcbus_c4(data); |
| 328 | | } |
| 226 | m_card->abcbus_c4(data); |
| 329 | 227 | } |
| 330 | 228 | } |
| 331 | 229 | |
| r13215 | r13216 | |
| 334 | 232 | // int_w - |
| 335 | 233 | //------------------------------------------------- |
| 336 | 234 | |
| 337 | | WRITE_LINE_MEMBER( abcbus_device::int_w ) |
| 235 | WRITE_LINE_MEMBER( abcbus_slot_device::int_w ) |
| 338 | 236 | { |
| 339 | 237 | m_out_int_func(state); |
| 340 | 238 | } |
| r13215 | r13216 | |
| 344 | 242 | // nmi_w - |
| 345 | 243 | //------------------------------------------------- |
| 346 | 244 | |
| 347 | | WRITE_LINE_MEMBER( abcbus_device::nmi_w ) |
| 245 | WRITE_LINE_MEMBER( abcbus_slot_device::nmi_w ) |
| 348 | 246 | { |
| 349 | 247 | m_out_nmi_func(state); |
| 350 | 248 | } |
| r13215 | r13216 | |
| 354 | 252 | // rdy_w - |
| 355 | 253 | //------------------------------------------------- |
| 356 | 254 | |
| 357 | | WRITE_LINE_MEMBER( abcbus_device::rdy_w ) |
| 255 | WRITE_LINE_MEMBER( abcbus_slot_device::rdy_w ) |
| 358 | 256 | { |
| 359 | 257 | m_out_rdy_func(state); |
| 360 | 258 | } |
| r13215 | r13216 | |
| 364 | 262 | // resin_w - |
| 365 | 263 | //------------------------------------------------- |
| 366 | 264 | |
| 367 | | WRITE_LINE_MEMBER( abcbus_device::resin_w ) |
| 265 | WRITE_LINE_MEMBER( abcbus_slot_device::resin_w ) |
| 368 | 266 | { |
| 369 | 267 | m_out_resin_func(state); |
| 370 | 268 | } |
src/mess/machine/abcbus.h
| r13215 | r13216 | |
| 73 | 73 | #define ABCBUS_TAG "abcbus" |
| 74 | 74 | |
| 75 | 75 | |
| 76 | | #define MAX_ABCBUS_SLOTS 16 |
| 77 | 76 | |
| 78 | | |
| 79 | | |
| 80 | 77 | //************************************************************************** |
| 81 | 78 | // INTERFACE CONFIGURATION MACROS |
| 82 | 79 | //************************************************************************** |
| 83 | 80 | |
| 84 | | #define MCFG_ABCBUS_ADD(_cpu_tag, _config) \ |
| 85 | | MCFG_DEVICE_ADD(ABCBUS_TAG, ABCBUS, 0) \ |
| 86 | | MCFG_DEVICE_CONFIG(_config) \ |
| 87 | | abcbus_device::static_set_cputag(*device, _cpu_tag); |
| 88 | | |
| 89 | | |
| 90 | 81 | #define ABCBUS_INTERFACE(_name) \ |
| 91 | 82 | const abcbus_interface (_name) = |
| 92 | 83 | |
| 93 | 84 | |
| 94 | | #define MCFG_ABCBUS_SLOT_ADD(_num, _tag, _slot_intf, _def_slot, _def_inp) \ |
| 85 | #define MCFG_ABCBUS_SLOT_ADD(_tag, _config, _slot_intf, _def_slot, _def_inp) \ |
| 95 | 86 | MCFG_DEVICE_ADD(_tag, ABCBUS_SLOT, 0) \ |
| 96 | | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \ |
| 97 | | abcbus_slot_device::static_set_abcbus_slot(*device, ABCBUS_TAG, _num); |
| 87 | MCFG_DEVICE_CONFIG(_config) \ |
| 88 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) |
| 98 | 89 | |
| 99 | 90 | |
| 100 | 91 | |
| r13215 | r13216 | |
| 102 | 93 | // TYPE DEFINITIONS |
| 103 | 94 | //************************************************************************** |
| 104 | 95 | |
| 105 | | // ======================> abcbus_slot_device |
| 106 | | |
| 107 | | class abcbus_device; |
| 108 | | |
| 109 | | class abcbus_slot_device : public device_t, |
| 110 | | public device_slot_interface |
| 111 | | { |
| 112 | | public: |
| 113 | | // construction/destruction |
| 114 | | abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 115 | | |
| 116 | | // device-level overrides |
| 117 | | virtual void device_start(); |
| 118 | | |
| 119 | | // inline configuration |
| 120 | | static void static_set_abcbus_slot(device_t &device, const char *tag, int num); |
| 121 | | |
| 122 | | private: |
| 123 | | // configuration |
| 124 | | const char *m_bus_tag; |
| 125 | | int m_bus_num; |
| 126 | | abcbus_device *m_bus; |
| 127 | | }; |
| 128 | | |
| 129 | | |
| 130 | | // device type definition |
| 131 | | extern const device_type ABCBUS_SLOT; |
| 132 | | |
| 133 | | |
| 134 | 96 | // ======================> abcbus_interface |
| 135 | 97 | |
| 136 | 98 | struct abcbus_interface |
| r13215 | r13216 | |
| 141 | 103 | devcb_write_line m_out_resin_cb; |
| 142 | 104 | }; |
| 143 | 105 | |
| 144 | | class device_abcbus_card_interface; |
| 145 | 106 | |
| 107 | // ======================> device_abcbus_card_interface |
| 146 | 108 | |
| 147 | | // ======================> abcbus_device |
| 109 | class abcbus_slot_device; |
| 148 | 110 | |
| 149 | | class abcbus_device : public device_t, |
| 150 | | public abcbus_interface |
| 111 | // class representing interface-specific live abcbus card |
| 112 | class device_abcbus_card_interface : public device_slot_card_interface |
| 151 | 113 | { |
| 114 | friend class abcbus_slot_device; |
| 115 | |
| 152 | 116 | public: |
| 153 | 117 | // construction/destruction |
| 154 | | abcbus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 155 | | // inline configuration |
| 156 | | static void static_set_cputag(device_t &device, const char *tag); |
| 118 | device_abcbus_card_interface(const machine_config &mconfig, device_t &device); |
| 119 | virtual ~device_abcbus_card_interface(); |
| 157 | 120 | |
| 158 | | void add_abcbus_card(device_abcbus_card_interface *card, int pos); |
| 121 | // required operation overrides |
| 122 | virtual void abcbus_cs(UINT8 data) = 0; |
| 159 | 123 | |
| 124 | // optional operation overrides |
| 125 | virtual void abcbus_rst(int state) { }; |
| 126 | virtual UINT8 abcbus_inp() { return 0xff; }; |
| 127 | virtual void abcbus_utp(UINT8 data) { }; |
| 128 | virtual UINT8 abcbus_stat() { return 0xff; }; |
| 129 | virtual void abcbus_c1(UINT8 data) { }; |
| 130 | virtual void abcbus_c2(UINT8 data) { }; |
| 131 | virtual void abcbus_c3(UINT8 data) { }; |
| 132 | virtual void abcbus_c4(UINT8 data) { }; |
| 133 | |
| 134 | public: |
| 135 | abcbus_slot_device *m_bus; |
| 136 | }; |
| 137 | |
| 138 | |
| 139 | // ======================> abcbus_slot_device |
| 140 | |
| 141 | class abcbus_slot_device : public device_t, |
| 142 | public device_slot_interface, |
| 143 | public abcbus_interface |
| 144 | { |
| 145 | public: |
| 146 | // construction/destruction |
| 147 | abcbus_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 148 | |
| 160 | 149 | DECLARE_WRITE8_MEMBER( cs_w ); |
| 161 | 150 | DECLARE_READ8_MEMBER( rst_r ); |
| 162 | 151 | DECLARE_READ8_MEMBER( inp_r ); |
| r13215 | r13216 | |
| 175 | 164 | protected: |
| 176 | 165 | // device-level overrides |
| 177 | 166 | virtual void device_start(); |
| 178 | | virtual void device_reset(); |
| 179 | 167 | virtual void device_config_complete(); |
| 180 | 168 | |
| 181 | 169 | private: |
| 182 | | // internal state |
| 183 | | device_t *m_maincpu; |
| 184 | | |
| 185 | 170 | devcb_resolved_write_line m_out_int_func; |
| 186 | 171 | devcb_resolved_write_line m_out_nmi_func; |
| 187 | 172 | devcb_resolved_write_line m_out_rdy_func; |
| 188 | 173 | devcb_resolved_write_line m_out_resin_func; |
| 189 | 174 | |
| 190 | | device_abcbus_card_interface *m_abcbus_device[MAX_ABCBUS_SLOTS]; |
| 191 | | const char *m_cputag; |
| 175 | device_abcbus_card_interface *m_card; |
| 192 | 176 | }; |
| 193 | 177 | |
| 194 | 178 | |
| 195 | 179 | // device type definition |
| 196 | | extern const device_type ABCBUS; |
| 180 | extern const device_type ABCBUS_SLOT; |
| 197 | 181 | |
| 198 | 182 | |
| 199 | | // ======================> device_abcbus_card_interface |
| 200 | 183 | |
| 201 | | // class representing interface-specific live abcbus card |
| 202 | | class device_abcbus_card_interface : public device_slot_card_interface |
| 203 | | { |
| 204 | | friend class abcbus_device; |
| 205 | | |
| 206 | | public: |
| 207 | | // construction/destruction |
| 208 | | device_abcbus_card_interface(const machine_config &mconfig, device_t &device); |
| 209 | | virtual ~device_abcbus_card_interface(); |
| 210 | | |
| 211 | | // required operation overrides |
| 212 | | virtual void abcbus_cs(UINT8 data) = 0; |
| 213 | | |
| 214 | | // optional operation overrides |
| 215 | | virtual void abcbus_rst(int state) { }; |
| 216 | | virtual UINT8 abcbus_inp() { return 0xff; }; |
| 217 | | virtual void abcbus_utp(UINT8 data) { }; |
| 218 | | virtual UINT8 abcbus_stat() { return 0xff; }; |
| 219 | | virtual void abcbus_c1(UINT8 data) { }; |
| 220 | | virtual void abcbus_c2(UINT8 data) { }; |
| 221 | | virtual void abcbus_c3(UINT8 data) { }; |
| 222 | | virtual void abcbus_c4(UINT8 data) { }; |
| 223 | | |
| 224 | | public: |
| 225 | | abcbus_device *m_abcbus; |
| 226 | | }; |
| 227 | | |
| 228 | 184 | #endif |
src/mess/drivers/abc80.c
| r13215 | r13216 | |
| 464 | 464 | static ADDRESS_MAP_START( abc80_io, AS_IO, 8, abc80_state ) |
| 465 | 465 | ADDRESS_MAP_UNMAP_HIGH |
| 466 | 466 | ADDRESS_MAP_GLOBAL_MASK(0x17) |
| 467 | | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, inp_r, utp_w) |
| 468 | | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, stat_r, cs_w) |
| 469 | | AM_RANGE(0x02, 0x02) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c1_w) |
| 470 | | AM_RANGE(0x03, 0x03) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c2_w) |
| 471 | | AM_RANGE(0x04, 0x04) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c3_w) |
| 472 | | AM_RANGE(0x05, 0x05) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c4_w) |
| 467 | AM_RANGE(0x00, 0x00) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, inp_r, utp_w) |
| 468 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, stat_r, cs_w) |
| 469 | AM_RANGE(0x02, 0x02) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c1_w) |
| 470 | AM_RANGE(0x03, 0x03) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c2_w) |
| 471 | AM_RANGE(0x04, 0x04) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c3_w) |
| 472 | AM_RANGE(0x05, 0x05) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w) |
| 473 | 473 | AM_RANGE(0x06, 0x06) AM_WRITE_PORT("SN76477") |
| 474 | | AM_RANGE(0x07, 0x07) AM_DEVREAD(ABCBUS_TAG, abcbus_device, rst_r) |
| 474 | AM_RANGE(0x07, 0x07) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) |
| 475 | 475 | AM_RANGE(0x10, 0x13) AM_MIRROR(0x04) AM_DEVREADWRITE_LEGACY(Z80PIO_TAG, z80pio_ba_cd_r, z80pio_ba_cd_w) |
| 476 | 476 | ADDRESS_MAP_END |
| 477 | 477 | |
| r13215 | r13216 | |
| 740 | 740 | MCFG_ABC830_ADD() |
| 741 | 741 | |
| 742 | 742 | // ABC bus |
| 743 | | MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf) |
| 744 | | MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc80_abcbus_cards, "slow", NULL) |
| 745 | | MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc80_abcbus_cards, NULL, NULL) |
| 746 | | MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc80_abcbus_cards, NULL, NULL) |
| 747 | | MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc80_abcbus_cards, NULL, NULL) |
| 748 | | MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc80_abcbus_cards, NULL, NULL) |
| 743 | MCFG_ABCBUS_SLOT_ADD(ABCBUS_TAG, abcbus_intf, abc80_abcbus_cards, "slow", NULL) |
| 749 | 744 | |
| 750 | 745 | /* internal ram */ |
| 751 | 746 | MCFG_RAM_ADD(RAM_TAG) |
src/mess/drivers/abc80x.c
| r13215 | r13216 | |
| 630 | 630 | static ADDRESS_MAP_START( abc800c_io, AS_IO, 8, abc800_state ) |
| 631 | 631 | ADDRESS_MAP_UNMAP_HIGH |
| 632 | 632 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 633 | | AM_RANGE(0x00, 0x00) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, inp_r, utp_w) |
| 634 | | AM_RANGE(0x01, 0x01) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, stat_r, cs_w) |
| 635 | | AM_RANGE(0x02, 0x02) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c1_w) |
| 636 | | AM_RANGE(0x03, 0x03) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c2_w) |
| 637 | | AM_RANGE(0x04, 0x04) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c3_w) |
| 638 | | AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c4_w) |
| 633 | AM_RANGE(0x00, 0x00) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, inp_r, utp_w) |
| 634 | AM_RANGE(0x01, 0x01) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, stat_r, cs_w) |
| 635 | AM_RANGE(0x02, 0x02) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c1_w) |
| 636 | AM_RANGE(0x03, 0x03) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c2_w) |
| 637 | AM_RANGE(0x04, 0x04) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c3_w) |
| 638 | AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w) |
| 639 | 639 | AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_READ(pling_r) |
| 640 | 640 | AM_RANGE(0x06, 0x06) AM_MIRROR(0x18) AM_WRITE(hrs_w) |
| 641 | | AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_device, rst_r) AM_WRITE(hrc_w) |
| 641 | AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) AM_WRITE(hrc_w) |
| 642 | 642 | AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 643 | 643 | AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80SIO_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 644 | 644 | AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE_LEGACY(Z80CTC_TAG, z80ctc_r, z80ctc_w) |
| r13215 | r13216 | |
| 700 | 700 | static ADDRESS_MAP_START( abc802_io, AS_IO, 8, abc802_state ) |
| 701 | 701 | ADDRESS_MAP_UNMAP_HIGH |
| 702 | 702 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 703 | | AM_RANGE(0x00, 0x00) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, inp_r, utp_w) |
| 704 | | AM_RANGE(0x01, 0x01) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, stat_r, cs_w) |
| 705 | | AM_RANGE(0x02, 0x02) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c1_w) |
| 706 | | AM_RANGE(0x03, 0x03) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c2_w) |
| 707 | | AM_RANGE(0x04, 0x04) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c3_w) |
| 708 | | AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c4_w) |
| 703 | AM_RANGE(0x00, 0x00) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, inp_r, utp_w) |
| 704 | AM_RANGE(0x01, 0x01) AM_MIRROR(0x18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, stat_r, cs_w) |
| 705 | AM_RANGE(0x02, 0x02) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c1_w) |
| 706 | AM_RANGE(0x03, 0x03) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c2_w) |
| 707 | AM_RANGE(0x04, 0x04) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c3_w) |
| 708 | AM_RANGE(0x05, 0x05) AM_MIRROR(0x18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w) |
| 709 | 709 | AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_READ(pling_r) |
| 710 | | AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_device, rst_r) |
| 710 | AM_RANGE(0x07, 0x07) AM_MIRROR(0x18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) |
| 711 | 711 | AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 712 | 712 | AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r) |
| 713 | 713 | AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w) |
| r13215 | r13216 | |
| 748 | 748 | |
| 749 | 749 | static ADDRESS_MAP_START( abc806_io, AS_IO, 8, abc806_state ) |
| 750 | 750 | ADDRESS_MAP_UNMAP_HIGH |
| 751 | | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, inp_r, utp_w) |
| 752 | | AM_RANGE(0x01, 0x01) AM_MIRROR(0xff18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_device, stat_r, cs_w) |
| 753 | | AM_RANGE(0x02, 0x02) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c1_w) |
| 754 | | AM_RANGE(0x03, 0x03) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c2_w) |
| 755 | | AM_RANGE(0x04, 0x04) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c3_w) |
| 756 | | AM_RANGE(0x05, 0x05) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_device, c4_w) |
| 751 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, inp_r, utp_w) |
| 752 | AM_RANGE(0x01, 0x01) AM_MIRROR(0xff18) AM_DEVREADWRITE(ABCBUS_TAG, abcbus_slot_device, stat_r, cs_w) |
| 753 | AM_RANGE(0x02, 0x02) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c1_w) |
| 754 | AM_RANGE(0x03, 0x03) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c2_w) |
| 755 | AM_RANGE(0x04, 0x04) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c3_w) |
| 756 | AM_RANGE(0x05, 0x05) AM_MIRROR(0xff18) AM_DEVWRITE(ABCBUS_TAG, abcbus_slot_device, c4_w) |
| 757 | 757 | AM_RANGE(0x06, 0x06) AM_MIRROR(0xff18) AM_WRITE(hrs_w) |
| 758 | | AM_RANGE(0x07, 0x07) AM_MIRROR(0xff18) AM_DEVREAD(ABCBUS_TAG, abcbus_device, rst_r) AM_WRITE(hrc_w) |
| 758 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xff18) AM_DEVREAD(ABCBUS_TAG, abcbus_slot_device, rst_r) AM_WRITE(hrc_w) |
| 759 | 759 | AM_RANGE(0x20, 0x23) AM_MIRROR(0xff0c) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) |
| 760 | 760 | AM_RANGE(0x31, 0x31) AM_MIRROR(0xff06) AM_DEVREAD(MC6845_TAG, mc6845_device, register_r) |
| 761 | 761 | AM_RANGE(0x34, 0x34) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(mai_r, mao_w) |
| r13215 | r13216 | |
| 1417 | 1417 | MCFG_ABC832_ADD() |
| 1418 | 1418 | |
| 1419 | 1419 | // ABC bus |
| 1420 | | MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf) |
| 1421 | | MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast", abc830_fast) |
| 1422 | | MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL, NULL) |
| 1423 | | MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL, NULL) |
| 1424 | | MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL, NULL) |
| 1425 | | MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL, NULL) |
| 1420 | MCFG_ABCBUS_SLOT_ADD(ABCBUS_TAG, abcbus_intf, abc800_abcbus_cards, "fast", abc830_fast) |
| 1426 | 1421 | |
| 1427 | 1422 | // internal ram |
| 1428 | 1423 | MCFG_RAM_ADD(RAM_TAG) |
| r13215 | r13216 | |
| 1468 | 1463 | MCFG_ABC832_ADD() |
| 1469 | 1464 | |
| 1470 | 1465 | // ABC bus |
| 1471 | | MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf) |
| 1472 | | MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast", abc830_fast) |
| 1473 | | MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL, NULL) |
| 1474 | | MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL, NULL) |
| 1475 | | MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL, NULL) |
| 1476 | | MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL, NULL) |
| 1466 | MCFG_ABCBUS_SLOT_ADD(ABCBUS_TAG, abcbus_intf, abc800_abcbus_cards, "fast", abc830_fast) |
| 1477 | 1467 | |
| 1478 | 1468 | // internal ram |
| 1479 | 1469 | MCFG_RAM_ADD(RAM_TAG) |
| r13215 | r13216 | |
| 1516 | 1506 | MCFG_ABC834_ADD() |
| 1517 | 1507 | |
| 1518 | 1508 | // ABC bus |
| 1519 | | MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf) |
| 1520 | | MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast", abc834_fast) |
| 1521 | | MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL, NULL) |
| 1522 | | MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL, NULL) |
| 1523 | | MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL, NULL) |
| 1524 | | MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL, NULL) |
| 1509 | MCFG_ABCBUS_SLOT_ADD(ABCBUS_TAG, abcbus_intf, abc800_abcbus_cards, "fast", abc834_fast) |
| 1525 | 1510 | |
| 1526 | 1511 | // internal ram |
| 1527 | 1512 | MCFG_RAM_ADD(RAM_TAG) |
| r13215 | r13216 | |
| 1555 | 1540 | MCFG_ABC832_ADD() |
| 1556 | 1541 | |
| 1557 | 1542 | // ABC bus |
| 1558 | | MCFG_ABCBUS_ADD(Z80_TAG, abcbus_intf) |
| 1559 | | MCFG_ABCBUS_SLOT_ADD( 1, "abc1", abc800_abcbus_cards, "fast", abc832_fast) |
| 1560 | | MCFG_ABCBUS_SLOT_ADD( 2, "abc2", abc800_abcbus_cards, NULL, NULL) |
| 1561 | | MCFG_ABCBUS_SLOT_ADD( 3, "abc3", abc800_abcbus_cards, NULL, NULL) |
| 1562 | | MCFG_ABCBUS_SLOT_ADD( 4, "abc4", abc800_abcbus_cards, NULL, NULL) |
| 1563 | | MCFG_ABCBUS_SLOT_ADD( 5, "abc5", abc800_abcbus_cards, NULL, NULL) |
| 1543 | MCFG_ABCBUS_SLOT_ADD(ABCBUS_TAG, abcbus_intf, abc800_abcbus_cards, "fast", abc832_fast) |
| 1564 | 1544 | |
| 1565 | 1545 | // internal ram |
| 1566 | 1546 | MCFG_RAM_ADD(RAM_TAG) |