diff options
author | Michaël Banaan Ananas <happppp@users.noreply.github.com> | 2011-03-24 00:54:18 +0000 |
---|---|---|
committer | Michaël Banaan Ananas <happppp@users.noreply.github.com> | 2011-03-24 00:54:18 +0000 |
commit | 6964d8808b7590e4885a06fc7de0bcc0d8318e1d (patch) | |
tree | 9a7ce72ee4d136f2422c3898dc39a0615007f6e6 | |
parent | eae55a88b52f0a25253a925dccdef7cadab9d8ed (diff) |
sprite priority fix: http://www.mametesters.org/view.php?id=2841
-rw-r--r-- | src/mame/video/mappy.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c index 2751acb25a7..bf7c64c25f0 100644 --- a/src/mame/video/mappy.c +++ b/src/mame/video/mappy.c @@ -553,13 +553,15 @@ SCREEN_UPDATE( superpac ) /* Redraw the high priority characters */ tilemap_draw(bitmap,cliprect,state->bg_tilemap,1,0); - /* sprite color 0 still has priority over that (ghost eyes in Pac 'n Pal) */ + /* some sprites still have priority over that (ghost eyes in Pac 'n Pal) */ for (y = 0;y < sprite_bitmap->height;y++) { for (x = 0;x < sprite_bitmap->width;x++) { - if (*BITMAP_ADDR16(sprite_bitmap, y, x) == 0) - *BITMAP_ADDR16(bitmap, y, x) = 0; + // bg colortable contents and sprite color bitmask suggests that priority is determined by pen 2 equality comparison between sprite colortable and bg colortable + int spr_pen = *BITMAP_ADDR16(sprite_bitmap, y, x); + if (spr_pen != 15 && spr_pen & 2 && colortable_palette_get_color(screen->machine->colortable,colortable_entry_get_value(screen->machine->colortable, spr_pen & 0x1fe)) == colortable_palette_get_color(screen->machine->colortable,colortable_entry_get_value(screen->machine->colortable, spr_pen & 0x0fe))) + *BITMAP_ADDR16(bitmap, y, x) = spr_pen; } } return 0; |