Added override to allow individual games to change sprite clipping behavior.

Fixed sprite clipping offset to be 0-15 as I originally derived....
This commit is contained in:
Aaron Giles 2008-03-28 09:28:36 +00:00
parent 6979179c11
commit ed961330b6
4 changed files with 28 additions and 8 deletions

View File

@ -2049,6 +2049,8 @@ static void common_init(
irq_line = INPUT_LINE_NMI;
galaxian_frogger_adjust = FALSE;
galaxian_sfx_tilemap = FALSE;
galaxian_sprite_clip_start = 16;
galaxian_sprite_clip_end = 255;
galaxian_draw_bullet_ptr = (draw_bullet != NULL) ? draw_bullet : galaxian_draw_bullet;
galaxian_draw_background_ptr = (draw_background != NULL) ? draw_background : galaxian_draw_background;
galaxian_extend_tile_info_ptr = extend_tile_info;
@ -2095,7 +2097,7 @@ static DRIVER_INIT( galaxian )
static DRIVER_INIT( nolock )
{
/* same as galaxian... */
driver_init_galaxian(machine);
DRIVER_INIT_CALL(galaxian);
/* ...but coin lockout disabled/disconnected */
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
@ -2205,6 +2207,20 @@ static DRIVER_INIT( moonqsr )
}
static DRIVER_INIT( pacmanbl )
{
/* same as galaxian... */
DRIVER_INIT_CALL(galaxian);
/* ...but coin lockout disabled/disconnected */
memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0x7f8, SMH_UNMAP);
/* also shift the sprite clip offset */
galaxian_sprite_clip_start = 7;
galaxian_sprite_clip_end = 246;
}
static DRIVER_INIT( devilfsg )
{
/* video extensions */

View File

@ -4639,7 +4639,7 @@ GAME( 1981, batman2, phoenix, galaxian, batman2, batman2, ROT270, "bootleg",
/* separate tile/sprite ROMs */
GAME( 1981, streakng, 0, pacmanbl, streakng, galaxian, ROT90, "Shoei", "Streaking", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
GAME( 1981, pacmanbl, puckman, pacmanbl, pacmanbl, nolock, ROT270, "bootleg", "Pac-Man (Galaxian hardware)", GAME_SUPPORTS_SAVE )
GAME( 1981, pacmanbl, puckman, pacmanbl, pacmanbl, pacmanbl, ROT270, "bootleg", "Pac-Man (Galaxian hardware)", GAME_SUPPORTS_SAVE )
/* separate tile/sprite ROMs, plus INT instead of NMI */
GAME( 1984, devilfsg, devilfsh, pacmanbl, devilfsg, devilfsg, ROT270, "Vision / Artic", "Devil Fish (Galaxian hardware, bootleg?)", GAME_SUPPORTS_SAVE )

View File

@ -30,6 +30,8 @@
extern UINT8 galaxian_frogger_adjust;
extern UINT8 galaxian_sfx_tilemap;
extern UINT8 galaxian_sprite_clip_start;
extern UINT8 galaxian_sprite_clip_end;
PALETTE_INIT( galaxian );

View File

@ -245,6 +245,8 @@ galaxian_extend_sprite_info_func galaxian_extend_sprite_info_ptr;
/* global tweaks */
UINT8 galaxian_frogger_adjust;
UINT8 galaxian_sfx_tilemap;
UINT8 galaxian_sprite_clip_start;
UINT8 galaxian_sprite_clip_end;
@ -587,11 +589,11 @@ static void sprites_draw(running_machine *machine, bitmap_t *bitmap, const recta
rectangle clip = *cliprect;
int sprnum;
/* sprites are hard-clipped at H=16 and H=256, regardless of flipping */
/* because we normalize the H counter to 0, this effectively clips between */
/* 8 and 248 */
clip.min_x = MAX(clip.min_x, (16-8)*GALAXIAN_XSCALE);
clip.max_x = MIN(clip.max_x, (256-8)*GALAXIAN_XSCALE - 1);
/* 16 of the 256 pixels of the sprites are hard-clipped at the line buffer */
/* according to the schematics, it should be the first 16 pixels; however, */
/* some bootlegs demonstrate that this can be shifted to other positions. */
clip.min_x = MAX(clip.min_x, galaxian_sprite_clip_start * GALAXIAN_XSCALE);
clip.max_x = MIN(clip.max_x, (galaxian_sprite_clip_end + 1) * GALAXIAN_XSCALE - 1);
/* The line buffer is only written if it contains a '0' currently; */
/* it is cleared during the visible area, and populated during HBLANK */