diff --git a/src/emu/driver.c b/src/emu/driver.c index 980d4533829..65ad6e23d0f 100644 --- a/src/emu/driver.c +++ b/src/emu/driver.c @@ -265,6 +265,8 @@ void driver_device::device_start() video_start(); // save generic states + save_item(NAME(m_latch_clear_value)); + save_item(NAME(m_latched_value)); save_item(NAME(m_flip_screen_x)); save_item(NAME(m_flip_screen_y)); } @@ -519,27 +521,6 @@ void driver_device::updateflip() { // push the flip state to all tilemaps machine().tilemap().set_flip_all((TILEMAP_FLIPX & m_flip_screen_x) | (TILEMAP_FLIPY & m_flip_screen_y)); - - // flip the visible area within the screen width/height - int width = m_screen->width(); - int height = m_screen->height(); - rectangle visarea = m_screen->visible_area(); - if (m_flip_screen_x) - { - int temp = width - visarea.min_x - 1; - visarea.min_x = width - visarea.max_x - 1; - visarea.max_x = temp; - } - if (m_flip_screen_y) - { - int temp = height - visarea.min_y - 1; - visarea.min_y = height - visarea.max_y - 1; - visarea.max_y = temp; - } - - // reconfigure the screen with the new visible area - attoseconds_t period = m_screen->frame_period().attoseconds; - m_screen->configure(width, height, visarea, period); } @@ -556,8 +537,6 @@ void driver_device::flip_screen_set(UINT32 on) // if something's changed, handle it if (m_flip_screen_x != on || m_flip_screen_y != on) { - if (!on) - updateflip(); // flip visarea back m_flip_screen_x = m_flip_screen_y = on; updateflip(); } @@ -566,15 +545,15 @@ void driver_device::flip_screen_set(UINT32 on) //------------------------------------------------- // flip_screen_set_no_update - set global flip -// do not call update_flip. +// do not call updateflip. //------------------------------------------------- void driver_device::flip_screen_set_no_update(UINT32 on) { // flip_screen_y is not updated on purpose // this function is for drivers which - // where writing to flip_screen_x to - // bypass update_flip + // were writing to flip_screen_x to + // bypass updateflip if (on) on = ~0; m_flip_screen_x = on; diff --git a/src/emu/driver.h b/src/emu/driver.h index 30fcd93c9fb..dd755130f5f 100644 --- a/src/emu/driver.h +++ b/src/emu/driver.h @@ -404,8 +404,8 @@ private: UINT8 m_latch_read[4]; // generic video - UINT32 m_flip_screen_x; - UINT32 m_flip_screen_y; + UINT8 m_flip_screen_x; + UINT8 m_flip_screen_y; }; diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c index f1a765fc2d6..3c738c1f88f 100644 --- a/src/emu/tilemap.c +++ b/src/emu/tilemap.c @@ -935,8 +935,10 @@ g_profiler.start(PROFILER_TILEMAP_DRAW); // flush the dirty state to all tiles as appropriate realize_all_dirty_tiles(); - UINT32 width = screen.width(); - UINT32 height = screen.height(); + // flip the tilemap around the center of the visible area + rectangle visarea = screen.visible_area(); + UINT32 width = visarea.min_x + visarea.max_x + 1; + UINT32 height = visarea.min_y + visarea.max_y + 1; // XY scrolling playfield if (m_scrollrows == 1 && m_scrollcols == 1) diff --git a/src/mame/video/arkanoid.c b/src/mame/video/arkanoid.c index c37f08a0676..31a8f18fe4b 100644 --- a/src/mame/video/arkanoid.c +++ b/src/mame/video/arkanoid.c @@ -21,17 +21,8 @@ WRITE8_MEMBER(arkanoid_state::arkanoid_d008_w) int bank; /* bits 0 and 1 flip X and Y, I don't know which is which */ - if (flip_screen_x() != (data & 0x01)) - { - flip_screen_x_set(data & 0x01); - m_bg_tilemap->mark_all_dirty(); - } - - if (flip_screen_y() != (data & 0x02)) - { - flip_screen_y_set(data & 0x02); - m_bg_tilemap->mark_all_dirty(); - } + flip_screen_x_set(data & 0x01); + flip_screen_y_set(data & 0x02); /* bit 2 selects the input paddle */ m_paddle_select = data & 0x04; @@ -76,17 +67,8 @@ WRITE8_MEMBER(arkanoid_state::brixian_d008_w) int bank; /* bits 0 and 1 flip X and Y, I don't know which is which */ - if (flip_screen_x() != (data & 0x01)) - { - flip_screen_x_set(data & 0x01); - m_bg_tilemap->mark_all_dirty(); - } - - if (flip_screen_y() != (data & 0x02)) - { - flip_screen_y_set(data & 0x02); - m_bg_tilemap->mark_all_dirty(); - } + flip_screen_x_set(data & 0x01); + flip_screen_y_set(data & 0x02); /* bit 2 selects the input paddle */ /* - not relevant to brixian */ @@ -125,17 +107,8 @@ WRITE8_MEMBER(arkanoid_state::tetrsark_d008_w) int bank; /* bits 0 and 1 flip X and Y, I don't know which is which */ - if (flip_screen_x() != (data & 0x01)) - { - flip_screen_x_set(data & 0x01); - m_bg_tilemap->mark_all_dirty(); - } - - if (flip_screen_y() != (data & 0x02)) - { - flip_screen_y_set(data & 0x02); - m_bg_tilemap->mark_all_dirty(); - } + flip_screen_x_set(data & 0x01); + flip_screen_y_set(data & 0x02); /* bit 2 selects the input paddle? */ m_paddle_select = data & 0x04; @@ -169,18 +142,8 @@ WRITE8_MEMBER(arkanoid_state::tetrsark_d008_w) WRITE8_MEMBER(arkanoid_state::hexa_d008_w) { /* bit 0 = flipx (or y?) */ - if (flip_screen_x() != (data & 0x01)) - { - flip_screen_x_set(data & 0x01); - m_bg_tilemap->mark_all_dirty(); - } - - /* bit 1 = flipy (or x?) */ - if (flip_screen_y() != (data & 0x02)) - { - flip_screen_y_set(data & 0x02); - m_bg_tilemap->mark_all_dirty(); - } + flip_screen_x_set(data & 0x01); + flip_screen_y_set(data & 0x02); /* bit 2 - 3 unknown */ diff --git a/src/mame/video/cps1.c b/src/mame/video/cps1.c index 2a14a1d1247..a035e7b5f55 100644 --- a/src/mame/video/cps1.c +++ b/src/mame/video/cps1.c @@ -2324,7 +2324,7 @@ void cps_state::cps1_render_sprites( screen_device &screen, bitmap_ind16 &bitmap CODE, \ COLOR, \ !(FLIPX),!(FLIPY), \ - 511-16-(SX),255-16-(SY), screen.priority(),0x02,15); \ + 512-16-(SX),256-16-(SY), screen.priority(),0x02,15); \ else \ pdrawgfx_transpen(bitmap,\ cliprect,machine().gfx[2], \ @@ -2557,7 +2557,7 @@ void cps_state::cps2_render_sprites( screen_device &screen, bitmap_ind16 &bitmap CODE, \ COLOR, \ !(FLIPX),!(FLIPY), \ - 511-16-(SX),255-16-(SY), screen.priority(),primasks[priority],15); \ + 512-16-(SX),256-16-(SY), screen.priority(),primasks[priority],15); \ else \ pdrawgfx_transpen(bitmap,\ cliprect,machine().gfx[2], \ @@ -2720,8 +2720,8 @@ void cps_state::cps1_render_stars( screen_device &screen, bitmap_ind16 &bitmap, sy = (sy - m_stars2y) & 0xff; if (flip_screen()) { - sx = 511 - sx; - sy = 255 - sy; + sx = 512 - sx; + sy = 256 - sy; } col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f); @@ -2745,8 +2745,8 @@ void cps_state::cps1_render_stars( screen_device &screen, bitmap_ind16 &bitmap, sy = (sy - m_stars1y) & 0xff; if (flip_screen()) { - sx = 511 - sx; - sy = 255 - sy; + sx = 512 - sx; + sy = 256 - sy; } col = ((col & 0xe0) >> 1) + (screen.frame_number() / 16 & 0x0f); diff --git a/src/mame/video/twin16.c b/src/mame/video/twin16.c index 5e89b57755e..1be6d3a524e 100644 --- a/src/mame/video/twin16.c +++ b/src/mame/video/twin16.c @@ -492,8 +492,6 @@ VIDEO_START_MEMBER(twin16_state,twin16) m_text_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(twin16_state::get_text_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_text_tilemap->set_transparent_pen(0); - m_text_tilemap->set_scrolldx(0, m_screen->width() - 320); - m_text_tilemap->set_scrolldy(0, m_screen->height() - 256); palette_set_shadow_factor(machine(),0.4); // screenshots estimate