src/mess/machine/s100_dj2db.c
| r12264 | r12265 | |
| 80 | 80 | |
| 81 | 81 | WRITE_LINE_MEMBER( s100_dj2db_device::fdc_intrq_w ) |
| 82 | 82 | { |
| 83 | m_s100->rdy_w(CLEAR_LINE); |
| 84 | |
| 83 | 85 | switch (input_port_read(this, "J1A")) |
| 84 | 86 | { |
| 85 | 87 | case 0: m_s100->vi0_w(state); break; |
| r12264 | r12265 | |
| 94 | 96 | } |
| 95 | 97 | } |
| 96 | 98 | |
| 99 | WRITE_LINE_MEMBER( s100_dj2db_device::fdc_drq_w ) |
| 100 | { |
| 101 | m_s100->rdy_w(CLEAR_LINE); |
| 102 | } |
| 103 | |
| 97 | 104 | static const wd17xx_interface fdc_intf = |
| 98 | 105 | { |
| 99 | 106 | DEVCB_NULL, |
| 100 | 107 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, s100_dj2db_device, fdc_intrq_w), |
| 101 | | DEVCB_NULL, |
| 108 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, s100_dj2db_device, fdc_drq_w), |
| 102 | 109 | { FLOPPY_0, FLOPPY_1, NULL, NULL } |
| 103 | 110 | }; |
| 104 | 111 | |
| r12264 | r12265 | |
| 357 | 364 | } |
| 358 | 365 | else if ((offset >= 0xfbfc) && (offset < 0xfc00)) |
| 359 | 366 | { |
| 367 | m_s100->rdy_w(ASSERT_LINE); |
| 368 | |
| 360 | 369 | data = wd17xx_r(m_fdc, offset & 0x03); |
| 361 | 370 | } |
| 362 | 371 | else if ((offset >= 0xfc00) && (offset < 0x10000)) |
src/mess/machine/s100.c
| r12264 | r12265 | |
| 31 | 31 | { |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | | void s100_slot_device::static_set_s100_slot(device_t &device, const char *tag, int num) |
| 34 | void s100_slot_device::static_set_s100_slot(device_t &device, const char *tag) |
| 35 | 35 | { |
| 36 | 36 | s100_slot_device &s100_card = dynamic_cast<s100_slot_device &>(device); |
| 37 | 37 | s100_card.m_bus_tag = tag; |
| 38 | | s100_card.m_bus_num = num; |
| 39 | 38 | } |
| 40 | 39 | |
| 40 | |
| 41 | 41 | //------------------------------------------------- |
| 42 | 42 | // device_start - device-specific startup |
| 43 | 43 | //------------------------------------------------- |
| r12264 | r12265 | |
| 46 | 46 | { |
| 47 | 47 | m_bus = machine().device<s100_device>(m_bus_tag); |
| 48 | 48 | device_s100_card_interface *dev = dynamic_cast<device_s100_card_interface *>(get_card_device()); |
| 49 | | if (dev) m_bus->add_s100_card(dev, m_bus_num); |
| 49 | if (dev) m_bus->add_s100_card(dev); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| r12264 | r12265 | |
| 117 | 117 | s100_device::s100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 118 | 118 | device_t(mconfig, S100, "S100", tag, owner, clock) |
| 119 | 119 | { |
| 120 | | for (int i = 0; i < MAX_S100_SLOTS; i++) |
| 121 | | m_s100_device[i] = NULL; |
| 122 | 120 | } |
| 123 | 121 | |
| 124 | 122 | |
| r12264 | r12265 | |
| 165 | 163 | // add_s100_card - add S100 card |
| 166 | 164 | //------------------------------------------------- |
| 167 | 165 | |
| 168 | | void s100_device::add_s100_card(device_s100_card_interface *card, int pos) |
| 166 | void s100_device::add_s100_card(device_s100_card_interface *card) |
| 169 | 167 | { |
| 170 | | m_s100_device[pos] = card; |
| 168 | m_device_list.append(*card); |
| 171 | 169 | } |
| 172 | 170 | |
| 173 | 171 | |
| r12264 | r12265 | |
| 179 | 177 | { |
| 180 | 178 | UINT8 data = 0; |
| 181 | 179 | |
| 182 | | for (int i = 0; i < MAX_S100_SLOTS; i++) |
| 180 | device_s100_card_interface *entry = m_device_list.first(); |
| 181 | |
| 182 | while (entry) |
| 183 | 183 | { |
| 184 | | if (m_s100_device[i] != NULL) |
| 185 | | { |
| 186 | | data |= m_s100_device[i]->s100_smemr_r(offset); |
| 187 | | } |
| 184 | data |= entry->s100_smemr_r(offset); |
| 185 | entry = entry->next(); |
| 188 | 186 | } |
| 189 | 187 | |
| 190 | 188 | return data; |
| r12264 | r12265 | |
| 197 | 195 | |
| 198 | 196 | WRITE8_MEMBER( s100_device::mwrt_w ) |
| 199 | 197 | { |
| 200 | | for (int i = 0; i < MAX_S100_SLOTS; i++) |
| 198 | device_s100_card_interface *entry = m_device_list.first(); |
| 199 | |
| 200 | while (entry) |
| 201 | 201 | { |
| 202 | | if (m_s100_device[i] != NULL) |
| 203 | | { |
| 204 | | m_s100_device[i]->s100_mwrt_w(offset, data); |
| 205 | | } |
| 202 | entry->s100_mwrt_w(offset, data); |
| 203 | entry = entry->next(); |
| 206 | 204 | } |
| 207 | 205 | } |
| 208 | 206 | |
| r12264 | r12265 | |
| 215 | 213 | { |
| 216 | 214 | UINT8 data = 0; |
| 217 | 215 | |
| 218 | | for (int i = 0; i < MAX_S100_SLOTS; i++) |
| 216 | device_s100_card_interface *entry = m_device_list.first(); |
| 217 | |
| 218 | while (entry) |
| 219 | 219 | { |
| 220 | | if (m_s100_device[i] != NULL) |
| 221 | | { |
| 222 | | data |= m_s100_device[i]->s100_sinp_r(offset); |
| 223 | | } |
| 220 | data |= entry->s100_sinp_r(offset); |
| 221 | entry = entry->next(); |
| 224 | 222 | } |
| 225 | 223 | |
| 226 | 224 | return data; |
| r12264 | r12265 | |
| 233 | 231 | |
| 234 | 232 | WRITE8_MEMBER( s100_device::sout_w ) |
| 235 | 233 | { |
| 236 | | for (int i = 0; i < MAX_S100_SLOTS; i++) |
| 234 | device_s100_card_interface *entry = m_device_list.first(); |
| 235 | |
| 236 | while (entry) |
| 237 | 237 | { |
| 238 | | if (m_s100_device[i] != NULL) |
| 239 | | { |
| 240 | | m_s100_device[i]->s100_sout_w(offset, data); |
| 241 | | } |
| 238 | entry->s100_sout_w(offset, data); |
| 239 | entry = entry->next(); |
| 242 | 240 | } |
| 243 | 241 | } |
| 244 | 242 | |
| r12264 | r12265 | |
| 268 | 266 | |
| 269 | 267 | WRITE8_MEMBER( s100_device::terminal_receive_w ) |
| 270 | 268 | { |
| 271 | | for (int i = 0; i < MAX_S100_SLOTS; i++) |
| 269 | device_s100_card_interface *entry = m_device_list.first(); |
| 270 | |
| 271 | while (entry) |
| 272 | 272 | { |
| 273 | | if (m_s100_device[i] != NULL && m_s100_device[i]->s100_has_terminal()) |
| 273 | if (entry->s100_has_terminal()) |
| 274 | 274 | { |
| 275 | | m_s100_device[i]->s100_terminal_w(data); |
| 275 | entry->s100_terminal_w(data); |
| 276 | 276 | break; |
| 277 | 277 | } |
| 278 | entry = entry->next(); |
| 278 | 279 | } |
| 279 | 280 | } |
| 280 | 281 | |
src/mess/machine/s100.h
| r12264 | r12265 | |
| 76 | 76 | #define S100_TAG "s100" |
| 77 | 77 | |
| 78 | 78 | |
| 79 | | #define MAX_S100_SLOTS 16 |
| 80 | 79 | |
| 81 | | |
| 82 | | |
| 83 | 80 | //************************************************************************** |
| 84 | 81 | // INTERFACE CONFIGURATION MACROS |
| 85 | 82 | //************************************************************************** |
| r12264 | r12265 | |
| 94 | 91 | const s100_bus_interface (_name) = |
| 95 | 92 | |
| 96 | 93 | |
| 97 | | #define MCFG_S100_SLOT_ADD(_num, _tag, _slot_intf, _def_slot, _def_inp) \ |
| 94 | #define MCFG_S100_SLOT_ADD(_tag, _slot_intf, _def_slot, _def_inp) \ |
| 98 | 95 | MCFG_DEVICE_ADD(_tag, S100_SLOT, 0) \ |
| 99 | 96 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp) \ |
| 100 | | s100_slot_device::static_set_s100_slot(*device, S100_TAG, _num); \ |
| 97 | s100_slot_device::static_set_s100_slot(*device, S100_TAG); \ |
| 101 | 98 | |
| 102 | 99 | |
| 103 | 100 | |
| r12264 | r12265 | |
| 120 | 117 | virtual void device_start(); |
| 121 | 118 | |
| 122 | 119 | // inline configuration |
| 123 | | static void static_set_s100_slot(device_t &device, const char *tag, int num); |
| 120 | static void static_set_s100_slot(device_t &device, const char *tag); |
| 124 | 121 | |
| 125 | 122 | private: |
| 126 | 123 | // configuration |
| 127 | 124 | const char *m_bus_tag; |
| 128 | | int m_bus_num; |
| 129 | 125 | s100_device *m_bus; |
| 130 | 126 | }; |
| 131 | 127 | |
| r12264 | r12265 | |
| 172 | 168 | // inline configuration |
| 173 | 169 | static void static_set_cputag(device_t &device, const char *tag); |
| 174 | 170 | |
| 175 | | void add_s100_card(device_s100_card_interface *card, int pos); |
| 171 | void add_s100_card(device_s100_card_interface *card); |
| 176 | 172 | |
| 177 | 173 | DECLARE_READ8_MEMBER( smemr_r ); |
| 178 | 174 | DECLARE_WRITE8_MEMBER( mwrt_w ); |
| r12264 | r12265 | |
| 231 | 227 | devcb_resolved_write_line m_out_error_func; |
| 232 | 228 | devcb_resolved_write8 m_out_terminal_func; |
| 233 | 229 | |
| 234 | | device_s100_card_interface *m_s100_device[MAX_S100_SLOTS]; |
| 230 | simple_list<device_s100_card_interface> m_device_list; |
| 235 | 231 | const char *m_cputag; |
| 236 | 232 | }; |
| 237 | 233 | |
| r12264 | r12265 | |
| 252 | 248 | device_s100_card_interface(const machine_config &mconfig, device_t &device); |
| 253 | 249 | virtual ~device_s100_card_interface(); |
| 254 | 250 | |
| 251 | device_s100_card_interface *next() const { return m_next; } |
| 252 | |
| 255 | 253 | // interrupts |
| 256 | 254 | virtual void s100_int_w(int state) { }; |
| 257 | 255 | virtual void s100_nmi_w(int state) { }; |
| r12264 | r12265 | |
| 293 | 291 | |
| 294 | 292 | public: |
| 295 | 293 | s100_device *m_s100; |
| 294 | device_s100_card_interface *m_next; |
| 296 | 295 | }; |
| 297 | 296 | |
| 298 | 297 | #endif |
src/mess/drivers/mpz80.c
| r12264 | r12265 | |
| 695 | 695 | DEVCB_NULL, |
| 696 | 696 | DEVCB_NULL, |
| 697 | 697 | DEVCB_NULL, |
| 698 | DEVCB_CPU_INPUT_LINE(Z80_TAG, Z80_INPUT_LINE_WAIT), |
| 698 | 699 | DEVCB_NULL, |
| 699 | 700 | DEVCB_NULL, |
| 700 | | DEVCB_NULL, |
| 701 | 701 | DEVCB_DEVICE_HANDLER(TERMINAL_TAG, terminal_write) |
| 702 | 702 | }; |
| 703 | 703 | |
| r12264 | r12265 | |
| 763 | 763 | |
| 764 | 764 | // S-100 |
| 765 | 765 | MCFG_S100_BUS_ADD(Z80_TAG, s100_intf) |
| 766 | | MCFG_S100_SLOT_ADD( 1, "s100_1", mpz80_s100_cards, "mm65k16s", NULL) |
| 767 | | MCFG_S100_SLOT_ADD( 2, "s100_2", mpz80_s100_cards, "wunderbus", NULL) |
| 768 | | MCFG_S100_SLOT_ADD( 3, "s100_3", mpz80_s100_cards, "dj2db", NULL) |
| 769 | | MCFG_S100_SLOT_ADD( 4, "s100_4", mpz80_s100_cards, NULL, NULL)//"hdcdma") |
| 770 | | MCFG_S100_SLOT_ADD( 5, "s100_5", mpz80_s100_cards, NULL, NULL) |
| 771 | | MCFG_S100_SLOT_ADD( 6, "s100_6", mpz80_s100_cards, NULL, NULL) |
| 772 | | MCFG_S100_SLOT_ADD( 7, "s100_7", mpz80_s100_cards, NULL, NULL) |
| 773 | | MCFG_S100_SLOT_ADD( 8, "s100_8", mpz80_s100_cards, NULL, NULL) |
| 774 | | MCFG_S100_SLOT_ADD( 9, "s100_9", mpz80_s100_cards, NULL, NULL) |
| 775 | | MCFG_S100_SLOT_ADD(10, "s100_10", mpz80_s100_cards, NULL, NULL) |
| 776 | | MCFG_S100_SLOT_ADD(11, "s100_11", mpz80_s100_cards, NULL, NULL) |
| 777 | | MCFG_S100_SLOT_ADD(12, "s100_12", mpz80_s100_cards, NULL, NULL) |
| 778 | | MCFG_S100_SLOT_ADD(13, "s100_13", mpz80_s100_cards, NULL, NULL) |
| 779 | | MCFG_S100_SLOT_ADD(14, "s100_14", mpz80_s100_cards, NULL, NULL) |
| 766 | MCFG_S100_SLOT_ADD("s100_1", mpz80_s100_cards, "mm65k16s", NULL) |
| 767 | MCFG_S100_SLOT_ADD("s100_2", mpz80_s100_cards, "wunderbus", NULL) |
| 768 | MCFG_S100_SLOT_ADD("s100_3", mpz80_s100_cards, "dj2db", NULL) |
| 769 | MCFG_S100_SLOT_ADD("s100_4", mpz80_s100_cards, NULL, NULL)//"hdcdma") |
| 770 | MCFG_S100_SLOT_ADD("s100_5", mpz80_s100_cards, NULL, NULL) |
| 771 | MCFG_S100_SLOT_ADD("s100_6", mpz80_s100_cards, NULL, NULL) |
| 772 | MCFG_S100_SLOT_ADD("s100_7", mpz80_s100_cards, NULL, NULL) |
| 773 | MCFG_S100_SLOT_ADD("s100_8", mpz80_s100_cards, NULL, NULL) |
| 774 | MCFG_S100_SLOT_ADD("s100_9", mpz80_s100_cards, NULL, NULL) |
| 775 | MCFG_S100_SLOT_ADD("s100_10", mpz80_s100_cards, NULL, NULL) |
| 776 | MCFG_S100_SLOT_ADD("s100_11", mpz80_s100_cards, NULL, NULL) |
| 777 | MCFG_S100_SLOT_ADD("s100_12", mpz80_s100_cards, NULL, NULL) |
| 778 | MCFG_S100_SLOT_ADD("s100_13", mpz80_s100_cards, NULL, NULL) |
| 779 | MCFG_S100_SLOT_ADD("s100_14", mpz80_s100_cards, NULL, NULL) |
| 780 | 780 | |
| 781 | 781 | // devices |
| 782 | 782 | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf) |