aerofgt.cpp: Video and sound refinements

- Fix sound loss in spinlbrk and clones caused by misconfigured ROM bank
- Work towards flip screen support for most games; aerofgtb is nearly correct now
This commit is contained in:
AJR 2017-06-05 23:38:24 -04:00
parent a7d1fc096d
commit a29e43a74c
5 changed files with 110 additions and 66 deletions

View File

@ -107,6 +107,11 @@ WRITE8_MEMBER(aerofgt_state::aerofgt_sh_bankswitch_w)
m_soundbank->set_entry(data & 0x03);
}
WRITE8_MEMBER(aerofgt_state::spinlbrk_sh_bankswitch_w)
{
m_soundbank->set_entry(data & 0x01);
}
WRITE16_MEMBER(aerofgt_state::pspikesb_oki_banking_w)
{
m_oki->set_rom_bank(data & 3);
@ -220,7 +225,7 @@ static ADDRESS_MAP_START( karatblz_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */
AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_SHARE("spriteram3")
AM_RANGE(0x0fe000, 0x0fe7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0")
AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0") AM_WRITE8(spinlbrk_flip_screen_w, 0xff00)
AM_RANGE(0x0ff002, 0x0ff003) AM_READ_PORT("IN1") AM_WRITE8(karatblz_gfxbank_w, 0xff00)
AM_RANGE(0x0ff004, 0x0ff005) AM_READ_PORT("IN2")
AM_RANGE(0x0ff006, 0x0ff007) AM_READ_PORT("IN3") AM_WRITE8(sound_command_w, 0x00ff)
@ -239,7 +244,8 @@ static ADDRESS_MAP_START( spinlbrk_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0xffc000, 0xffc7ff) AM_RAM AM_SHARE("spriteram3")
AM_RANGE(0xffd000, 0xffd1ff) AM_RAM AM_SHARE("rasterram") /* bg1 scroll registers */
AM_RANGE(0xffe000, 0xffe7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE8(spinlbrk_gfxbank_w, 0x00ff)
AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE8(spinlbrk_flip_screen_w, 0xff00)
AM_RANGE(0xfff000, 0xfff001) AM_WRITE8(spinlbrk_gfxbank_w, 0x00ff)
AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE(aerofgt_bg2scrollx_w)
AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW")
AM_RANGE(0xfff006, 0xfff007) AM_WRITE8(sound_command_w, 0x00ff)
@ -260,7 +266,7 @@ static ADDRESS_MAP_START( turbofrc_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_SHARE("spriteram3")
AM_RANGE(0x0fd000, 0x0fdfff) AM_RAM AM_SHARE("rasterram") /* bg1 scroll registers */
AM_RANGE(0x0fe000, 0x0fe7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0")
AM_RANGE(0x0ff000, 0x0ff001) AM_READ_PORT("IN0") AM_WRITE8(turbofrc_flip_screen_w, 0x00ff)
AM_RANGE(0x0ff002, 0x0ff003) AM_READ_PORT("IN1") AM_WRITE(aerofgt_bg1scrolly_w)
AM_RANGE(0x0ff004, 0x0ff005) AM_READ_PORT("DSW") AM_WRITE(aerofgt_bg2scrollx_w)
AM_RANGE(0x0ff006, 0x0ff007) AM_READ8(pending_command_r, 0x00ff) AM_WRITE(aerofgt_bg2scrolly_w)
@ -281,7 +287,7 @@ static ADDRESS_MAP_START( aerofgtb_map, AS_PROGRAM, 16, aerofgt_state )
AM_RANGE(0x0f8000, 0x0fbfff) AM_RAM /* work RAM */
AM_RANGE(0x0fc000, 0x0fc7ff) AM_RAM AM_SHARE("spriteram3")
AM_RANGE(0x0fd000, 0x0fd7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette")
AM_RANGE(0x0fe000, 0x0fe001) AM_READ_PORT("IN0")
AM_RANGE(0x0fe000, 0x0fe001) AM_READ_PORT("IN0") AM_WRITE8(turbofrc_flip_screen_w, 0x00ff)
AM_RANGE(0x0fe002, 0x0fe003) AM_READ_PORT("IN1") AM_WRITE(aerofgt_bg1scrolly_w)
AM_RANGE(0x0fe004, 0x0fe005) AM_READ_PORT("DSW1") AM_WRITE(aerofgt_bg2scrollx_w)
AM_RANGE(0x0fe006, 0x0fe007) AM_READ8(pending_command_r, 0x00ff) AM_WRITE(aerofgt_bg2scrolly_w)
@ -388,6 +394,13 @@ static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, aerofgt_state )
AM_RANGE(0x8000, 0xffff) AM_ROMBANK("soundbank")
ADDRESS_MAP_END
static ADDRESS_MAP_START( spinlbrk_sound_portmap, AS_IO, 8, aerofgt_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(spinlbrk_sh_bankswitch_w)
AM_RANGE(0x14, 0x14) AM_DEVREAD("soundlatch", generic_latch_8_device, read) AM_WRITE(pending_command_clear_w)
AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE("ymsnd", ym2610_device, read, write)
ADDRESS_MAP_END
static ADDRESS_MAP_START( turbofrc_sound_portmap, AS_IO, 8, aerofgt_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE(0x00, 0x00) AM_WRITE(aerofgt_sh_bankswitch_w)
@ -1320,6 +1333,13 @@ MACHINE_START_MEMBER(aerofgt_state,aerofgt)
MACHINE_START_CALL_MEMBER(common);
}
MACHINE_START_MEMBER(aerofgt_state,spinlbrk)
{
m_soundbank->configure_entries(0, 2, memregion("audiocpu")->base()+0x8000, 0x8000);
MACHINE_START_CALL_MEMBER(common);
}
MACHINE_RESET_MEMBER(aerofgt_state,common)
{
m_pending_command = 0;
@ -1613,10 +1633,10 @@ static MACHINE_CONFIG_START( spinlbrk )
MCFG_CPU_ADD("audiocpu",Z80,XTAL_20MHz/4) /* 5mhz verified on pcb */
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_CPU_IO_MAP(turbofrc_sound_portmap)
MCFG_CPU_IO_MAP(spinlbrk_sound_portmap)
/* IRQs are triggered by the YM2610 */
MCFG_MACHINE_START_OVERRIDE(aerofgt_state,aerofgt)
MCFG_MACHINE_START_OVERRIDE(aerofgt_state,spinlbrk)
MCFG_MACHINE_RESET_OVERRIDE(aerofgt_state,aerofgt)
/* video hardware */
@ -2265,9 +2285,9 @@ ROM_START( spinlbrk )
ROM_LOAD16_BYTE( "ic93", 0x20000, 0x10000, CRC(726f4683) SHA1(65aff0548333571d47a96d4bf5a7857f12399cc7) )
ROM_LOAD16_BYTE( "ic94", 0x20001, 0x10000, CRC(c4385e03) SHA1(6683eed812fa8a5430125b14e8647f8e9024bbdd) )
ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k for the audio CPU + banks */
ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU + banks */
ROM_LOAD( "ic117", 0x00000, 0x08000, CRC(625ada41) SHA1(2dd0674c68ea382431115c155afbf880f5b9deb2) )
ROM_LOAD( "ic118", 0x10000, 0x10000, CRC(1025f024) SHA1(3e497c74c950d2cd2a0931cf2ae9b0124d11ca6a) )
ROM_LOAD( "ic118", 0x08000, 0x10000, CRC(1025f024) SHA1(3e497c74c950d2cd2a0931cf2ae9b0124d11ca6a) )
ROM_REGION( 0x100000, "gfx1", 0 )
ROM_LOAD( "ic15", 0x000000, 0x80000, CRC(e318cf3a) SHA1(d634001a0029566ce7b8fa30075970919eb5f44e) )
@ -2315,9 +2335,9 @@ ROM_START( spinlbrku )
ROM_LOAD16_BYTE( "ic93.u4", 0x20000, 0x10000, CRC(0cf73029) SHA1(e1346b759a41f9eec9536dc90671778582e595b4) )
ROM_LOAD16_BYTE( "ic94.u3", 0x20001, 0x10000, CRC(5cf7c426) SHA1(b201da40c4511d2845004dff72d36adbb8a4fab9) )
ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k for the audio CPU + banks */
ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU + banks */
ROM_LOAD( "ic117", 0x00000, 0x08000, CRC(625ada41) SHA1(2dd0674c68ea382431115c155afbf880f5b9deb2) )
ROM_LOAD( "ic118", 0x10000, 0x10000, CRC(1025f024) SHA1(3e497c74c950d2cd2a0931cf2ae9b0124d11ca6a) )
ROM_LOAD( "ic118", 0x08000, 0x10000, CRC(1025f024) SHA1(3e497c74c950d2cd2a0931cf2ae9b0124d11ca6a) )
ROM_REGION( 0x100000, "gfx1", 0 )
ROM_LOAD( "ic15", 0x000000, 0x80000, CRC(e318cf3a) SHA1(d634001a0029566ce7b8fa30075970919eb5f44e) )
@ -2365,9 +2385,9 @@ ROM_START( spinlbrkj )
ROM_LOAD16_BYTE( "j4", 0x20000, 0x10000, CRC(33e33912) SHA1(d6d052cd8dbedfd254bdf5e82ad770e4bf241777) )
ROM_LOAD16_BYTE( "j3", 0x20001, 0x10000, CRC(16ca61d0) SHA1(5d99a1261251412c3c758af751997fe31026c0d6) )
ROM_REGION( 0x30000, "audiocpu", 0 ) /* 64k for the audio CPU + banks */
ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU + banks */
ROM_LOAD( "ic117", 0x00000, 0x08000, CRC(625ada41) SHA1(2dd0674c68ea382431115c155afbf880f5b9deb2) )
ROM_LOAD( "ic118", 0x10000, 0x10000, CRC(1025f024) SHA1(3e497c74c950d2cd2a0931cf2ae9b0124d11ca6a) )
ROM_LOAD( "ic118", 0x08000, 0x10000, CRC(1025f024) SHA1(3e497c74c950d2cd2a0931cf2ae9b0124d11ca6a) )
ROM_REGION( 0x100000, "gfx1", 0 )
ROM_LOAD( "ic15", 0x000000, 0x80000, CRC(e318cf3a) SHA1(d634001a0029566ce7b8fa30075970919eb5f44e) )
@ -2882,8 +2902,8 @@ GAME( 1991, turbofrcu, turbofrc, turbofrc, turbofrc, aerofgt_state, 0, ROT270, "
// the tiles on these also contain an alt title 'The Final War' for both the title screen and attract logo was it ever used?
GAME( 1992, aerofgt, 0, aerofgt, aerofgt, aerofgt_state, 0, ROT270, "Video System Co.", "Aero Fighters (World / USA + Canada / Korea / Hong Kong / Taiwan) (newer hardware)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // this has the newer sprite chip etc. unlike all other games in this driver..
GAME( 1992, aerofgtb, aerofgt, aerofgtb, aerofgtb, aerofgt_state, 0, ROT270, "Video System Co.", "Aero Fighters (Taiwan / Japan, set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // probably intended for Taiwan because the Japanese name is Sonic Wings (below)
GAME( 1992, aerofgtc, aerofgt, aerofgtb, aerofgtb, aerofgt_state, 0, ROT270, "Video System Co.", "Aero Fighters (Taiwan / Japan, set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1992, sonicwi, aerofgt, aerofgtb, aerofgtb, aerofgt_state, 0, ROT270, "Video System Co.", "Sonic Wings (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
GAME( 1992, aerofgtb, aerofgt, aerofgtb, aerofgtb, aerofgt_state, 0, ROT270, "Video System Co.", "Aero Fighters (Taiwan / Japan, set 1)", MACHINE_SUPPORTS_SAVE ) // probably intended for Taiwan because the Japanese name is Sonic Wings (below)
GAME( 1992, aerofgtc, aerofgt, aerofgtb, aerofgtb, aerofgt_state, 0, ROT270, "Video System Co.", "Aero Fighters (Taiwan / Japan, set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, sonicwi, aerofgt, aerofgtb, aerofgtb, aerofgt_state, 0, ROT270, "Video System Co.", "Sonic Wings (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1992, aerfboot, aerofgt, aerfboot, aerofgtb, aerofgt_state, banked_oki, ROT270, "bootleg", "Aero Fighters (bootleg set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND )
GAME( 1992, aerfboo2, aerofgt, aerfboo2, aerofgtb, aerofgt_state, 0, ROT270, "bootleg", "Aero Fighters (bootleg set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND )

View File

@ -67,6 +67,7 @@ public:
uint16_t m_bg1scrolly;
uint16_t m_bg2scrollx;
uint16_t m_bg2scrolly;
bool m_flip_screen;
uint16_t m_wbbc97_bitmap_enable;
int m_charpalettebank;
int m_spritepalettebank;
@ -87,6 +88,7 @@ public:
DECLARE_WRITE8_MEMBER(pending_command_clear_w);
DECLARE_WRITE8_MEMBER(aerofgt_unknown_output_w);
DECLARE_WRITE8_MEMBER(aerofgt_sh_bankswitch_w);
DECLARE_WRITE8_MEMBER(spinlbrk_sh_bankswitch_w);
DECLARE_WRITE8_MEMBER(aerfboot_okim6295_banking_w);
DECLARE_WRITE16_MEMBER(aerofgt_bg1videoram_w);
DECLARE_WRITE16_MEMBER(aerofgt_bg2videoram_w);
@ -102,6 +104,8 @@ public:
DECLARE_WRITE16_MEMBER(aerofgt_bg2scrollx_w);
DECLARE_WRITE16_MEMBER(aerofgt_bg2scrolly_w);
DECLARE_WRITE8_MEMBER(pspikes_palette_bank_w);
DECLARE_WRITE8_MEMBER(spinlbrk_flip_screen_w);
DECLARE_WRITE8_MEMBER(turbofrc_flip_screen_w);
DECLARE_WRITE16_MEMBER(wbbc97_bitmap_enable_w);
DECLARE_WRITE16_MEMBER(pspikesb_oki_banking_w);
DECLARE_WRITE16_MEMBER(aerfboo2_okim6295_banking_w);
@ -114,6 +118,7 @@ public:
TILE_GET_INFO_MEMBER(get_bg1_tile_info);
TILE_GET_INFO_MEMBER(get_bg2_tile_info);
DECLARE_MACHINE_START(aerofgt);
DECLARE_MACHINE_START(spinlbrk);
DECLARE_MACHINE_RESET(aerofgt);
DECLARE_VIDEO_START(pspikes);
DECLARE_MACHINE_START(common);

View File

@ -85,6 +85,7 @@ void aerofgt_state::aerofgt_register_state_globals( )
save_item(NAME(m_bg1scrolly));
save_item(NAME(m_bg2scrollx));
save_item(NAME(m_bg2scrolly));
save_item(NAME(m_flip_screen));
save_item(NAME(m_charpalettebank));
save_item(NAME(m_spritepalettebank));
}
@ -263,6 +264,25 @@ WRITE8_MEMBER(aerofgt_state::pspikes_palette_bank_w)
m_charpalettebank = (data & 0x1c) >> 2;
m_bg1_tilemap->mark_all_dirty();
}
m_flip_screen = BIT(data, 7);
m_bg1_tilemap->set_flip(m_flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
}
WRITE8_MEMBER(aerofgt_state::spinlbrk_flip_screen_w)
{
m_flip_screen = BIT(data, 7);
m_bg1_tilemap->set_flip(m_flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
m_bg2_tilemap->set_flip(m_flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
}
WRITE8_MEMBER(aerofgt_state::turbofrc_flip_screen_w)
{
m_flip_screen = BIT(data, 7);
m_bg1_tilemap->set_flip(m_flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
m_bg2_tilemap->set_flip(m_flip_screen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
// bit 6 = ?
}
@ -286,8 +306,8 @@ uint32_t aerofgt_state::screen_update_pspikes(screen_device &screen, bitmap_ind1
screen.priority().fill(0, cliprect);
m_bg1_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen);
return 0;
}
@ -305,11 +325,11 @@ uint32_t aerofgt_state::screen_update_karatblz(screen_device &screen, bitmap_ind
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0);
/* we use the priority buffer so sprites are drawn front to back */
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen);
return 0;
}
@ -331,11 +351,11 @@ uint32_t aerofgt_state::screen_update_spinlbrk(screen_device &screen, bitmap_ind
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen);
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen);
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen);
return 0;
}
@ -347,10 +367,10 @@ uint32_t aerofgt_state::screen_update_turbofrc(screen_device &screen, bitmap_ind
scrolly = m_bg1scrolly + 2;
for (i = 0; i < 256; i++)
// m_bg1_tilemap->set_scrollx((i + scrolly) & 0x1ff, m_rasterram[i] - 11);
m_bg1_tilemap->set_scrollx((i + scrolly) & 0x1ff, m_rasterram[7] - 11);
m_bg1_tilemap->set_scrolly(0, scrolly);
m_bg2_tilemap->set_scrollx(0, m_bg2scrollx - 7);
m_bg2_tilemap->set_scrolly(0, m_bg2scrolly + 2);
m_bg1_tilemap->set_scrollx((i + scrolly) & 0x1ff, m_rasterram[7] - 11 - (m_flip_screen ? 188 : 0));
m_bg1_tilemap->set_scrolly(0, scrolly - (m_flip_screen ? 2 : 0));
m_bg2_tilemap->set_scrollx(0, m_bg2scrollx - (m_flip_screen ? 185 : 7));
m_bg2_tilemap->set_scrolly(0, m_bg2scrolly + (m_flip_screen ? 0 : 2));
screen.priority().fill(0, cliprect);
@ -358,11 +378,11 @@ uint32_t aerofgt_state::screen_update_turbofrc(screen_device &screen, bitmap_ind
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 1);
/* we use the priority buffer so sprites are drawn front to back */
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //ship
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //intro
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //ship
m_spr_old2->turbofrc_draw_sprites(m_spriteram3+0x200,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //intro
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1); //enemy
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0); //enemy
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //enemy
m_spr_old->turbofrc_draw_sprites(m_spriteram3+0x000,m_spriteram3.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //enemy
return 0;
}
@ -824,7 +844,7 @@ uint32_t aerofgt_state::screen_update_wbbc97(screen_device &screen, bitmap_rgb32
m_bg1_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
}
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen);
m_spr_old->turbofrc_draw_sprites(m_spriteram3,m_spriteram3.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen);
return 0;
}

View File

@ -129,7 +129,7 @@ void vsystem_spr2_device::sprite_attributes::handle_xsize_map_inc()
}
template<class BitmapClass>
void vsystem_spr2_device::turbofrc_draw_sprites_common(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param )
void vsystem_spr2_device::turbofrc_draw_sprites_common(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param, bool flip_screen)
{
int attr_start, first;
first = 4 * spriteram3[0x1fe];
@ -187,7 +187,15 @@ void vsystem_spr2_device::turbofrc_draw_sprites_common(uint16_t const *spriteram
usepri = pri_param;
}
bool fx = m_curr_sprite.flipx != 0;
bool fy = m_curr_sprite.flipy != 0;
if (flip_screen)
{
m_curr_sprite.ox = 308 - m_curr_sprite.ox;
m_curr_sprite.oy = 208 - m_curr_sprite.oy;
fx = !fx;
fy = !fy;
}
m_curr_sprite.color += 16 * spritepalettebank;
@ -196,38 +204,29 @@ void vsystem_spr2_device::turbofrc_draw_sprites_common(uint16_t const *spriteram
for (y = 0; y <= m_curr_sprite.ysize; y++)
{
int sx, sy;
if (m_curr_sprite.flipy)
sy = ((m_curr_sprite.oy + m_curr_sprite.zoomy * (m_curr_sprite.ysize - y)/2 + 16) & 0x1ff) - 16;
else
sy = ((m_curr_sprite.oy + m_curr_sprite.zoomy * y / 2 + 16) & 0x1ff) - 16;
int cy = m_curr_sprite.flipy ? (m_curr_sprite.ysize - y) : y;
int sy = ((m_curr_sprite.oy + m_curr_sprite.zoomy * (flip_screen ? -cy : cy) / 2 + 16) & 0x1ff) - 16;
for (x = 0; x <= m_curr_sprite.xsize; x++)
{
int curr;
if (m_curr_sprite.flipx)
sx = ((m_curr_sprite.ox + m_curr_sprite.zoomx * (m_curr_sprite.xsize - x) / 2 + 16) & 0x1ff) - 16;
else
sx = ((m_curr_sprite.ox + m_curr_sprite.zoomx * x / 2 + 16) & 0x1ff) - 16;
curr = m_newtilecb(m_curr_sprite.map++);
int cx = m_curr_sprite.flipx ? (m_curr_sprite.xsize - x) : x;
int sx = ((m_curr_sprite.ox + m_curr_sprite.zoomx * (flip_screen ? -cx : cx) / 2 + 16) & 0x1ff) - 16;
int curr = m_newtilecb(m_curr_sprite.map++);
if (m_pritype == 0 || m_pritype == 1 || m_pritype == 2) // pdrawgfx cases
{
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x000,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x200,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x000,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x200,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x000,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x200,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x000,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
m_gfxdecode->gfx(m_gfx_region)->prio_zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x200,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11, priority_bitmap,usepri,15);
}
else // drawgfx cases (welltris, pipedrm)
{
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x000,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x200,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x000,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, m_curr_sprite.flipx,m_curr_sprite.flipy, sx-0x200,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x000,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x200,sy-0x000, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x000,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
m_gfxdecode->gfx(m_gfx_region)->zoom_transpen(bitmap,cliprect, curr, m_curr_sprite.color, fx, fy, sx-0x200,sy-0x200, m_curr_sprite.zoomx << 11, m_curr_sprite.zoomy << 11,15);
}
}
@ -236,12 +235,12 @@ void vsystem_spr2_device::turbofrc_draw_sprites_common(uint16_t const *spriteram
}
}
void vsystem_spr2_device::turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param )
void vsystem_spr2_device::turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param, bool flip_screen)
{
turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param );
turbofrc_draw_sprites_common(spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param, flip_screen);
}
void vsystem_spr2_device::turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param )
void vsystem_spr2_device::turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param, bool flip_screen)
{
turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param );
turbofrc_draw_sprites_common(spriteram3, spriteram3_bytes, spritepalettebank, bitmap, cliprect, priority_bitmap, pri_param, flip_screen);
}

View File

@ -29,8 +29,8 @@ public:
vsystem_spr2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param );
void turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param );
void turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param, bool flip_screen = false);
void turbofrc_draw_sprites(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param, bool flip_screen = false);
protected:
virtual void device_start() override;
@ -59,7 +59,7 @@ private:
uint32_t tile_callback_noindirect(uint32_t tile);
template<class BitmapClass>
void turbofrc_draw_sprites_common(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param );
void turbofrc_draw_sprites_common(uint16_t const *spriteram3, int spriteram3_bytes, int spritepalettebank, BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, int pri_param, bool flip_screen);
vsystem_tile2_indirection_delegate m_newtilecb;
int m_pritype;