summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/mermaid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/video/mermaid.cpp')
-rw-r--r--src/mame/video/mermaid.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/mame/video/mermaid.cpp b/src/mame/video/mermaid.cpp
index 0e54bda0c89..18522971479 100644
--- a/src/mame/video/mermaid.cpp
+++ b/src/mame/video/mermaid.cpp
@@ -97,11 +97,14 @@ void mermaid_state::mermaid_fg_scroll_w(offs_t offset, uint8_t data)
WRITE_LINE_MEMBER(mermaid_state::bg_mask_w)
{
m_bg_mask = state;
+ logerror("mask %d\n", state);
}
WRITE_LINE_MEMBER(mermaid_state::bg_bank_w)
{
m_bg_bank = state ? 0x100 : 0;
+ m_bg_tilemap->mark_all_dirty();
+ logerror("bank %d\n", state);
}
WRITE_LINE_MEMBER(mermaid_state::rougien_gfxbankswitch1_w)
@@ -224,11 +227,28 @@ void mermaid_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprec
uint32_t mermaid_state::screen_update_mermaid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
- if (m_bg_mask)
+ if (m_bg_split)
{
+ constexpr int split_y = 64;
+ constexpr rectangle rr(0, 32*8-1, 0, 32*8-1);
+ m_bg_tilemap->draw(screen, m_helper_mask, rr, 0, 0);
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- u16 *p = &bitmap.pix(y);
+ int sy = y >= split_y ? 32*8 - 2 - (y - split_y) : 32*8 - split_y + y;
+ const u16 *s = &m_helper_mask.pix(sy, cliprect.min_x);
+ u16 *p = &bitmap.pix(y, cliprect.min_x);
+ memcpy(p, s, 2*(cliprect.max_x - cliprect.min_x + 1));
+ }
+
+
+ m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
+ draw_sprites(bitmap, cliprect);
+ }
+ else if (m_bg_mask)
+ {
+ for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
+ {
+ u16 *p = &bitmap.pix(y, cliprect.min_x);
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
*p++ = x < 26*8 ? 0x42 : 0x40;
}
@@ -238,8 +258,8 @@ uint32_t mermaid_state::screen_update_mermaid(screen_device &screen, bitmap_ind1
m_bg_tilemap->draw(screen, m_helper_mask, cliprect, 0, 0);
for (int y = cliprect.min_y; y <= cliprect.max_y; y++)
{
- const u16 *s = &m_helper_mask.pix(y);
- u16 *p = &bitmap.pix(y);
+ const u16 *s = &m_helper_mask.pix(y, cliprect.min_x);
+ u16 *p = &bitmap.pix(y, cliprect.min_x);
bool on = false;
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{