This commit is contained in:
Robbbert 2016-12-12 08:20:14 +11:00
parent 0517f1c4c5
commit c77720f857

View File

@ -127,6 +127,7 @@ WRITE8_MEMBER(m58_state::scroll_panel_w)
col = ((col >> 3) | col) & 3;
m_scroll_panel_bitmap.pix16(sy, sx + i) = 0x100 + (sy & 0xfc) + col;
m_scroll_panel_bitmap.pix16(sy, sx + i + 0x2c8) = 0x100 + (sy & 0xfc) + col; // for flipscreen
}
}
@ -169,13 +170,7 @@ TILEMAP_MAPPER_MEMBER(m58_state::tilemap_scan_rows)
void m58_state::video_start()
{
int width = m_screen->width();
int height = m_screen->height();
const rectangle &visarea = m_screen->visible_area();
m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(m58_state::get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(m58_state::tilemap_scan_rows),this), 8, 8, 64, 32);
m_bg_tilemap->set_scrolldx(visarea.min_x, width - (visarea.max_x + 1));
m_bg_tilemap->set_scrolldy(visarea.min_y - 8, height + 16 - (visarea.max_y + 1));
m_screen->register_screen_bitmap(m_scroll_panel_bitmap);
save_item(NAME(m_scroll_panel_bitmap));
@ -191,8 +186,24 @@ void m58_state::video_start()
WRITE8_MEMBER(m58_state::flipscreen_w)
{
int width = m_screen->width();
int height = m_screen->height();
const rectangle &visarea = m_screen->visible_area();
/* screen flip is handled both by software and hardware */
flip_screen_set((data & 0x01) ^ (~ioport("DSW2")->read() & 0x01));
bool flipscreen = BIT(data, 0) ^ BIT(~ioport("DSW2")->read(), 0);
flip_screen_set(flipscreen);
if (flipscreen)
{
m_bg_tilemap->set_scrolldx(0, 0);
m_bg_tilemap->set_scrolldy(0, 32);
}
else
{
m_bg_tilemap->set_scrolldx(visarea.min_x, width - (visarea.max_x + 1));
m_bg_tilemap->set_scrolldy(visarea.min_y - 8, height + 16 - (visarea.max_y + 1));
}
machine().bookkeeping().coin_counter_w(0, data & 0x02);
machine().bookkeeping().coin_counter_w(1, data & 0x20);