summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2017-11-12 22:13:16 +0100
committer hap <happppp@users.noreply.github.com>2017-11-12 22:13:29 +0100
commit8593fdceab0c1fa5b6ca81dada40f133d2db0261 (patch)
treed15ee76ed061e39f43fae050178e09ff78c20a53
parent23d1473dac75d2e475e3e88b8557fc15a2ec847a (diff)
pacland: keep sprite-sprite priorities intact on priority-over-fg sprites (nw)
-rw-r--r--src/mame/includes/pacland.h1
-rw-r--r--src/mame/video/pacland.cpp22
2 files changed, 20 insertions, 3 deletions
diff --git a/src/mame/includes/pacland.h b/src/mame/includes/pacland.h
index d71cd094226..4cd4d6302ab 100644
--- a/src/mame/includes/pacland.h
+++ b/src/mame/includes/pacland.h
@@ -34,6 +34,7 @@ public:
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
bitmap_ind16 m_fg_bitmap;
+ bitmap_ind16 m_sprite_bitmap;
std::unique_ptr<uint32_t[]> m_transmask[3];
uint16_t m_scroll0;
uint16_t m_scroll1;
diff --git a/src/mame/video/pacland.cpp b/src/mame/video/pacland.cpp
index 2a2b5332666..065bd733cd5 100644
--- a/src/mame/video/pacland.cpp
+++ b/src/mame/video/pacland.cpp
@@ -189,6 +189,8 @@ TILE_GET_INFO_MEMBER(pacland_state::get_fg_tile_info)
void pacland_state::video_start()
{
+ m_screen->register_screen_bitmap(m_sprite_bitmap);
+
m_screen->register_screen_bitmap(m_fg_bitmap);
m_fg_bitmap.fill(0xffff);
@@ -301,7 +303,7 @@ void pacland_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, co
}
sy -= 16 * sizey;
- sy = (sy & 0xff) - 32; // fix wraparound
+ sy = (sy & 0xff) - 32; // fix wraparound
for (y = 0;y <= sizey;y++)
{
@@ -382,7 +384,21 @@ uint32_t pacland_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
/* draw high priority fg tiles */
draw_fg(screen, bitmap, cliprect, 1);
- /* draw sprite pixels with colortable values >= 0xf0, which have priority over everything */
- draw_sprites(screen, bitmap, cliprect, flip, 2);
+ /* draw sprite pixels with colortable values >= 0xf0, which have priority over all fg tiles */
+ m_sprite_bitmap.fill(0, cliprect);
+ draw_sprites(screen, m_sprite_bitmap, cliprect, flip, 2);
+ for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
+ {
+ uint16_t *src = &m_sprite_bitmap.pix16(y);
+ uint16_t *dst = &bitmap.pix16(y);
+
+ for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
+ {
+ uint16_t pix = src[x];
+ if (pix != 0 && dst[x] < 0x800)
+ dst[x] = pix;
+ }
+ }
+
return 0;
}