mirror of
https://github.com/holub/mame
synced 2025-04-28 19:14:55 +03:00
gstriker.cpp: added buffered spriteram (sprites being ahead 2 frames) [Angelo Salese]
This commit is contained in:
parent
3a9849a5b3
commit
d3ce43f6a8
@ -502,6 +502,7 @@ static MACHINE_CONFIG_START( gstriker )
|
||||
MCFG_SCREEN_SIZE(64*8, 64*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(gstriker_state, screen_update)
|
||||
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(gstriker_state, screen_vblank))
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", gstriker)
|
||||
|
@ -46,6 +46,8 @@ public:
|
||||
required_device<mb3773_device> m_watchdog;
|
||||
|
||||
required_shared_ptr<uint16_t> m_CG10103_m_vram;
|
||||
std::unique_ptr<uint16_t[]> m_buffered_spriteram;
|
||||
std::unique_ptr<uint16_t[]> m_buffered_spriteram2;
|
||||
required_shared_ptr<uint16_t> m_work_ram;
|
||||
required_shared_ptr<uint16_t> m_mixerregs1;
|
||||
required_shared_ptr<uint16_t> m_mixerregs2;
|
||||
@ -76,6 +78,7 @@ public:
|
||||
DECLARE_DRIVER_INIT(twcup94);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank);
|
||||
|
||||
void mcu_init();
|
||||
};
|
||||
|
@ -14,6 +14,22 @@ void gstriker_state::video_start()
|
||||
|
||||
// Initialize the chip for the screen plane
|
||||
m_bg->set_transparent_pen(0xf);
|
||||
|
||||
m_buffered_spriteram = std::make_unique<uint16_t[]>(0x2000);
|
||||
m_buffered_spriteram2 = std::make_unique<uint16_t[]>(0x2000);
|
||||
save_pointer(NAME(m_buffered_spriteram.get()), 0x2000);
|
||||
save_pointer(NAME(m_buffered_spriteram2.get()), 0x2000);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(gstriker_state::screen_vblank)
|
||||
{
|
||||
// sprites are two frames ahead
|
||||
// TODO: probably all Video System games are (Aero Fighters definitely desyncs wrt background)
|
||||
if(state)
|
||||
{
|
||||
memcpy(m_buffered_spriteram.get(), m_CG10103_m_vram, 0x2000);
|
||||
memcpy(m_buffered_spriteram2.get(), m_buffered_spriteram.get(), 0x2000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,15 +45,14 @@ uint32_t gstriker_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
|
||||
m_tx->set_pal_base( (m_mixerregs1[2]&0xf000)>>8 );
|
||||
|
||||
|
||||
// Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably
|
||||
// needs sprite orthogonality
|
||||
// Sandwitched screen/sprite0/score/sprite1. Surely wrong, probably needs sprite orthogonality
|
||||
m_bg->draw( screen, bitmap,cliprect, 0);
|
||||
|
||||
m_spr->draw_sprites(m_CG10103_m_vram, 0x2000, screen, bitmap, cliprect, 0x2, 0x0);
|
||||
m_spr->draw_sprites(m_buffered_spriteram2.get(), 0x2000, screen, bitmap, cliprect, 0x2, 0x0);
|
||||
|
||||
m_tx->draw(screen, bitmap, cliprect, 0);
|
||||
|
||||
m_spr->draw_sprites(m_CG10103_m_vram, 0x2000, screen, bitmap, cliprect, 0x2, 0x2);
|
||||
m_spr->draw_sprites(m_buffered_spriteram2.get(), 0x2000, screen, bitmap, cliprect, 0x2, 0x2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -279,6 +279,7 @@ void mb60553_zooming_tilemap_device::draw( screen_device &screen, bitmap_ind16&
|
||||
incxx = m_lineram[(line)*8+0]<<4;
|
||||
// startx has an offset based off current x zoom value
|
||||
// This is confirmed by Tecmo World Cup '94 startx being 0xff40 (-192) when showing footballer pics on attract mode (incxx is 0x800)
|
||||
// TODO: slightly offset?
|
||||
xoffset = (float)incxx/(float)0x10000 * 384.0;
|
||||
|
||||
startx = m_regs[0] + (uint32_t)xoffset;
|
||||
|
Loading…
Reference in New Issue
Block a user