improve (nw)

This commit is contained in:
David Haywood 2014-10-14 17:40:53 +00:00
parent c2a5a49e28
commit 6948f80c4f
3 changed files with 19 additions and 7 deletions

View File

@ -177,10 +177,13 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mariobl_map, AS_PROGRAM, 8, mario_state)
AM_RANGE(0x0000, 0x5fff) AM_ROM
AM_RANGE(0x6000, 0x6fff) AM_RAM
AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */
AM_RANGE(0x7000, 0x71ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */
AM_RANGE(0x7200, 0x73ff) AM_RAM // attrram?
AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram")
//AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN1")
AM_RANGE(0xa000, 0xa000) AM_READNOP /* watchdog? */
AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW") /* DSW */
AM_RANGE(0xa206, 0xa206) AM_WRITE(mario_gfxbank_w)
AM_RANGE(0xe000, 0xffff) AM_ROM
ADDRESS_MAP_END
@ -501,10 +504,14 @@ static MACHINE_CONFIG_START( mariobl, mario_state )
MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("SYSTEM"))
// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay1_outputb_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */
MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS"))
// MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay2_outputb_w))
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33)
MACHINE_CONFIG_END

View File

@ -102,7 +102,7 @@ public:
DECLARE_WRITE8_MEMBER(mario_sh2_w);
DECLARE_READ8_MEMBER(memory_read_byte);
DECLARE_WRITE8_MEMBER(memory_write_byte);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr, int dx, int dy);
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
required_device<gfxdecode_device> m_gfxdecode;

View File

@ -147,7 +147,7 @@ void mario_state::video_start()
* confirmed on mametests.org as being present on real PCB as well.
*/
void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr)
void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr, int dx, int dy)
{
/* TODO: draw_sprites should adopt the scanline logic from dkong.c
* The schematics have the same logic for sprite buffering.
@ -177,7 +177,7 @@ void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
m_spriteram[offs + 2],
(m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor,
!(m_spriteram[offs + 1] & 0x80),!(m_spriteram[offs + 1] & 0x40),
x, y,0);
x+dx, y+dy,0);
}
else
{
@ -187,7 +187,7 @@ void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect,
m_spriteram[offs + 2],
(m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor,
(m_spriteram[offs + 1] & 0x80),(m_spriteram[offs + 1] & 0x40),
x, y,0);
x+dx, y+dy,0);
}
}
}
@ -214,13 +214,18 @@ UINT32 mario_state::screen_update_common(screen_device &screen, bitmap_ind16 &bi
UINT32 mario_state::screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen_update_common(screen, bitmap, cliprect);
draw_sprites(bitmap, cliprect, 0, 3);
draw_sprites(bitmap, cliprect, 0, 3, 0, 0);
return 0;
}
UINT32 mario_state::screen_update_mariobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// not sure
m_palette_bank = m_gfx_bank; // might be the 'attr' ram
machine().tilemap().mark_all_dirty();
screen_update_common(screen, bitmap, cliprect);
draw_sprites(bitmap, cliprect, 3, 0);
draw_sprites(bitmap, cliprect, 3, 0, 8, -8);
return 0;
}