diff options
author | Vas Crabb <vas@vastheman.com> | 2018-05-11 12:42:27 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-05-11 12:42:27 +1000 |
commit | 3191e2c278293323d2b307ae9c74fe06ac0ee6bb (patch) | |
tree | 4523b80a43a0fd2d07a186a092fdeef74ff20cb5 /src/mame/video | |
parent | 545a753303fdafa3c627637146b341d5abea3013 (diff) |
m90: fix rowscroll bias between layers (nw)
Diffstat (limited to 'src/mame/video')
-rw-r--r-- | src/mame/video/m90.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/mame/video/m90.cpp b/src/mame/video/m90.cpp index 6b052c58efc..d2b494fc11d 100644 --- a/src/mame/video/m90.cpp +++ b/src/mame/video/m90.cpp @@ -248,50 +248,51 @@ WRITE16_MEMBER(m90_state::bootleg_video_w) uint32_t m90_state::screen_update_m90(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t pf_base[2] = { uint8_t(m_video_control_data[5] & 0x3), uint8_t(m_video_control_data[6] & 0x3) }; - int layer_ctrl[2] = { m_video_control_data[5], m_video_control_data[6] }; - int rowscroll_offs[2] = { 0xf000 >> 1, 0xf400 >> 1 }; + uint8_t const pf_base[2] = { uint8_t(m_video_control_data[5] & 0x3), uint8_t(m_video_control_data[6] & 0x3) }; + int const layer_ctrl[2] = { m_video_control_data[5], m_video_control_data[6] }; - int video_enable = (m_video_control_data[7]&0x04) ? 0 : 1; - int pf_enable[2] = { (m_video_control_data[5]&0x10) ? 0 : 1, (m_video_control_data[6]&0x10) ? 0 : 1 }; - int clip_miny = std::min(cliprect.min_y,511); - int clip_maxy = std::min(cliprect.max_y,511); + bool const video_enable = !(m_video_control_data[7] & 0x04); + bool const pf_enable[2] = { !(m_video_control_data[5] & 0x10), !(m_video_control_data[6] & 0x10) }; + int const clip_miny = std::min(cliprect.min_y, 511); + int const clip_maxy = std::min(cliprect.max_y, 511); // m_pf_layer[0][0]->enable(pf_enable[0]); // m_pf_layer[1][0]->enable(pf_enable[1]); // m_pf_layer[0][1]->enable(pf_enable[0]); // m_pf_layer[1][1]->enable(pf_enable[1]); + constexpr int rowscroll_offs[2] = { 0xf000 >> 1, 0xf400 >> 1 }; + constexpr int rowscroll_bias[2] = { 2, -2 }; for (int layer = 0; layer < 2; layer++) { /* Dirty tilemaps if VRAM base changes */ - if (pf_base[layer]!=m_last_pf[layer]) + if (pf_base[layer] != m_last_pf[layer]) { m_pf_layer[layer][0]->set_user_data(&m_video_data[pf_base[layer] << 13]); m_pf_layer[layer][1]->set_user_data(&m_video_data[(pf_base[layer] & ~1) << 13]); m_pf_layer[layer][0]->mark_all_dirty(); m_pf_layer[layer][1]->mark_all_dirty(); - m_last_pf[layer]=pf_base[layer]; + m_last_pf[layer] = pf_base[layer]; } /* Setup scrolling */ - if (layer_ctrl[layer]&0x20) + if (layer_ctrl[layer] & 0x20) { m_pf_layer[layer][0]->set_scroll_rows(512); m_pf_layer[layer][1]->set_scroll_rows(512); for (int i=clip_miny; i<=clip_maxy; i++) { - m_pf_layer[layer][0]->set_scrollx(i, m_video_data[rowscroll_offs[layer]+i]+2); - m_pf_layer[layer][1]->set_scrollx(i, m_video_data[rowscroll_offs[layer]+i]+256+2); + m_pf_layer[layer][0]->set_scrollx(i, m_video_data[rowscroll_offs[layer]+i]+rowscroll_bias[layer]); + m_pf_layer[layer][1]->set_scrollx(i, m_video_data[rowscroll_offs[layer]+i]+256+rowscroll_bias[layer]); } } else { m_pf_layer[layer][0]->set_scroll_rows(1); m_pf_layer[layer][1]->set_scroll_rows(1); - m_pf_layer[layer][0]->set_scrollx(0, m_video_control_data[1|(layer<<1)]+2); - m_pf_layer[layer][1]->set_scrollx(0, m_video_control_data[1|(layer<<1)]+256+2); + m_pf_layer[layer][0]->set_scrollx(0, m_video_control_data[1|(layer<<1)]+rowscroll_bias[layer]); + m_pf_layer[layer][1]->set_scrollx(0, m_video_control_data[1|(layer<<1)]+256+rowscroll_bias[layer]); } } |