Previous 15994 Revisions Next

r12096 Tuesday 28th June, 2011 at 10:22:54 UTC by Curt Coder
[COMX35] Slot WIP. (nw)
[src/mess/drivers]comx35.c
[src/mess/machine]comx_clm.c comx_eb.c comx_eb.h comx_epr.c comx_joy.c comx_prn.c comx_ram.c comx_thm.c

src/mess/machine/comx_clm.c
r12095r12096
211211
212212void comx_clm_device::device_start()
213213{
214   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG);
214   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG);
215215
216216   m_rom = subregion("c000")->base();
217217   m_char_rom = subregion(MC6845_TAG)->base();
src/mess/machine/comx_thm.c
r12095r12096
5757
5858void comx_thm_device::device_start()
5959{
60   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG);
60   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG);
6161
6262   m_rom = subregion("c000")->base();
6363}
src/mess/machine/comx_prn.c
r12095r12096
6363
6464void comx_prn_device::device_start()
6565{
66   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG);
66   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG);
6767
6868   m_rom = subregion("c000")->base();
6969}
src/mess/machine/comx_ram.c
r12095r12096
3939
4040void comx_ram_device::device_start()
4141{
42   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG);
42   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG);
4343
4444   m_ram = auto_alloc_array(machine(), UINT8, RAM_SIZE);
4545
src/mess/machine/comx_joy.c
r12095r12096
7272
7373void comx_joy_device::device_start()
7474{
75   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG);
75   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG);
7676}
7777
7878
src/mess/machine/comx_epr.c
r12095r12096
5757
5858void comx_epr_device::device_start()
5959{
60   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG);
60   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG);
6161
6262   m_rom = subregion("c000")->base();
6363}
src/mess/machine/comx_eb.c
r12095r12096
156156
157157void comx_eb_device::device_start()
158158{
159   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_TAG);
159   m_bus = machine().device<comx_expansion_bus_device>(COMX_EXPANSION_BUS_TAG);
160160
161   m_slot1 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT1_TAG));
162   m_slot2 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT2_TAG));
163   m_slot3 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT3_TAG));
164   m_slot4 = dynamic_cast<comx_expansion_slot_device *>(subdevice(SLOT4_TAG));
161   m_slot[0] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT1_TAG));
162   m_slot[1] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT2_TAG));
163   m_slot[2] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT3_TAG));
164   m_slot[3] = dynamic_cast<device_comx_expansion_card_interface *>(subdevice(SLOT4_TAG));
165165   m_owner = dynamic_cast<comx_expansion_slot_device *>(owner());
166166   
167167   m_rom = subregion("e000")->base();
r12095r12096
185185{
186186   UINT8 data = 0;
187187   
188   if (offset >= 0xe000 && offset < 0xf000)
188   if (offset >= 0x1000 && offset < 0x1800)
189189   {
190      data = m_rom[offset & 0x7ff];
191   }
192   else if (offset >= 0xe000 && offset < 0xf000)
193   {
190194      data = m_rom[offset & 0xfff];
191195   }
196   else
197   {
198      for (int slot = 0; slot < MAX_EB_SLOTS; slot++)
199      {
200         if (BIT(m_select, slot) && m_slot[slot] != NULL)
201         {
202            data |= m_slot[slot]->comx_mrd_r(offset);
203         }
204      }
205   }
192206   
193207   return data;
194208}
r12095r12096
200214
201215void comx_eb_device::comx_q_w(int state)
202216{
217   for (int slot = 0; slot < MAX_EB_SLOTS; slot++)
218   {
219      if (BIT(m_select, slot) && m_slot[slot] != NULL)
220      {
221         m_slot[slot]->comx_q_w(state);
222      }
223   }
203224}
204225
205226
r12095r12096
209230
210231void comx_eb_device::comx_mwr_w(offs_t offset, UINT8 data)
211232{
233   for (int slot = 0; slot < MAX_EB_SLOTS; slot++)
234   {
235      if (BIT(m_select, slot) && m_slot[slot] != NULL)
236      {
237         m_slot[slot]->comx_mwr_w(offset, data);
238      }
239   }
212240}
213241
214242
r12095r12096
218246
219247UINT8 comx_eb_device::comx_io_r(offs_t offset)
220248{
221   return 0;
249   UINT8 data = 0;
250   
251   for (int slot = 0; slot < MAX_EB_SLOTS; slot++)
252   {
253      if (BIT(m_select, slot) && m_slot[slot] != NULL)
254      {
255         data |= m_slot[slot]->comx_io_r(offset);
256      }
257   }
258
259   return data;
222260}
223261
224262
r12095r12096
228266
229267void comx_eb_device::comx_io_w(offs_t offset, UINT8 data)
230268{
269   if (offset == 1)
270   {
271      m_select = data;
272   }
273   
274   for (int slot = 0; slot < MAX_EB_SLOTS; slot++)
275   {
276      if (BIT(m_select, slot) && m_slot[slot] != NULL)
277      {
278         m_slot[slot]->comx_io_w(offset, data);
279      }
280   }
231281}
232282
233283
src/mess/machine/comx_eb.h
r12095r12096
2727
2828
2929//**************************************************************************
30//  CONSTANTS
31//**************************************************************************
32
33#define MAX_EB_SLOTS   4
34
35
36
37//**************************************************************************
3038//  TYPE DEFINITIONS
3139//**************************************************************************
3240
r12095r12096
6371   UINT8 *m_rom;            // program ROM
6472   
6573   comx_expansion_slot_device   *m_owner;
74   device_comx_expansion_card_interface   *m_slot[MAX_EB_SLOTS];
6675   
67   comx_expansion_slot_device   *m_slot1;
68   comx_expansion_slot_device   *m_slot2;
69   comx_expansion_slot_device   *m_slot3;
70   comx_expansion_slot_device   *m_slot4;
71   
72   comx_expansion_slot_device   *m_active;
76   UINT8 m_select;
7377};
7478
7579
src/mess/drivers/comx35.c
r12095r12096
382382   
383383   // expansion bus
384384   MCFG_COMX_EXPANSION_BUS_ADD(CDP1802_TAG, CDP1869_CPU_CLK_PAL, expansion_intf)
385   MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, NULL)
385   MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, "fd")
386386
387387   /* internal ram */
388388   MCFG_RAM_ADD(RAM_TAG)
r12095r12096
411411   
412412   // expansion bus
413413   MCFG_COMX_EXPANSION_BUS_ADD(CDP1802_TAG, CDP1869_CPU_CLK_NTSC, expansion_intf)
414   MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, NULL)
414   MCFG_COMX_EXPANSION_SLOT_ADD("slot", comx_expansion_cards, "fd")
415415
416416   /* internal ram */
417417   MCFG_RAM_ADD(RAM_TAG)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team