Previous 199869 Revisions Next

r32741 Tuesday 14th October, 2014 at 17:40:53 UTC by David Haywood
improve (nw)
[src/mame/drivers]mario.c
[src/mame/includes]mario.h
[src/mame/video]mario.c

trunk/src/mame/includes/mario.h
r32740r32741
102102   DECLARE_WRITE8_MEMBER(mario_sh2_w);
103103   DECLARE_READ8_MEMBER(memory_read_byte);
104104   DECLARE_WRITE8_MEMBER(memory_write_byte);
105   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr);
105   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr, int dx, int dy);
106106   required_device<cpu_device> m_maincpu;
107107   optional_device<cpu_device> m_audiocpu;
108108   required_device<gfxdecode_device> m_gfxdecode;
trunk/src/mame/video/mario.c
r32740r32741
147147 * confirmed on mametests.org as being present on real PCB as well.
148148 */
149149
150void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr)
150void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr, int dx, int dy)
151151{
152152   /* TODO: draw_sprites should adopt the scanline logic from dkong.c
153153    * The schematics have the same logic for sprite buffering.
r32740r32741
177177                  m_spriteram[offs + 2],
178178                  (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor,
179179                  !(m_spriteram[offs + 1] & 0x80),!(m_spriteram[offs + 1] & 0x40),
180                  x, y,0);
180                  x+dx, y+dy,0);
181181         }
182182         else
183183         {
r32740r32741
187187                  m_spriteram[offs + 2],
188188                  (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor,
189189                  (m_spriteram[offs + 1] & 0x80),(m_spriteram[offs + 1] & 0x40),
190                  x, y,0);
190                  x+dx, y+dy,0);
191191         }
192192      }
193193   }
r32740r32741
214214UINT32 mario_state::screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
215215{
216216   screen_update_common(screen, bitmap, cliprect);
217   draw_sprites(bitmap, cliprect, 0, 3);
217   draw_sprites(bitmap, cliprect, 0, 3, 0, 0);
218218   return 0;
219219}
220220
221221UINT32 mario_state::screen_update_mariobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
222222{
223   // not sure
224   m_palette_bank = m_gfx_bank; // might be the 'attr' ram
225   machine().tilemap().mark_all_dirty();
226
227
223228   screen_update_common(screen, bitmap, cliprect);
224   draw_sprites(bitmap, cliprect, 3, 0);
229   draw_sprites(bitmap, cliprect, 3, 0, 8, -8);
225230   return 0;
226231}
trunk/src/mame/drivers/mario.c
r32740r32741
177177static ADDRESS_MAP_START( mariobl_map, AS_PROGRAM, 8, mario_state)
178178   AM_RANGE(0x0000, 0x5fff) AM_ROM
179179   AM_RANGE(0x6000, 0x6fff) AM_RAM
180   AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */
180   AM_RANGE(0x7000, 0x71ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */
181   AM_RANGE(0x7200, 0x73ff) AM_RAM // attrram?
181182   AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram")
182183   //AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN1")
184   AM_RANGE(0xa000, 0xa000) AM_READNOP   /* watchdog? */
183185   AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW")    /* DSW */
186   AM_RANGE(0xa206, 0xa206) AM_WRITE(mario_gfxbank_w)
184187   AM_RANGE(0xe000, 0xffff) AM_ROM
185188ADDRESS_MAP_END
186189
r32740r32741
501504   
502505   MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2)   /* XTAL confirmed, divisor guessed */
503506   MCFG_AY8910_PORT_A_READ_CB(IOPORT("SYSTEM"))
507//   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay1_outputb_w))
508
504509   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
505510
506511   MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2)   /* XTAL confirmed, divisor guessed */
507512   MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS"))
513//   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay2_outputb_w))
514
508515   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
509516
510517MACHINE_CONFIG_END

Previous 199869 Revisions Next


© 1997-2024 The MAME Team