Added preliminary raster effects to tecmo.cpp, improves ending screen effect in Gemini Wing [Angelo Salese]

This commit is contained in:
angelosa 2016-09-15 15:53:07 +02:00
parent 9533bb5200
commit f14945d891
3 changed files with 23 additions and 11 deletions

View File

@ -6,6 +6,10 @@ tecmo.cpp
driver by Nicola Salmoria
TODO:
- raster effect in Gemini Wing THE END ending, needs accurate clocks measured
on a genuine board (waitstates too?) and a side-by-side test;
Notes:
- btanb: missing drums in backfirt, there isn't any ADPCM / rom that makes
that to happen (code still tries to writes on that, but it's just nop'ed);
@ -627,10 +631,7 @@ static MACHINE_CONFIG_START( rygar, tecmo_state )
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0) /* frames per second, vblank duration */)
MCFG_SCREEN_SIZE(32*8, 32*8)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_RAW_PARAMS(XTAL_24MHz/4, 396,0,256,256,16,240)
MCFG_SCREEN_UPDATE_DRIVER(tecmo_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
@ -661,7 +662,6 @@ static MACHINE_CONFIG_DERIVED( gemini, rygar )
/* basic machine hardware */
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_CLOCK(6000000)
MCFG_CPU_PROGRAM_MAP(gemini_map)
MCFG_CPU_MODIFY("soundcpu")

View File

@ -13,6 +13,7 @@ public:
m_maincpu(*this, "maincpu"),
m_soundcpu(*this, "soundcpu"),
m_msm(*this, "msm"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_sprgen(*this, "spritegen"),
@ -25,6 +26,7 @@ public:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_soundcpu;
optional_device<msm5205_device> m_msm;
required_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<tecmo_spr_device> m_sprgen;

View File

@ -133,6 +133,7 @@ WRITE8_MEMBER(tecmo_state::fgscroll_w)
m_fg_tilemap->set_scrollx(0, m_fgscroll[0] + 256 * m_fgscroll[1]);
m_fg_tilemap->set_scrolly(0, m_fgscroll[2]);
m_screen->update_partial(m_screen->vpos());
}
WRITE8_MEMBER(tecmo_state::bgscroll_w)
@ -141,6 +142,7 @@ WRITE8_MEMBER(tecmo_state::bgscroll_w)
m_bg_tilemap->set_scrollx(0, m_bgscroll[0] + 256 * m_bgscroll[1]);
m_bg_tilemap->set_scrolly(0, m_bgscroll[2]);
m_screen->update_partial(m_screen->vpos());
}
WRITE8_MEMBER(tecmo_state::flipscreen_w)
@ -160,12 +162,20 @@ WRITE8_MEMBER(tecmo_state::flipscreen_w)
UINT32 tecmo_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
screen.priority().fill(0, cliprect);
bitmap.fill(0x100, cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0,1);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0,2);
m_tx_tilemap->draw(screen, bitmap, cliprect, 0,4);
rectangle clip;
clip.min_x = cliprect.min_x;
clip.max_x = cliprect.max_x;
m_sprgen->draw_sprites_8bit(screen,bitmap,m_gfxdecode,cliprect, m_spriteram, m_spriteram.bytes(), m_video_type, flip_screen());
for (int line = cliprect.min_y; line <= cliprect.max_y;line++)
{
clip.min_y = clip.max_y = line;
screen.priority().fill(0, clip);
bitmap.fill(0x100, clip);
m_bg_tilemap->draw(screen, bitmap, clip, 0,1);
m_fg_tilemap->draw(screen, bitmap, clip, 0,2);
m_tx_tilemap->draw(screen, bitmap, clip, 0,4);
m_sprgen->draw_sprites_8bit(screen,bitmap,m_gfxdecode,clip, m_spriteram, m_spriteram.bytes(), m_video_type, flip_screen());
}
return 0;
}