nmk16.c: [trap15]

- Fixes some issues and cleaned up the video sources a bit.
- Marked all appropriate games with a GAME_IMPERFECT_GRAPHICS flag (all of the old methods were imperfect toot hey just weren't marked for some reason).
This commit is contained in:
Scott Stone 2012-04-02 18:18:27 +00:00
parent 165303084a
commit 4ec24dc5b6
3 changed files with 202 additions and 185 deletions

View File

@ -3918,7 +3918,7 @@ static MACHINE_CONFIG_START( tdragon, nmk16_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_STATIC(tdragon) MCFG_SCREEN_UPDATE_STATIC(macross)
MCFG_SCREEN_VBLANK_STATIC(nmk) MCFG_SCREEN_VBLANK_STATIC(nmk)
MCFG_GFXDECODE(macross) MCFG_GFXDECODE(macross)
@ -4034,7 +4034,7 @@ static MACHINE_CONFIG_START( hachamf, nmk16_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(256, 256) MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_STATIC(hachamf) MCFG_SCREEN_UPDATE_STATIC(macross)
MCFG_SCREEN_VBLANK_STATIC(nmk) MCFG_SCREEN_VBLANK_STATIC(nmk)
MCFG_GFXDECODE(macross) MCFG_GFXDECODE(macross)
@ -4243,7 +4243,7 @@ static MACHINE_CONFIG_START( tdragon2, nmk16_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_STATIC(gunnail) MCFG_SCREEN_UPDATE_STATIC(tdragon2)
MCFG_SCREEN_VBLANK_STATIC(nmk) MCFG_SCREEN_VBLANK_STATIC(nmk)
MCFG_GFXDECODE(macross2) MCFG_GFXDECODE(macross2)
@ -4284,7 +4284,7 @@ static MACHINE_CONFIG_START( raphero, nmk16_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_SIZE(512, 256)
MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1) MCFG_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 2*8, 30*8-1)
MCFG_SCREEN_UPDATE_STATIC(gunnail) MCFG_SCREEN_UPDATE_STATIC(tdragon2)
MCFG_SCREEN_VBLANK_STATIC(nmk) MCFG_SCREEN_VBLANK_STATIC(nmk)
MCFG_GFXDECODE(macross2) MCFG_GFXDECODE(macross2)
@ -7125,41 +7125,41 @@ ROM_END
***************************************************************************/ ***************************************************************************/
GAME( 1989, tharrier, 0, tharrier, tharrier, 0, ROT270, "UPL (American Sammy license)", "Task Force Harrier", 0 ) GAME( 1989, tharrier, 0, tharrier, tharrier, 0, ROT270, "UPL (American Sammy license)", "Task Force Harrier", GAME_IMPERFECT_GRAPHICS )
GAME( 1989, tharrierj,tharrier, tharrier, tharrier, 0, ROT270, "UPL", "Task Force Harrier (Japan)", 0 ) GAME( 1989, tharrierj,tharrier, tharrier, tharrier, 0, ROT270, "UPL", "Task Force Harrier (Japan)", GAME_IMPERFECT_GRAPHICS )
GAME( 1990, mustang, 0, mustang, mustang, 0, ROT0, "UPL", "US AAF Mustang (25th May. 1990)", GAME_IMPERFECT_SOUND) GAME( 1990, mustang, 0, mustang, mustang, 0, ROT0, "UPL", "US AAF Mustang (25th May. 1990)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, mustangs, mustang, mustang, mustang, 0, ROT0, "UPL (Seoul Trading license)", "US AAF Mustang (25th May. 1990 / Seoul Trading)", GAME_IMPERFECT_SOUND ) GAME( 1990, mustangs, mustang, mustang, mustang, 0, ROT0, "UPL (Seoul Trading license)", "US AAF Mustang (25th May. 1990 / Seoul Trading)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, bioship, 0, bioship, bioship, 0, ROT0, "UPL (American Sammy license)", "Bio-ship Paladin", GAME_IMPERFECT_SOUND ) GAME( 1990, bioship, 0, bioship, bioship, 0, ROT0, "UPL (American Sammy license)", "Bio-ship Paladin", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, sbsgomo, bioship, bioship, bioship, 0, ROT0, "UPL", "Space Battle Ship Gomorrah", GAME_IMPERFECT_SOUND ) GAME( 1990, sbsgomo, bioship, bioship, bioship, 0, ROT0, "UPL", "Space Battle Ship Gomorrah", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, vandyke, 0, vandyke, vandyke, 0, ROT270, "UPL", "Vandyke (Japan)", GAME_IMPERFECT_SOUND ) GAME( 1990, vandyke, 0, vandyke, vandyke, 0, ROT270, "UPL", "Vandyke (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, vandykejal, vandyke, vandyke, vandyke, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 1)", GAME_IMPERFECT_SOUND ) GAME( 1990, vandykejal, vandyke, vandyke, vandyke, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 1)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 2)", GAME_IMPERFECT_SOUND ) GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, 0, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 2)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1990, vandykeb, vandyke, vandykeb, vandykeb, vandykeb, ROT270, "bootleg", "Vandyke (bootleg with PIC16c57)", GAME_NO_SOUND ) GAME( 1990, vandykeb, vandyke, vandykeb, vandykeb, vandykeb, ROT270, "bootleg", "Vandyke (bootleg with PIC16c57)", GAME_NO_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1991, blkheart, 0, blkheart, blkheart, 0, ROT0, "UPL", "Black Heart", GAME_IMPERFECT_SOUND ) GAME( 1991, blkheart, 0, blkheart, blkheart, 0, ROT0, "UPL", "Black Heart", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1991, blkheartj,blkheart, blkheart, blkheart, 0, ROT0, "UPL", "Black Heart (Japan)", GAME_IMPERFECT_SOUND ) GAME( 1991, blkheartj,blkheart, blkheart, blkheart, 0, ROT0, "UPL", "Black Heart (Japan)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1991, acrobatm, 0, acrobatm, acrobatm, 0, ROT270, "UPL (Taito license)", "Acrobat Mission", GAME_IMPERFECT_SOUND ) GAME( 1991, acrobatm, 0, acrobatm, acrobatm, 0, ROT270, "UPL (Taito license)", "Acrobat Mission", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1992, strahl, 0, strahl, strahl, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 1)", GAME_IMPERFECT_SOUND ) GAME( 1992, strahl, 0, strahl, strahl, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 1)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1992, strahla, strahl, strahl, strahl, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 2)", GAME_IMPERFECT_SOUND ) GAME( 1992, strahla, strahl, strahl, strahl, 0, ROT0, "UPL", "Koutetsu Yousai Strahl (Japan set 2)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1991, tdragon, 0, tdragon, tdragon, tdragon, ROT270, "NMK (Tecmo license)", "Thunder Dragon (9th Jan. 1992)", GAME_IMPERFECT_SOUND ) GAME( 1991, tdragon, 0, tdragon, tdragon, tdragon, ROT270, "NMK (Tecmo license)", "Thunder Dragon (9th Jan. 1992)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1991, tdragon1, tdragon, tdragon, tdragon, tdragon, ROT270, "NMK (Tecmo license)", "Thunder Dragon (4th Jun. 1991)", GAME_IMPERFECT_SOUND ) GAME( 1991, tdragon1, tdragon, tdragon, tdragon, tdragon, ROT270, "NMK (Tecmo license)", "Thunder Dragon (4th Jun. 1991)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1991, hachamf, 0, hachamf, hachamf, hachamf, ROT0, "NMK", "Hacha Mecha Fighter (19th Sep. 1991)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1991, hachamf, 0, hachamf, hachamf, hachamf, ROT0, "NMK", "Hacha Mecha Fighter (19th Sep. 1991)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
GAME( 1992, macross, 0, macross, macross, nmk, ROT270, "Banpresto", "Super Spacefortress Macross / Chou-Jikuu Yousai Macross", GAME_IMPERFECT_SOUND ) GAME( 1992, macross, 0, macross, macross, nmk, ROT270, "Banpresto", "Super Spacefortress Macross / Chou-Jikuu Yousai Macross", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, gunnail, 0, gunnail, gunnail, nmk, ROT270, "NMK / Tecmo", "GunNail (28th May. 1992)", GAME_IMPERFECT_SOUND ) GAME( 1993, gunnail, 0, gunnail, gunnail, nmk, ROT270, "NMK / Tecmo", "GunNail (28th May. 1992)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, macross2, 0, macross2, macross2, 0, ROT0, "Banpresto", "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II", GAME_NO_COCKTAIL ) GAME( 1993, macross2, 0, macross2, macross2, 0, ROT0, "Banpresto", "Super Spacefortress Macross II / Chou-Jikuu Yousai Macross II", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, tdragon2, 0, tdragon2, tdragon2, 0, ROT270, "NMK", "Thunder Dragon 2 (9th Nov. 1993)", GAME_NO_COCKTAIL ) GAME( 1993, tdragon2, 0, tdragon2, tdragon2, 0, ROT270, "NMK", "Thunder Dragon 2 (9th Nov. 1993)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, tdragon2a,tdragon2, tdragon2, tdragon2, 0, ROT270, "NMK", "Thunder Dragon 2 (1st Oct. 1993)", GAME_NO_COCKTAIL ) GAME( 1993, tdragon2a,tdragon2, tdragon2, tdragon2, 0, ROT270, "NMK", "Thunder Dragon 2 (1st Oct. 1993)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
GAME( 1993, bigbang, tdragon2, tdragon2, tdragon2, 0, ROT270, "NMK", "Big Bang (9th Nov. 1993)", GAME_NO_COCKTAIL ) GAME( 1993, bigbang, tdragon2, tdragon2, tdragon2, 0, ROT270, "NMK", "Big Bang (9th Nov. 1993)", GAME_NO_COCKTAIL | GAME_IMPERFECT_GRAPHICS )
GAME( 1994, raphero, 0, raphero, raphero, 0, ROT270, "NMK / Media Shoji", "Rapid Hero", GAME_IMPERFECT_SOUND ) // 23rd July 1993 in test mode, (c)1994 on title screen GAME( 1994, raphero, 0, raphero, raphero, 0, ROT270, "NMK / Media Shoji", "Rapid Hero", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS ) // 23rd July 1993 in test mode, (c)1994 on title screen
/* both sets of both these games show a date of 9th Mar 1992 in the test mode, they look like different revisions so I doubt this is accurate */ /* both sets of both these games show a date of 9th Mar 1992 in the test mode, they look like different revisions so I doubt this is accurate */
GAME( 1992, sabotenb, 0, bjtwin, sabotenb, nmk, ROT0, "NMK / Tecmo", "Saboten Bombers (set 1)", GAME_NO_COCKTAIL ) GAME( 1992, sabotenb, 0, bjtwin, sabotenb, nmk, ROT0, "NMK / Tecmo", "Saboten Bombers (set 1)", GAME_NO_COCKTAIL )

View File

@ -67,21 +67,20 @@ WRITE16_HANDLER( vandykeb_scroll_w );
WRITE16_HANDLER( manybloc_scroll_w ); WRITE16_HANDLER( manybloc_scroll_w );
VIDEO_START( macross ); VIDEO_START( macross );
SCREEN_UPDATE_IND16( manybloc );
VIDEO_START( gunnail ); VIDEO_START( gunnail );
VIDEO_START( macross2 ); VIDEO_START( macross2 );
VIDEO_START( raphero ); VIDEO_START( raphero );
VIDEO_START( bjtwin ); VIDEO_START( bjtwin );
VIDEO_START( bioship ); VIDEO_START( bioship );
VIDEO_START( strahl ); VIDEO_START( strahl );
SCREEN_UPDATE_IND16( macross );
SCREEN_UPDATE_IND16( manybloc );
SCREEN_UPDATE_IND16( tharrier );
SCREEN_UPDATE_IND16( tdragon2 );
SCREEN_UPDATE_IND16( gunnail );
SCREEN_UPDATE_IND16( bioship ); SCREEN_UPDATE_IND16( bioship );
SCREEN_UPDATE_IND16( strahl ); SCREEN_UPDATE_IND16( strahl );
SCREEN_UPDATE_IND16( macross );
SCREEN_UPDATE_IND16( gunnail );
SCREEN_UPDATE_IND16( bjtwin ); SCREEN_UPDATE_IND16( bjtwin );
SCREEN_UPDATE_IND16( tharrier );
SCREEN_UPDATE_IND16( hachamf );
SCREEN_UPDATE_IND16( tdragon );
SCREEN_VBLANK( nmk ); SCREEN_VBLANK( nmk );
SCREEN_VBLANK( strahl ); SCREEN_VBLANK( strahl );

View File

@ -521,42 +521,36 @@ static inline void nmk16_draw_sprite_flipsupported(nmk16_state *state, running_m
} }
} }
static void nmk16_draw_sprites2(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int *swaptbl) static void nmk16_draw_sprites_swap(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl)
{ {
nmk16_state *state = machine.driver_data<nmk16_state>(); nmk16_state *state = machine.driver_data<nmk16_state>();
int i, l, prio; int i, prio;
// Priority level (0x10 levels, 4 sub-levels, 0x10 sprites each) // Priority level (4 levels, 0x100 sprites)
for ( i = 0; i < 0x10; i++ )
{
// Sub-priority level (4 levels)
for ( prio = 3; prio >= 0; prio-- ) for ( prio = 3; prio >= 0; prio-- )
{ {
// Sprite // Sprite
for ( l = 0; l < 0x10; l++ ) for ( i = 0; i < 0x100; i++ )
{ {
nmk16_draw_sprite(state, machine, bitmap, cliprect, prio, state->m_spriteram_old2 + ((swaptbl[i] + l) * 8)); int spr = BITSWAP8(i, bittbl[0], bittbl[1], bittbl[2], bittbl[3], bittbl[4], bittbl[5], bittbl[6], bittbl[7]);
} nmk16_draw_sprite(state, machine, bitmap, cliprect, prio, state->m_spriteram_old2 + (spr * 8));
} }
} }
} }
static void nmk16_draw_sprites2_flipsupported(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int *swaptbl) static void nmk16_draw_sprites_swap_flipsupported(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl)
{ {
nmk16_state *state = machine.driver_data<nmk16_state>(); nmk16_state *state = machine.driver_data<nmk16_state>();
int i, l, prio; int i, prio;
// Priority level (0x10 levels, 4 sub-levels, 0x10 sprites each) // Priority level (4 levels, 0x100 sprites)
for ( i = 0; i < 0x10; i++ )
{
// Sub-priority level (4 levels)
for ( prio = 3; prio >= 0; prio-- ) for ( prio = 3; prio >= 0; prio-- )
{ {
// Sprite // Sprite
for ( l = 0; l < 0x10; l++ ) for ( i = 0; i < 0x100; i++ )
{ {
nmk16_draw_sprite_flipsupported(state, machine, bitmap, cliprect, prio, state->m_spriteram_old2 + ((swaptbl[i] + l) * 8)); int spr = BITSWAP8(i, bittbl[0], bittbl[1], bittbl[2], bittbl[3], bittbl[4], bittbl[5], bittbl[6], bittbl[7]);
} nmk16_draw_sprite_flipsupported(state, machine, bitmap, cliprect, prio, state->m_spriteram_old2 + (spr * 16/2));
} }
} }
} }
@ -586,68 +580,62 @@ static void nmk16_draw_sprites_flipsupported(running_machine &machine, bitmap_in
} }
} }
SCREEN_UPDATE_IND16( macross ) /***************************************************************************
Generic Screen Updates
***************************************************************************/
int nmk16_bg_spr_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
nmk16_state *state = screen.machine().driver_data<nmk16_state>();
state->m_bg_tilemap0->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);
return 0;
}
int nmk16_bg_fg_spr_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); nmk16_state *state = screen.machine().driver_data<nmk16_state>();
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift); state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0); state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
state->m_fg_tilemap->draw(bitmap, cliprect, 0,0);
static int macross_swaptbl[0x10] = { nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
0x00, 0x80, 0x20, 0xA0, 0x40, 0xC0, 0x60, 0xE0, nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2);
0x10, 0x90, 0x30, 0xB0, 0x50, 0xD0, 0x70, 0xF0, nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1);
}; nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);
nmk16_draw_sprites2(screen.machine(), bitmap,cliprect, macross_swaptbl);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0); state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0; return 0;
} }
SCREEN_UPDATE_IND16( tdragon ) int nmk16_bg_spr_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); nmk16_state *state = screen.machine().driver_data<nmk16_state>();
// mcu_run(screen.machine(), 1);
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift); state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0); state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
// TODO: Fix this swap table; it's currently incorrect nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
static int tdragon_swaptbl[0x10] = {
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,
0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
};
nmk16_draw_sprites2(screen.machine(), bitmap,cliprect, tdragon_swaptbl);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
}
SCREEN_UPDATE_IND16( hachamf )
{
nmk16_state *state = screen.machine().driver_data<nmk16_state>();
// mcu_run(screen.machine(), 0);
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
// TODO: Fix this swap table; it's currently incorrect
static int hachamf_swaptbl[0x10] = {
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70,
0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
};
nmk16_draw_sprites2(screen.machine(), bitmap,cliprect, hachamf_swaptbl);
/* nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2); nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1); nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);*/ nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0); state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0; return 0;
} }
SCREEN_UPDATE_IND16( manybloc ) int nmk16_bg_sprflip_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); nmk16_state *state = screen.machine().driver_data<nmk16_state>();
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift); state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
@ -663,40 +651,98 @@ SCREEN_UPDATE_IND16( manybloc )
return 0; return 0;
} }
SCREEN_UPDATE_IND16( tharrier ) int nmk16_bioshipbg_sprflip_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); nmk16_state *state = screen.machine().driver_data<nmk16_state>();
/* I think the protection device probably copies this to the regs... */ UINT16 *tilerom = (UINT16 *)screen.machine().region("gfx5")->base();
UINT16 tharrier_scroll = state->m_mainram[0x9f00/2]; int scrollx=-(state->m_bioship_scroll[1] + state->m_bioship_scroll[0]*256);
int scrolly=-(state->m_bioship_scroll[3] + state->m_bioship_scroll[2]*256);
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift); state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->set_scrollx(0,tharrier_scroll);
if (state->m_redraw_bitmap)
{
int bank = state->m_bioship_background_bank * 0x2000;
int sx=0, sy=0, offs;
state->m_redraw_bitmap=0;
/* Draw background from tile rom */
for (offs = 0;offs <0x1000;offs++) {
UINT16 data = tilerom[offs+bank];
int numtile = data&0xfff;
int color = (data&0xf000)>>12;
drawgfx_opaque(*state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3],
numtile,
color,
0,0, /* no flip */
16*sx,16*sy);
data = tilerom[offs+0x1000+bank];
numtile = data&0xfff;
color = (data&0xf000)>>12;
drawgfx_opaque(*state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3],
numtile,
color,
0,0, /* no flip */
16*sx,(16*sy)+256);
sy++;
if (sy==16) {sy=0; sx++;}
}
}
copyscrollbitmap(bitmap,*state->m_background_bitmap,1,&scrollx,1,&scrolly,cliprect);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0); state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
// TODO: Fix this swap table; it's currently incorrect nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
static int tharrier_swaptbl[0x10] = { nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2);
0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1);
0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0, nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);
};
nmk16_draw_sprites2_flipsupported(screen.machine(), bitmap,cliprect, tharrier_swaptbl);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0); state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0; return 0;
} }
SCREEN_UPDATE_IND16( gunnail ) int nmk16_bg_sprswap_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bittbl[8])
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); nmk16_state *state = screen.machine().driver_data<nmk16_state>();
int y1; state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
int i=16;
rectangle bgclip = cliprect; state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
nmk16_draw_sprites_swap(screen.machine(), bitmap,cliprect, bittbl);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
}
int nmk16_bg_sprswapflip_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bittbl[8])
{
nmk16_state *state = screen.machine().driver_data<nmk16_state>();
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
nmk16_draw_sprites_swap_flipsupported(screen.machine(), bitmap,cliprect, bittbl);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
}
int nmk16_complexbg_sprswap_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int bittbl[8])
{
nmk16_state *state = screen.machine().driver_data<nmk16_state>();
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
// the hardware supports per-scanline X *and* Y scroll which isn't // the hardware supports per-scanline X *and* Y scroll which isn't
// supported by tilemaps so we have to draw the tilemap one line at a time // supported by tilemaps so we have to draw the tilemap one line at a time
y1 = cliprect.min_y;
if (!state->m_simple_scroll) if (!state->m_simple_scroll)
{ {
int i=16;
int y1;
rectangle bgclip = cliprect;
y1 = cliprect.min_y;
while (y1 <= cliprect.max_y) while (y1 <= cliprect.max_y)
{ {
int const yscroll = state->m_gunnail_scrollramy[0] + state->m_gunnail_scrollramy[y1]; int const yscroll = state->m_gunnail_scrollramy[0] + state->m_gunnail_scrollramy[y1];
@ -753,100 +799,72 @@ SCREEN_UPDATE_IND16( gunnail )
bg_tilemap->draw(bitmap, cliprect, 0,0); bg_tilemap->draw(bitmap, cliprect, 0,0);
} }
static int gunnail_swaptbl[0x10] = { nmk16_draw_sprites_swap(screen.machine(), bitmap,cliprect, bittbl);
0x00, 0x80, 0x20, 0xA0, 0x40, 0xC0, 0x60, 0xE0,
0x10, 0x90, 0x30, 0xB0, 0x50, 0xD0, 0x70, 0xF0,
};
nmk16_draw_sprites2(screen.machine(), bitmap,cliprect, gunnail_swaptbl);
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0); state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0; return 0;
} }
/***************************************************************************
Screen update functions
***************************************************************************/
SCREEN_UPDATE_IND16( macross )
{
return nmk16_bg_spr_tx_update(screen, bitmap, cliprect);
}
SCREEN_UPDATE_IND16( manybloc )
{
return nmk16_bg_sprflip_tx_update(screen, bitmap, cliprect);
}
SCREEN_UPDATE_IND16( tharrier )
{
nmk16_state *state = screen.machine().driver_data<nmk16_state>();
/* I think the protection device probably copies this to the regs... */
UINT16 tharrier_scroll = state->m_mainram[0x9f00/2];
state->m_bg_tilemap0->set_scrollx(0,tharrier_scroll);
return nmk16_bg_sprflip_tx_update(screen, bitmap, cliprect);
}
SCREEN_UPDATE_IND16( tdragon2 )
{
static int bittbl[8] = {
4, 6, 5, 7, 3, 2, 1, 0
};
return nmk16_complexbg_sprswap_tx_update(screen, bitmap, cliprect, bittbl);
}
SCREEN_UPDATE_IND16( gunnail )
{
static int bittbl[8] = {
7, 6, 5, 4, 3, 2, 1, 0
};
return nmk16_complexbg_sprswap_tx_update(screen, bitmap, cliprect, bittbl);
}
SCREEN_UPDATE_IND16( bioship ) SCREEN_UPDATE_IND16( bioship )
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); return nmk16_bioshipbg_sprflip_tx_update(screen, bitmap, cliprect);
UINT16 *tilerom = (UINT16 *)screen.machine().region("gfx5")->base();
int scrollx=-(state->m_bioship_scroll[1] + state->m_bioship_scroll[0]*256);
int scrolly=-(state->m_bioship_scroll[3] + state->m_bioship_scroll[2]*256);
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
if (state->m_redraw_bitmap)
{
int bank = state->m_bioship_background_bank * 0x2000;
int sx=0, sy=0, offs;
state->m_redraw_bitmap=0;
/* Draw background from tile rom */
for (offs = 0;offs <0x1000;offs++) {
UINT16 data = tilerom[offs+bank];
int numtile = data&0xfff;
int color = (data&0xf000)>>12;
drawgfx_opaque(*state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3],
numtile,
color,
0,0, /* no flip */
16*sx,16*sy);
data = tilerom[offs+0x1000+bank];
numtile = data&0xfff;
color = (data&0xf000)>>12;
drawgfx_opaque(*state->m_background_bitmap,state->m_background_bitmap->cliprect(),screen.machine().gfx[3],
numtile,
color,
0,0, /* no flip */
16*sx,(16*sy)+256);
sy++;
if (sy==16) {sy=0; sx++;}
}
}
copyscrollbitmap(bitmap,*state->m_background_bitmap,1,&scrollx,1,&scrolly,cliprect);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
} }
SCREEN_UPDATE_IND16( strahl ) SCREEN_UPDATE_IND16( strahl )
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); return nmk16_bg_fg_spr_tx_update(screen, bitmap, cliprect);
state->m_tx_tilemap->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
state->m_fg_tilemap->draw(bitmap, cliprect, 0,0);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);
state->m_tx_tilemap->draw(bitmap, cliprect, 0,0);
return 0;
} }
SCREEN_UPDATE_IND16( bjtwin ) SCREEN_UPDATE_IND16( bjtwin )
{ {
nmk16_state *state = screen.machine().driver_data<nmk16_state>(); return nmk16_bg_spr_update(screen, bitmap, cliprect);
state->m_bg_tilemap0->set_scrollx(0,-state->m_videoshift);
state->m_bg_tilemap0->draw(bitmap, cliprect, 0,0);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,3);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,2);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,1);
nmk16_draw_sprites(screen.machine(), bitmap,cliprect,0);
return 0;
} }
SCREEN_VBLANK( nmk ) SCREEN_VBLANK( nmk )