Previous 199869 Revisions Next

r22080 Monday 25th March, 2013 at 16:09:57 UTC by Fabio Priuli
minor cleanup. nw.
[src/mame/includes]megadriv.h
[src/mame/machine]megadriv.c

trunk/src/mame/machine/megadriv.c
r22079r22080
6363
6464READ8_MEMBER(md_base_state::megadriv_68k_YM2612_read)
6565{
66   device_t *device = machine().device("ymsnd");
6766   //mame_printf_debug("megadriv_68k_YM2612_read %02x %04x\n",offset,mem_mask);
6867   if ((m_genz80.z80_has_bus == 0) && (m_genz80.z80_is_reset == 0))
6968   {
70      return ym2612_r(device, space, offset);
69      return ym2612_r(m_ymsnd, space, offset);
7170   }
7271   else
7372   {
r22079r22080
8180
8281WRITE8_MEMBER(md_base_state::megadriv_68k_YM2612_write)
8382{
84   device_t *device = machine().device("ymsnd");
8583   //mame_printf_debug("megadriv_68k_YM2612_write %02x %04x %04x\n",offset,data,mem_mask);
8684   if ((m_genz80.z80_has_bus == 0) && (m_genz80.z80_is_reset == 0))
8785   {
88      ym2612_w(device, space, offset, data);
86      ym2612_w(m_ymsnd, space, offset, data);
8987   }
9088   else
9189   {
r22079r22080
429427      if (((m_megadrive_io_data_regs[portnum]&0x40)==0x00) && ((data&0x40) == 0x40))
430428      {
431429         m_io_stage[portnum]++;
432         m_io_timeout[portnum]->adjust(machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
430         m_io_timeout[portnum]->adjust(m_maincpu->cycles_to_attotime(8192));
433431      }
434432
435433   }
r22079r22080
630628   {
631629      m_z80snd->reset();
632630      m_z80snd->suspend(SUSPEND_REASON_HALT, 1);
633      machine().device("ymsnd")->reset();
631      m_ymsnd->reset();
634632   }
635633   else
636634   {
r22079r22080
838836
839837UINT32 md_base_state::screen_update_megadriv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
840838{
841   sega_genesis_vdp_device *vdp = machine().device<sega_genesis_vdp_device>("gen_vdp"); // yuck
842
843839   /* Copy our screen buffer here */
844840   for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
845841   {
846842      UINT32* desty = &bitmap.pix32(y, 0);
847843      UINT16* srcy;
848844
849      if (!vdp->m_use_alt_timing)
850      {
851         srcy = &vdp->m_render_bitmap->pix(y, 0);
852      }
845      if (!m_vdp->m_use_alt_timing)
846         srcy = &m_vdp->m_render_bitmap->pix(y, 0);
853847      else
854      {
855         srcy = vdp->m_render_line;
856      }
848         srcy = m_vdp->m_render_line;
857849
858850      for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
859851      {
trunk/src/mame/includes/megadriv.h
r22079r22080
6262   : driver_device(mconfig, type, tag),
6363      m_maincpu(*this,"maincpu"),
6464      m_z80snd(*this,"genesis_snd_z80"),
65      m_ymsnd(*this,"ymsnd"),
6566      m_vdp(*this,"gen_vdp"),
6667      m_32x(*this,"sega32x"),
6768      m_segacd(*this,"segacd"),
r22079r22080
7071   { }
7172   required_device<cpu_device> m_maincpu;
7273   optional_device<cpu_device> m_z80snd;
74   optional_device<device_t> m_ymsnd;
7375   required_device<sega_genesis_vdp_device> m_vdp;
7476   optional_device<sega_32x_device> m_32x;
7577   optional_device<sega_segacd_device> m_segacd;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team