From 9dd5dcc20e47338d0d9cd5418b216fb882621f5e Mon Sep 17 00:00:00 2001 From: Nicola Salmoria Date: Sun, 15 Feb 2009 09:51:22 +0000 Subject: [PATCH] 02918: psychosj psychos: Title screen graphic glitch --- src/mame/drivers/snk.c | 36 ++++++++++++++++++++++-------------- src/mame/includes/snk.h | 1 + src/mame/video/snk.c | 18 ++++++++++++++++++ 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/mame/drivers/snk.c b/src/mame/drivers/snk.c index ac1cf6eef04..8be97d180fd 100644 --- a/src/mame/drivers/snk.c +++ b/src/mame/drivers/snk.c @@ -247,13 +247,14 @@ TODO: snk68.c for another game that needs this). tdfever dots still flicker a lot, however I'm not sure if this is an emulation bug or the real game behaviour. -- psychos: in all games using the gwar video, palette colors 0x180-0x1ff are not - used because bit 3 of the sprite attribute is used for tile bank select instead. - In all games, those colors 0x180-0x1ff are a copy of 0x100-0x17f so even if the - bit was wired to the palette, it would make no difference. In psychos, however, - the colors are different. Game colors appear to be correct as they are, and - connecting bit 3 would break them, so it's unknown if colors 0x180-0x1ff should - be used and how. +- psychos: the pcb has glitches (colored lines of length up to 16 pixels) during + scrolling on the left side of the screen. This doesn't happen in the emulation + so it might be an unemulated hardware bug. + +- worldwar: at the beginning of the game, the bottom 16 pixels of the bg are + blank. I think that this is related to the psychos glitch above, i.e. the pcb + wouldn't display that area correctly anyway so operators were supposed to + adjust the screen size to make them invisible. ***************************************************************************/ @@ -3549,9 +3550,8 @@ GFXDECODE_END static GFXDECODE_START( gwar ) GFXDECODE_ENTRY( "tx_tiles", 0, charlayout_4bpp, 0x000, 0x100>>4 ) GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x300, 0x100>>4 ) - GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp, 0x100, 0x080>>4 ) + GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp, 0x100, 0x100>>4 ) GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 ) - /* what about colors 0x180-0x1ff? */ GFXDECODE_END static GFXDECODE_START( tdfever ) @@ -3880,10 +3880,9 @@ static MACHINE_DRIVER_START( bermudat ) MDRV_SCREEN_ADD("main", RASTER) MDRV_SCREEN_REFRESH_RATE(60) MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) - // visible area uncertain but this size avoids glitches at the bottom of the screen - // in worldwar at the beginning of the game + // this visible area matches the psychos pcb MDRV_SCREEN_SIZE(50*8, 28*8) - MDRV_SCREEN_VISIBLE_AREA(2*8, 48*8-1, 0*8, 28*8-1) + MDRV_SCREEN_VISIBLE_AREA(0*8, 50*8-1, 0*8, 28*8-1) MDRV_GFXDECODE(gwar) MDRV_PALETTE_LENGTH(0x400) @@ -3905,6 +3904,15 @@ static MACHINE_DRIVER_START( bermudat ) MACHINE_DRIVER_END +static MACHINE_DRIVER_START( psychos ) + + MDRV_IMPORT_FROM(bermudat) + + /* video hardware */ + MDRV_VIDEO_START(psychos) +MACHINE_DRIVER_END + + static MACHINE_DRIVER_START( gwar ) MDRV_IMPORT_FROM(bermudat) @@ -6190,8 +6198,8 @@ GAME( 1987, bermudat, 0, bermudat, bermudat, 0, ROT270, "SNK", "Be GAME( 1987, bermudaj, bermudat, bermudat, bermudat, 0, ROT270, "SNK", "Bermuda Triangle (Japan)", 0 ) GAME( 1987, worldwar, 0, bermudat, worldwar, 0, ROT270, "SNK", "World Wars (World?)", 0 ) GAME( 1987, bermudaa, worldwar, bermudat, bermudaa, 0, ROT270, "SNK", "Bermuda Triangle (World Wars) (US)", 0 ) -GAME( 1987, psychos, 0, bermudat, psychos, 0, ROT0, "SNK", "Psycho Soldier (US)", 0 ) -GAME( 1987, psychosj, psychos, bermudat, psychos, 0, ROT0, "SNK", "Psycho Soldier (Japan)", 0 ) +GAME( 1987, psychos, 0, psychos, psychos, 0, ROT0, "SNK", "Psycho Soldier (US)", 0 ) +GAME( 1987, psychosj, psychos, psychos, psychos, 0, ROT0, "SNK", "Psycho Soldier (Japan)", 0 ) GAME( 1987, gwar, 0, gwar, gwar, 0, ROT270, "SNK", "Guerrilla War (US)", 0 ) GAME( 1987, gwarj, gwar, gwar, gwar, 0, ROT270, "SNK", "Guevara (Japan)", 0 ) GAME( 1987, gwara, gwar, gwara, gwar, 0, ROT270, "SNK", "Guerrilla War (Version 1)", 0 ) diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h index c6a925342ba..737bf43fb7b 100644 --- a/src/mame/includes/snk.h +++ b/src/mame/includes/snk.h @@ -25,6 +25,7 @@ extern VIDEO_START( aso ); extern VIDEO_START( tnk3 ); extern VIDEO_START( ikari ); extern VIDEO_START( gwar ); +extern VIDEO_START( psychos ); extern VIDEO_START( tdfever ); extern VIDEO_UPDATE( marvins ); diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c index 161f523e89c..6a46c4f61e8 100644 --- a/src/mame/video/snk.c +++ b/src/mame/video/snk.c @@ -35,6 +35,7 @@ static UINT8 sprite_split_point; static int num_sprites, yscroll_mask; static UINT32 bg_tile_offset; static UINT32 tx_tile_offset; +static int is_psychos; static UINT8 empty_tile[16*16]; static UINT8 drawmode_table[16]; @@ -169,6 +170,10 @@ static TILE_GET_INFO( gwar_get_bg_tile_info ) int attr = snk_bg_videoram[2*tile_index+1]; int code = snk_bg_videoram[2*tile_index] | ((attr & 0x0f) << 8); int color = (attr & 0xf0) >> 4; + + if (is_psychos) // psychos has a separate palette bank bit + color &= 7; + SET_TILE_INFO(1, code, color, @@ -354,6 +359,14 @@ VIDEO_START( gwar ) tilemap_set_scrolldy(bg_tilemap, 0, -32); tx_tile_offset = 0; + + is_psychos = 0; +} + +VIDEO_START( psychos ) +{ + VIDEO_START_CALL(gwar); + is_psychos = 1; } VIDEO_START( tdfever ) @@ -595,6 +608,9 @@ WRITE8_HANDLER( gwar_tx_bank_w ) tx_tile_offset = (data & 0x30) << 4; tilemap_mark_all_tiles_dirty(tx_tilemap); } + + if (is_psychos) + tilemap_set_palette_offset(bg_tilemap, (data & 0x80)); } WRITE8_HANDLER( gwar_videoattrs_w ) @@ -849,6 +865,8 @@ static void tdfever_draw_sprites(running_machine *machine, bitmap_t *bitmap, con case 16: tile_number |= ((attributes & 0x08) << 5) | ((attributes & 0x60) << 4); color &= 7; // attribute bit 3 is used for bank select + if (from == 0) + color |= 8; // low priority sprites use the other palette bank break; case 32: