Previous 15994 Revisions Next

r12265 Monday 18th July, 2011 at 22:25:58 UTC by Curt Coder
[MPZ80] Removed number parameter from S100 slot interface, and added Z80 WAIT logic. (nw)
[src/mess/drivers]mpz80.c
[src/mess/machine]s100.c s100.h s100_dj2db.c s100_dj2db.h

src/mess/machine/s100_dj2db.c
r12264r12265
8080
8181WRITE_LINE_MEMBER( s100_dj2db_device::fdc_intrq_w )
8282{
83   m_s100->rdy_w(CLEAR_LINE);
84   
8385   switch (input_port_read(this, "J1A"))
8486   {
8587   case 0: m_s100->vi0_w(state); break;
r12264r12265
9496   }
9597}
9698
99WRITE_LINE_MEMBER( s100_dj2db_device::fdc_drq_w )
100{
101   m_s100->rdy_w(CLEAR_LINE);
102}
103
97104static const wd17xx_interface fdc_intf =
98105{
99106   DEVCB_NULL,
100107   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),
102109   { FLOPPY_0, FLOPPY_1, NULL, NULL }
103110};
104111
r12264r12265
357364   }
358365   else if ((offset >= 0xfbfc) && (offset < 0xfc00))
359366   {
367      m_s100->rdy_w(ASSERT_LINE);
368     
360369      data = wd17xx_r(m_fdc, offset & 0x03);
361370   }
362371   else if ((offset >= 0xfc00) && (offset < 0x10000))
src/mess/machine/s100_dj2db.h
r12264r12265
4444
4545   // not really public
4646   DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
47   DECLARE_WRITE_LINE_MEMBER( fdc_drq_w );
4748
4849protected:
4950   // device-level overrides
src/mess/machine/s100.c
r12264r12265
3131{
3232}
3333
34void s100_slot_device::static_set_s100_slot(device_t &device, const char *tag, int num)
34void s100_slot_device::static_set_s100_slot(device_t &device, const char *tag)
3535{
3636   s100_slot_device &s100_card = dynamic_cast<s100_slot_device &>(device);
3737   s100_card.m_bus_tag = tag;
38   s100_card.m_bus_num = num;
3938}
4039
40
4141//-------------------------------------------------
4242//  device_start - device-specific startup
4343//-------------------------------------------------
r12264r12265
4646{
4747   m_bus = machine().device<s100_device>(m_bus_tag);
4848   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);
5050}
5151
5252
r12264r12265
117117s100_device::s100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
118118        device_t(mconfig, S100, "S100", tag, owner, clock)
119119{
120   for (int i = 0; i < MAX_S100_SLOTS; i++)
121      m_s100_device[i] = NULL;
122120}
123121
124122
r12264r12265
165163//  add_s100_card - add S100 card
166164//-------------------------------------------------
167165
168void s100_device::add_s100_card(device_s100_card_interface *card, int pos)
166void s100_device::add_s100_card(device_s100_card_interface *card)
169167{
170   m_s100_device[pos] = card;
168   m_device_list.append(*card);
171169}
172170
173171
r12264r12265
179177{
180178   UINT8 data = 0;
181179
182   for (int i = 0; i < MAX_S100_SLOTS; i++)
180   device_s100_card_interface *entry = m_device_list.first();
181
182   while (entry)
183183   {
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();
188186   }
189187
190188   return data;
r12264r12265
197195
198196WRITE8_MEMBER( s100_device::mwrt_w )
199197{
200   for (int i = 0; i < MAX_S100_SLOTS; i++)
198   device_s100_card_interface *entry = m_device_list.first();
199
200   while (entry)
201201   {
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();
206204   }
207205}
208206
r12264r12265
215213{
216214   UINT8 data = 0;
217215
218   for (int i = 0; i < MAX_S100_SLOTS; i++)
216   device_s100_card_interface *entry = m_device_list.first();
217
218   while (entry)
219219   {
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();
224222   }
225223
226224   return data;
r12264r12265
233231
234232WRITE8_MEMBER( s100_device::sout_w )
235233{
236   for (int i = 0; i < MAX_S100_SLOTS; i++)
234   device_s100_card_interface *entry = m_device_list.first();
235
236   while (entry)
237237   {
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();
242240   }
243241}
244242
r12264r12265
268266
269267WRITE8_MEMBER( s100_device::terminal_receive_w )
270268{
271   for (int i = 0; i < MAX_S100_SLOTS; i++)
269   device_s100_card_interface *entry = m_device_list.first();
270
271   while (entry)
272272   {
273      if (m_s100_device[i] != NULL && m_s100_device[i]->s100_has_terminal())
273      if (entry->s100_has_terminal())
274274      {
275         m_s100_device[i]->s100_terminal_w(data);
275         entry->s100_terminal_w(data);
276276         break;
277277      }
278      entry = entry->next();
278279   }
279280}
280281
src/mess/machine/s100.h
r12264r12265
7676#define S100_TAG      "s100"
7777
7878
79#define MAX_S100_SLOTS   16
8079
81
82
8380//**************************************************************************
8481//  INTERFACE CONFIGURATION MACROS
8582//**************************************************************************
r12264r12265
9491   const s100_bus_interface (_name) =
9592
9693
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) \
9895    MCFG_DEVICE_ADD(_tag, S100_SLOT, 0) \
9996   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); \
10198
10299
103100
r12264r12265
120117   virtual void device_start();
121118
122119    // 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);
124121
125122private:
126123   // configuration
127124   const char *m_bus_tag;
128   int m_bus_num;
129125   s100_device  *m_bus;
130126};
131127
r12264r12265
172168   // inline configuration
173169   static void static_set_cputag(device_t &device, const char *tag);
174170
175   void add_s100_card(device_s100_card_interface *card, int pos);
171   void add_s100_card(device_s100_card_interface *card);
176172
177173   DECLARE_READ8_MEMBER( smemr_r );
178174   DECLARE_WRITE8_MEMBER( mwrt_w );
r12264r12265
231227   devcb_resolved_write_line   m_out_error_func;
232228   devcb_resolved_write8      m_out_terminal_func;
233229
234   device_s100_card_interface *m_s100_device[MAX_S100_SLOTS];
230   simple_list<device_s100_card_interface> m_device_list;
235231   const char *m_cputag;
236232};
237233
r12264r12265
252248   device_s100_card_interface(const machine_config &mconfig, device_t &device);
253249   virtual ~device_s100_card_interface();
254250
251   device_s100_card_interface *next() const { return m_next; }
252
255253   // interrupts
256254   virtual void s100_int_w(int state) { };
257255   virtual void s100_nmi_w(int state) { };
r12264r12265
293291
294292public:
295293   s100_device  *m_s100;
294   device_s100_card_interface *m_next;
296295};
297296
298297#endif
src/mess/drivers/mpz80.c
r12264r12265
695695   DEVCB_NULL,
696696   DEVCB_NULL,
697697   DEVCB_NULL,
698   DEVCB_CPU_INPUT_LINE(Z80_TAG, Z80_INPUT_LINE_WAIT),
698699   DEVCB_NULL,
699700   DEVCB_NULL,
700   DEVCB_NULL,
701701   DEVCB_DEVICE_HANDLER(TERMINAL_TAG, terminal_write)
702702};
703703
r12264r12265
763763
764764   // S-100
765765   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)
780780
781781   // devices
782782   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team