Previous 199869 Revisions Next

r40625 Sunday 6th September, 2015 at 23:48:20 UTC by Ariane Fugmann
Sega X-Board: gprider twin fixes.

works, but needs cleanup
[src/mame/drivers]segaxbd.c

trunk/src/mame/drivers/segaxbd.c
r249136r249137
371371      : segaxbd_new_state(mconfig, type, tag),
372372      m_subpcb(*this, "subpcb")
373373   {
374      for (int i = 0; i < 0x10; i++)
374      for (int i = 0; i < 0x800; i++)
375375      {
376         shareram1[i] = 0x00;
377         shareram2[i] = 0x00;
376         shareram[i] = 0x0000;
378377      }
378      rampage1 = 0x0000;
379      rampage2 = 0x0000;
379380   }
380381
381
382382   required_device<segaxbd_state> m_subpcb;
383383
384   DECLARE_READ16_MEMBER(shareram1_r) { return shareram1[offset]; }
385   DECLARE_WRITE16_MEMBER(shareram1_w) { COMBINE_DATA(&shareram1[offset]); }
386   DECLARE_READ16_MEMBER(shareram2_r) { return shareram2[offset]; }
387   DECLARE_WRITE16_MEMBER(shareram2_w) {COMBINE_DATA(&shareram2[offset]); }
384   DECLARE_READ16_MEMBER(shareram1_r) {
385      if (offset < 0x10) {
386         int address = (rampage1 << 4) + offset;
387         return shareram[address];
388      }
389      return 0xffff;
390   }
391   DECLARE_WRITE16_MEMBER(shareram1_w) {
392      if (offset < 0x10) {
393         int address = (rampage1 << 4) + offset;
394         COMBINE_DATA(&shareram[address]);
395      } else if (offset == 0x10) {
396         rampage1 = data & 0x00FF;
397      }
398   }
399   DECLARE_READ16_MEMBER(shareram2_r) {
400      if (offset < 0x10) {
401         int address = (rampage2 << 4) + offset;
402         return shareram[address];
403      }
404      return 0xffff;
405   }
406   DECLARE_WRITE16_MEMBER(shareram2_w) {
407      if (offset < 0x10) {
408         int address = (rampage2 << 4) + offset;
409         COMBINE_DATA(&shareram[address]);
410      } else if (offset == 0x10) {
411         rampage2 = data & 0x007F;
412      }
413   }
388414
389415   DECLARE_DRIVER_INIT(gprider_double);
390416
391
392   UINT16 shareram1[0x20];
393   UINT16 shareram2[0x20];
417   UINT16 shareram[0x800];
418   UINT16 rampage1;
419   UINT16 rampage2;
394420};
395421
396422//**************************************************************************
r249136r249137
37503776   m_mainpcb->install_gprider();
37513777   m_subpcb->install_gprider();
37523778
3753   m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram2_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram1_w), this));
3754   m_subpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram1_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram2_w), this));
3779   m_mainpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram1_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram1_w), this));
3780   m_subpcb->m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2F0000, 0x2F003f, read16_delegate(FUNC(segaxbd_new_state_double::shareram2_r), this), write16_delegate(FUNC(segaxbd_new_state_double::shareram2_w), this));
37553781}
37563782
37573783


Previous 199869 Revisions Next


© 1997-2024 The MAME Team