diff --git a/src/mame/drivers/backfire.cpp b/src/mame/drivers/backfire.cpp index c1e33fdd2bb..620f934a3bc 100644 --- a/src/mame/drivers/backfire.cpp +++ b/src/mame/drivers/backfire.cpp @@ -135,8 +135,8 @@ void backfire_state::video_start() uint32_t backfire_state::screen_update_backfire_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - //FIXME: flip_screen_x should not be written! - flip_screen_set_no_update(1); + // sprites are flipped relative to tilemaps + m_sprgen->set_flip_screen(true); /* screen 1 uses pf1 as the forground and pf3 as the background */ /* screen 2 uses pf2 as the foreground and pf4 as the background */ @@ -166,8 +166,8 @@ uint32_t backfire_state::screen_update_backfire_left(screen_device &screen, bitm uint32_t backfire_state::screen_update_backfire_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - //FIXME: flip_screen_x should not be written! - flip_screen_set_no_update(1); + // sprites are flipped relative to tilemaps + m_sprgen2->set_flip_screen(true); /* screen 1 uses pf1 as the forground and pf3 as the background */ /* screen 2 uses pf2 as the foreground and pf4 as the background */ diff --git a/src/mame/drivers/dblewing.cpp b/src/mame/drivers/dblewing.cpp index 5b712685117..a7c78c70901 100644 --- a/src/mame/drivers/dblewing.cpp +++ b/src/mame/drivers/dblewing.cpp @@ -135,6 +135,7 @@ uint32_t dblewing_state::screen_update_dblewing(screen_device &screen, bitmap_in uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(0, cliprect); /* not Confirmed */ diff --git a/src/mame/drivers/deco156.cpp b/src/mame/drivers/deco156.cpp index fbb43b349f3..7ed7968a9f8 100644 --- a/src/mame/drivers/deco156.cpp +++ b/src/mame/drivers/deco156.cpp @@ -84,8 +84,8 @@ void deco156_state::video_start() uint32_t deco156_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - //FIXME: flip_screen_x should not be written! - flip_screen_set_no_update(1); + // sprites are flipped relative to tilemaps + m_sprgen->set_flip_screen(true); screen.priority().fill(0); bitmap.fill(0); diff --git a/src/mame/drivers/dreambal.cpp b/src/mame/drivers/dreambal.cpp index ba6af8097e0..9b5027a7ba2 100644 --- a/src/mame/drivers/dreambal.cpp +++ b/src/mame/drivers/dreambal.cpp @@ -28,7 +28,6 @@ lamps? #include "machine/eepromser.h" #include "sound/okim6295.h" #include "video/deco16ic.h" -#include "video/decospr.h" #include "screen.h" #include "speaker.h" diff --git a/src/mame/drivers/mirage.cpp b/src/mame/drivers/mirage.cpp index 6c7f6ba69d9..6797ca1cb23 100644 --- a/src/mame/drivers/mirage.cpp +++ b/src/mame/drivers/mirage.cpp @@ -106,6 +106,7 @@ uint32_t miragemj_state::screen_update_mirage(screen_device &screen, bitmap_rgb3 uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); diff --git a/src/mame/drivers/supbtime.cpp b/src/mame/drivers/supbtime.cpp index 25207f54cc7..5a6937d4b39 100644 --- a/src/mame/drivers/supbtime.cpp +++ b/src/mame/drivers/supbtime.cpp @@ -209,6 +209,7 @@ uint32_t supbtime_state::screen_update_supbtime(screen_device &screen, bitmap_in uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(768, cliprect); @@ -228,6 +229,7 @@ uint32_t supbtime_state::screen_update_tumblep(screen_device &screen, bitmap_ind uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(256+512, cliprect); // not verified diff --git a/src/mame/drivers/thedeep.cpp b/src/mame/drivers/thedeep.cpp index 37e7e006eb4..cb2cb068135 100644 --- a/src/mame/drivers/thedeep.cpp +++ b/src/mame/drivers/thedeep.cpp @@ -81,10 +81,12 @@ WRITE8_MEMBER(thedeep_state::protection_w) { case 0x11: flip_screen_set(1); + m_spritegen->set_flip_screen(true); break; case 0x20: flip_screen_set(0); + m_spritegen->set_flip_screen(false); break; case 0x30: @@ -190,7 +192,8 @@ ADDRESS_MAP_END WRITE8_MEMBER(thedeep_state::p1_w) { - flip_screen_set((data & 1) ^ 1); + flip_screen_set(!BIT(data, 0)); + m_spritegen->set_flip_screen(!BIT(data, 0)); membank("bank1")->set_entry((data & 6) >> 1); logerror("P1 %02x\n",data); } diff --git a/src/mame/includes/pcktgal.h b/src/mame/includes/pcktgal.h index 65307e82f0d..b59c86ea949 100644 --- a/src/mame/includes/pcktgal.h +++ b/src/mame/includes/pcktgal.h @@ -45,7 +45,7 @@ public: uint32_t screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flip_screen); void bootleg(machine_config &config); void pcktgal(machine_config &config); void pcktgal2(machine_config &config); diff --git a/src/mame/video/actfancr.cpp b/src/mame/video/actfancr.cpp index dd8f4204e1b..22cd983b776 100644 --- a/src/mame/video/actfancr.cpp +++ b/src/mame/video/actfancr.cpp @@ -14,7 +14,10 @@ uint32_t actfancr_state::screen_update_actfancr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* Draw playfield */ - flip_screen_set(m_tilegen2->get_flip_state()); + bool flip = m_tilegen2->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_spritegen->draw_sprites(bitmap, cliprect, m_spriteram16, 0x00, 0x00, 0x0f); diff --git a/src/mame/video/boogwing.cpp b/src/mame/video/boogwing.cpp index 98de6a66ffe..3392cdc6491 100644 --- a/src/mame/video/boogwing.cpp +++ b/src/mame/video/boogwing.cpp @@ -186,11 +186,15 @@ uint32_t boogwing_state::screen_update_boogwing(screen_device &screen, bitmap_rg uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); uint16_t priority = m_priority; - /* Draw sprite planes to bitmaps for later mixing */ - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true); - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true); - + // sprites are flipped relative to tilemaps flip_screen_set(BIT(flip, 7)); + m_sprgen1->set_flip_screen(!BIT(flip, 7)); + m_sprgen2->set_flip_screen(!BIT(flip, 7)); + + /* Draw sprite planes to bitmaps for later mixing */ + m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400); + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); + m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); diff --git a/src/mame/video/cbuster.cpp b/src/mame/video/cbuster.cpp index 2afb65eac9c..f0823c0c105 100644 --- a/src/mame/video/cbuster.cpp +++ b/src/mame/video/cbuster.cpp @@ -69,6 +69,7 @@ uint32_t cbuster_state::screen_update_twocrude(screen_device &screen, bitmap_rgb uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(!BIT(flip, 7)); + m_sprgen->set_flip_screen(!BIT(flip, 7)); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffer, 0x400); diff --git a/src/mame/video/cninja.cpp b/src/mame/video/cninja.cpp index d70dbe6b8b0..316512f9f93 100644 --- a/src/mame/video/cninja.cpp +++ b/src/mame/video/cninja.cpp @@ -127,6 +127,7 @@ uint32_t cninja_state::screen_update_cninja(screen_device &screen, bitmap_ind16 uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); @@ -184,6 +185,7 @@ uint32_t cninja_state::screen_update_edrandy(screen_device &screen, bitmap_ind16 uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); @@ -219,6 +221,7 @@ uint32_t cninja_state::screen_update_robocop2(screen_device &screen, bitmap_ind1 /* Update playfields */ flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); @@ -260,8 +263,11 @@ uint32_t cninja_state::screen_update_mutantf(screen_device &screen, bitmap_rgb32 uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); uint16_t priority = m_priority; - + // sprites are flipped relative to tilemaps flip_screen_set(BIT(flip, 7)); + m_sprgen1->set_flip_screen(!BIT(flip, 7)); + m_sprgen2->set_flip_screen(!BIT(flip, 7)); + m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); @@ -270,8 +276,8 @@ uint32_t cninja_state::screen_update_mutantf(screen_device &screen, bitmap_rgb32 m_sprgen1->set_alt_format(true); m_sprgen2->set_alt_format(true); - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true); - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true); + m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400); + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); /* There is no priority prom on this board, but there is a diff --git a/src/mame/video/darkseal.cpp b/src/mame/video/darkseal.cpp index f7cea12a8da..aefc53b31b3 100644 --- a/src/mame/video/darkseal.cpp +++ b/src/mame/video/darkseal.cpp @@ -63,6 +63,7 @@ uint32_t darkseal_state::screen_update(screen_device &screen, bitmap_ind16 &bitm address_space &space = machine().dummy_space(); uint16_t flip = m_deco_tilegen2->pf_control_r(space, 0, 0xffff); flip_screen_set(!BIT(flip, 7)); + m_sprgen->set_flip_screen(!BIT(flip, 7)); bitmap.fill(m_palette->black_pen(), cliprect); diff --git a/src/mame/video/dassault.cpp b/src/mame/video/dassault.cpp index 208a87870ab..247ee1f2ca8 100644 --- a/src/mame/video/dassault.cpp +++ b/src/mame/video/dassault.cpp @@ -87,13 +87,16 @@ uint32_t dassault_state::screen_update_dassault(screen_device &screen, bitmap_rg uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); uint16_t priority = m_priority; - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false); - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, false); + flip_screen_set(BIT(flip, 7)); + m_sprgen1->set_flip_screen(BIT(flip, 7)); + m_sprgen2->set_flip_screen(BIT(flip, 7)); + + m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400); + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); bitmap_ind16* sprite_bitmap1 = &m_sprgen1->get_sprite_temp_bitmap(); bitmap_ind16* sprite_bitmap2 = &m_sprgen2->get_sprite_temp_bitmap(); /* Update tilemaps */ - flip_screen_set(BIT(flip, 7)); m_deco_tilegen1->pf_update(nullptr, m_pf2_rowscroll); m_deco_tilegen2->pf_update(nullptr, m_pf4_rowscroll); diff --git a/src/mame/video/dec0.cpp b/src/mame/video/dec0.cpp index 1f828d558e7..f89f85c3148 100644 --- a/src/mame/video/dec0.cpp +++ b/src/mame/video/dec0.cpp @@ -23,7 +23,11 @@ WRITE16_MEMBER(dec0_state::dec0_update_sprites_w) uint32_t dec0_state::screen_update_hbarrel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_spritegen->draw_sprites(bitmap, cliprect, m_buffered_spriteram, 0x08, 0x08, 0x0f); @@ -40,7 +44,11 @@ uint32_t dec0_state::screen_update_hbarrel(screen_device &screen, bitmap_ind16 & uint32_t dec0_state::screen_update_baddudes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); /* WARNING: inverted wrt Midnight Resistance */ if ((m_pri & 0x01) == 0) @@ -80,7 +88,11 @@ uint32_t dec0_state::screen_update_robocop(screen_device &screen, bitmap_ind16 & { int trans; - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); if (m_pri & 0x04) trans = 0x08; @@ -154,7 +166,11 @@ uint32_t dec0_automat_state::screen_update_automat(screen_device &screen, bitmap m_tilegen3->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff); - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); if (m_pri & 0x04) trans = 0x08; @@ -220,7 +236,11 @@ uint32_t dec0_automat_state::screen_update_secretab(screen_device &screen, bitma m_tilegen3->pf_control_1_w(space,0,m_automat_scroll_regs[1] - 0x0108, 0xffff); m_tilegen3->pf_control_1_w(space,1,m_automat_scroll_regs[0], 0xffff); - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); @@ -240,7 +260,10 @@ uint32_t dec0_automat_state::screen_update_secretab(screen_device &screen, bitma uint32_t dec0_state::screen_update_birdtry(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); /* This game doesn't have the extra playfield chip on the game board, but the palette does show through. */ @@ -255,7 +278,11 @@ uint32_t dec0_state::screen_update_birdtry(screen_device &screen, bitmap_ind16 & uint32_t dec0_state::screen_update_hippodrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); if (m_pri & 0x01) { @@ -277,7 +304,11 @@ uint32_t dec0_state::screen_update_hippodrm(screen_device &screen, bitmap_ind16 uint32_t dec0_state::screen_update_slyspy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); @@ -298,7 +329,11 @@ uint32_t dec0_state::screen_update_midres(screen_device &screen, bitmap_ind16 &b { int trans; - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); if (m_pri & 0x04) trans = 0x00; diff --git a/src/mame/video/dec8.cpp b/src/mame/video/dec8.cpp index e842fe720ed..6b8a36db728 100644 --- a/src/mame/video/dec8.cpp +++ b/src/mame/video/dec8.cpp @@ -203,7 +203,11 @@ void dec8_state::srdarwin_draw_sprites( bitmap_ind16 &bitmap, const rectangle & uint32_t dec8_state::screen_update_cobracom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_spritegen_mxc->set_flip_screen(flip); + m_fix_tilemap->set_flip(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_spritegen_mxc->draw_sprites(bitmap, cliprect, m_buffered_spriteram16, 0x04, 0x00, 0x03); @@ -274,7 +278,10 @@ VIDEO_START_MEMBER(dec8_state,ghostb) uint32_t dec8_state::screen_update_oscar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_spritegen_mxc->set_flip_screen(flip); + m_fix_tilemap->set_flip(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); // we mimic the priority scheme in dec0.c, this was originally a bit different, so this could be wrong m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); diff --git a/src/mame/video/decbac06.cpp b/src/mame/video/decbac06.cpp index 9ae938168e6..699d6f13d90 100644 --- a/src/mame/video/decbac06.cpp +++ b/src/mame/video/decbac06.cpp @@ -118,6 +118,7 @@ void deco_bac06_device::device_start() m_bppmult = 0x10; m_bppmask = 0x0f; m_rambank = 0; + m_flip_screen = false; save_pointer(NAME(m_pf_data.get()), 0x4000/2); save_pointer(NAME(m_pf_rowscroll.get()), 0x2000/2); @@ -126,6 +127,7 @@ void deco_bac06_device::device_start() save_item(NAME(m_pf_control_1)); save_item(NAME(m_gfxcolmask)); save_item(NAME(m_rambank)); + save_item(NAME(m_flip_screen)); } void deco_bac06_device::device_reset() @@ -280,7 +282,7 @@ void deco_bac06_device::custom_tilemap_draw(bitmap_ind16 &bitmap, doesn't affect any games. */ - if (machine().driver_data()->flip_screen()) + if (m_flip_screen) src_y = (src_bitmap.height() - 256) - scrolly; else src_y = scrolly; @@ -291,7 +293,7 @@ void deco_bac06_device::custom_tilemap_draw(bitmap_ind16 &bitmap, else src_x=scrollx; - if (machine().driver_data()->flip_screen()) + if (m_flip_screen) src_x=(src_bitmap.width() - 256) - src_x; for (x=0; x<=cliprect.max_x; x++) { diff --git a/src/mame/video/decbac06.h b/src/mame/video/decbac06.h index bf639b7bda7..fbab78c0833 100644 --- a/src/mame/video/decbac06.h +++ b/src/mame/video/decbac06.h @@ -83,8 +83,11 @@ public: void set_colmask(int data) { m_gfxcolmask = data; } void set_bppmultmask( int mult, int mask ) { m_bppmult = mult; m_bppmask = mask; } // stadium hero has 3bpp tiles + void set_flip_screen(bool flip) { m_flip_screen = flip; } + uint8_t m_gfxcolmask; int m_rambank; // external connection? + bool m_flip_screen; /* 16-bit accessors */ diff --git a/src/mame/video/deckarn.cpp b/src/mame/video/deckarn.cpp index e0437548660..d3b54d1324d 100644 --- a/src/mame/video/deckarn.cpp +++ b/src/mame/video/deckarn.cpp @@ -33,6 +33,9 @@ void deco_karnovsprites_device::static_set_gfxdecode_tag(device_t &device, const void deco_karnovsprites_device::device_start() { + m_flip_screen = false; + + save_item(NAME(m_flip_screen)); } void deco_karnovsprites_device::device_reset() @@ -82,7 +85,7 @@ void deco_karnovsprites_device::draw_sprites( bitmap_ind16 &bitmap, const rectan y = (y + 16) % 0x200; x = 256 - x; y = 256 - y; - if (machine().driver_data()->flip_screen()) + if (m_flip_screen) { y = 240 - y; x = 240 - x; diff --git a/src/mame/video/deckarn.h b/src/mame/video/deckarn.h index 137ea8a5403..43ae0ba6314 100644 --- a/src/mame/video/deckarn.h +++ b/src/mame/video/deckarn.h @@ -10,8 +10,9 @@ class deco_karnovsprites_device : public device_t { public: deco_karnovsprites_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_gfxregion(int region) { m_gfxregion = region; }; - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int size, int priority ); + void set_gfxregion(int region) { m_gfxregion = region; } + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int size, int priority); + void set_flip_screen(bool flip) { m_flip_screen = flip; } // static configuration static void static_set_gfxdecode_tag(device_t &device, const char *tag); @@ -22,6 +23,7 @@ protected: virtual void device_reset() override; uint8_t m_gfxregion; + bool m_flip_screen; private: required_device m_gfxdecode; }; diff --git a/src/mame/video/decmxc06.cpp b/src/mame/video/decmxc06.cpp index ee472ff3f27..92815be647c 100644 --- a/src/mame/video/decmxc06.cpp +++ b/src/mame/video/decmxc06.cpp @@ -101,7 +101,7 @@ void deco_mxc06_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cli sx = 240 - sx; sy = 240 - sy; - if (machine().driver_data()->flip_screen()) + if (m_flip_screen) { sy = 240 - sy; sx = 240 - sx; @@ -218,6 +218,9 @@ void deco_mxc06_device::draw_sprites_bootleg( bitmap_ind16 &bitmap, const rectan void deco_mxc06_device::device_start() { m_priority_type = 0; + m_flip_screen = false; + + save_item(NAME(m_flip_screen)); } void deco_mxc06_device::device_reset() diff --git a/src/mame/video/decmxc06.h b/src/mame/video/decmxc06.h index 1d31aaa93e3..95aec2ec5a2 100644 --- a/src/mame/video/decmxc06.h +++ b/src/mame/video/decmxc06.h @@ -22,9 +22,10 @@ public: void set_gfxregion(int region) { m_gfxregion = region; }; - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram16, int pri_mask, int pri_val, int col_mask ); - void draw_sprites_bootleg( bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int pri_mask, int pri_val, int col_mask ); - void set_pri_type( int type ) { m_priority_type = type; } + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram16, int pri_mask, int pri_val, int col_mask); + void draw_sprites_bootleg(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int pri_mask, int pri_val, int col_mask); + void set_pri_type(int type) { m_priority_type = type; } + void set_flip_screen(bool flip) { m_flip_screen = flip; } protected: virtual void device_start() override; @@ -33,6 +34,7 @@ protected: uint8_t m_gfxregion; int m_priority_type; // just so we can support the existing drivers without converting everything to pdrawgfx just yet int m_ramsize; + bool m_flip_screen; private: required_device m_gfxdecode; diff --git a/src/mame/video/deco32.cpp b/src/mame/video/deco32.cpp index c6beb154a17..e0139b95eba 100644 --- a/src/mame/video/deco32.cpp +++ b/src/mame/video/deco32.cpp @@ -131,6 +131,7 @@ uint32_t captaven_state::screen_update_captaven(screen_device &screen, bitmap_in address_space &space = machine().dummy_space(); uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); screen.priority().fill(0, cliprect); bitmap.fill(m_palette->pen(0x000), cliprect); // Palette index not confirmed @@ -203,7 +204,9 @@ uint32_t fghthist_state::screen_update_fghthist(screen_device &screen, bitmap_rg m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true); + // sprites are flipped relative to tilemaps + m_sprgen->set_flip_screen(true); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800); /* Draw screen */ m_deco_tilegen2->tilemap_2_draw(screen, bitmap, cliprect, 0, 1); @@ -384,8 +387,11 @@ uint32_t nslasher_state::screen_update_nslasher(screen_device &screen, bitmap_rg m_sprgen1->set_pix_raw_shift(8); m_sprgen2->set_pix_raw_shift(8); - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true); - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram16_2_buffered, 0x800, true); + // sprites are flipped relative to tilemaps + m_sprgen1->set_flip_screen(true); + m_sprgen2->set_flip_screen(true); + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800); + m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram16_2_buffered, 0x800); /* Render alpha-blended tilemap to separate buffer for proper mixing */ diff --git a/src/mame/video/decospr.cpp b/src/mame/video/decospr.cpp index 1af9e0f883a..0eb74abeb44 100644 --- a/src/mame/video/decospr.cpp +++ b/src/mame/video/decospr.cpp @@ -182,6 +182,9 @@ void decospr_device::device_start() m_alt_format = 0; m_pixmask = 0xf; m_raw_shift = 4; // set to 8 on tattass / nslashers for the custom mixing (because they have 5bpp sprites, and shifting by 4 isn't good enough) + + m_flip_screen = false; + save_item(NAME(m_flip_screen)); } void decospr_device::device_reset() @@ -195,7 +198,7 @@ void decospr_device::alloc_sprite_bitmap() } template -void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords, bool invert_flip ) +void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords) { //printf("cliprect %04x, %04x\n", cliprect.min_y, cliprect.max_y); @@ -208,10 +211,7 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle & int offs, end, incr; - bool flipscreen = (machine().driver_data()->flip_screen() != 0); - - if (invert_flip) - flipscreen = !flipscreen; + bool flipscreen = m_flip_screen; if (!m_pri_cb.isnull()) @@ -565,11 +565,11 @@ void decospr_device::draw_sprites_common(_BitmapClass &bitmap, const rectangle & } } -void decospr_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords, bool invert_flip ) -{ draw_sprites_common(bitmap, cliprect, spriteram, sizewords, invert_flip); } +void decospr_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords) +{ draw_sprites_common(bitmap, cliprect, spriteram, sizewords); } -void decospr_device::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords, bool invert_flip ) -{ draw_sprites_common(bitmap, cliprect, spriteram, sizewords, invert_flip); } +void decospr_device::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords) +{ draw_sprites_common(bitmap, cliprect, spriteram, sizewords); } // inefficient, we should be able to mix in a single pass by comparing the existing priority bitmap from the tilemaps diff --git a/src/mame/video/decospr.h b/src/mame/video/decospr.h index d1a067260c6..cf8b62aed6c 100644 --- a/src/mame/video/decospr.h +++ b/src/mame/video/decospr.h @@ -35,11 +35,12 @@ public: dev.m_y_offset = y_offset; } - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords, bool invert_flip = false ); - void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords, bool invert_flip = false ); - void set_alt_format(bool alt) { m_alt_format = alt; }; - void set_pix_mix_mask(uint16_t mask) { m_pixmask = mask; }; - void set_pix_raw_shift(uint16_t shift) { m_raw_shift = shift; }; + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords); + void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords); + void set_alt_format(bool alt) { m_alt_format = alt; } + void set_pix_mix_mask(uint16_t mask) { m_pixmask = mask; } + void set_pix_raw_shift(uint16_t shift) { m_raw_shift = shift; } + void set_flip_screen(bool flip) { m_flip_screen = flip; } void alloc_sprite_bitmap(); void inefficient_copy_sprite_bitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint16_t pri, uint16_t priority_mask, uint16_t colbase, uint16_t palmask, uint8_t alpha = 0xff); @@ -57,6 +58,7 @@ protected: bool m_alt_format; uint16_t m_pixmask; uint16_t m_raw_shift; + bool m_flip_screen; // used by various bootleg / clone chips. bool m_is_bootleg; // used by various bootlegs (disables masking of sprite tile number when multi-sprite is used) @@ -67,7 +69,7 @@ protected: private: template - void draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords, bool invert_flip); + void draw_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, uint16_t* spriteram, int sizewords); required_device m_gfxdecode; }; diff --git a/src/mame/video/dietgo.cpp b/src/mame/video/dietgo.cpp index db2afdee85d..3b0c48c3579 100644 --- a/src/mame/video/dietgo.cpp +++ b/src/mame/video/dietgo.cpp @@ -9,6 +9,7 @@ uint32_t dietgo_state::screen_update_dietgo(screen_device &screen, bitmap_ind16 uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(256, cliprect); /* not verified */ diff --git a/src/mame/video/esd16.cpp b/src/mame/video/esd16.cpp index a89d23cd1cc..c36ee9ca06f 100644 --- a/src/mame/video/esd16.cpp +++ b/src/mame/video/esd16.cpp @@ -110,7 +110,9 @@ WRITE16_MEMBER(esd16_state::esd16_tilemap0_color_w) m_tilemap_0->mark_all_dirty(); m_tilemap_0_16x16->mark_all_dirty(); - flip_screen_set(data & 0x80); + bool flip = BIT(data, 7); + flip_screen_set(flip); + m_sprgen->set_flip_screen(flip); } WRITE16_MEMBER(esd16_state::esd16_tilemap0_color_jumppop_w) @@ -119,7 +121,9 @@ WRITE16_MEMBER(esd16_state::esd16_tilemap0_color_jumppop_w) m_tilemap0_color = 2; m_tilemap1_color = 1; - flip_screen_set(data & 0x80); + bool flip = BIT(data, 7); + flip_screen_set(flip); + m_sprgen->set_flip_screen(flip); } diff --git a/src/mame/video/funkyjet.cpp b/src/mame/video/funkyjet.cpp index f18380faaf2..aee56f5622e 100644 --- a/src/mame/video/funkyjet.cpp +++ b/src/mame/video/funkyjet.cpp @@ -17,6 +17,7 @@ uint32_t funkyjet_state::screen_update_funkyjet(screen_device &screen, bitmap_in uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(768, cliprect); diff --git a/src/mame/video/karnov.cpp b/src/mame/video/karnov.cpp index a1584d7b2ed..b9f6443bd26 100644 --- a/src/mame/video/karnov.cpp +++ b/src/mame/video/karnov.cpp @@ -12,8 +12,8 @@ void karnov_state::karnov_flipscreen_w( int data ) { m_flipscreen = data; - machine().tilemap().set_flip_all(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - flip_screen_set(m_flipscreen); + m_fix_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + m_spritegen->set_flip_screen(m_flipscreen); } void karnov_state::draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect ) diff --git a/src/mame/video/lemmings.cpp b/src/mame/video/lemmings.cpp index b7945932770..08d57bc4a5a 100644 --- a/src/mame/video/lemmings.cpp +++ b/src/mame/video/lemmings.cpp @@ -136,8 +136,11 @@ uint32_t lemmings_state::screen_update_lemmings(screen_device &screen, bitmap_rg rect.max_y = cliprect.max_y; rect.min_y = cliprect.min_y; - m_sprgen->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_1, 0x400, true); - m_sprgen2->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_0, 0x400, true); + // sprites are flipped relative to tilemaps + m_sprgen->set_flip_screen(true); + m_sprgen2->set_flip_screen(true); + m_sprgen->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_1, 0x400); + m_sprgen2->draw_sprites(bitmap, cliprect, m_sprite_triple_buffer_0, 0x400); bitmap.fill(m_palette->black_pen(), cliprect); m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 0x300, 0xff); diff --git a/src/mame/video/madmotor.cpp b/src/mame/video/madmotor.cpp index b56fa311bc6..035374c277a 100644 --- a/src/mame/video/madmotor.cpp +++ b/src/mame/video/madmotor.cpp @@ -24,9 +24,11 @@ void madmotor_state::video_start() uint32_t madmotor_state::screen_update_madmotor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); - -// machine().tilemap().set_flip_all(m_tilegen1->get_flip_state() ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_tilegen2->set_flip_screen(flip); + m_tilegen3->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); m_tilegen3->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); m_tilegen2->deco_bac06_pf_draw(bitmap,cliprect,0, 0x00, 0x00, 0x00, 0x00); diff --git a/src/mame/video/pcktgal.cpp b/src/mame/video/pcktgal.cpp index 7920e0c750f..1ae8b1e9fa2 100644 --- a/src/mame/video/pcktgal.cpp +++ b/src/mame/video/pcktgal.cpp @@ -31,7 +31,7 @@ PALETTE_INIT_MEMBER(pcktgal_state, pcktgal) } } -void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bool flip_screen) { for (int offs = 0;offs < m_spriteram.bytes();offs += 4) { @@ -45,7 +45,7 @@ void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect flipx = m_spriteram[offs+1] & 0x04; flipy = m_spriteram[offs+1] & 0x02; - if (flip_screen()) { + if (flip_screen) { sx=240-sx; sy=240-sy; if (flipx) flipx=0; else flipx=1; @@ -63,17 +63,19 @@ void pcktgal_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect uint32_t pcktgal_state::screen_update_pcktgal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); - draw_sprites(bitmap, cliprect); + draw_sprites(bitmap, cliprect, flip); return 0; } uint32_t pcktgal_state::screen_update_pcktgalb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); // the bootleg doesn't properly set the tilemap registers, because it's on non-original hardware, which probably doesn't have the flexible tilemaps. m_tilegen1->deco_bac06_pf_draw_bootleg(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0, 2); - draw_sprites(bitmap, cliprect); + draw_sprites(bitmap, cliprect, flip); return 0; } diff --git a/src/mame/video/pktgaldx.cpp b/src/mame/video/pktgaldx.cpp index 56b95374fb1..79da35fcb41 100644 --- a/src/mame/video/pktgaldx.cpp +++ b/src/mame/video/pktgaldx.cpp @@ -11,14 +11,16 @@ uint32_t pktgaldx_state::screen_update_pktgaldx(screen_device &screen, bitmap_in address_space &space = machine().dummy_space(); uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + // sprites are flipped relative to tilemaps flip_screen_set(BIT(flip, 7)); + m_sprgen->set_flip_screen(!BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); bitmap.fill(0, cliprect); /* not Confirmed */ screen.priority().fill(0); m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400, true); + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/rohga.cpp b/src/mame/video/rohga.cpp index d255acc779c..89eaf75e92d 100644 --- a/src/mame/video/rohga.cpp +++ b/src/mame/video/rohga.cpp @@ -26,8 +26,11 @@ uint32_t rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &b uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); uint16_t priority = m_decocomn->priority_r(); - /* Update playfields */ + // sprites are flipped relative to tilemaps flip_screen_set(BIT(flip, 7)); + m_sprgen1->set_flip_screen(!BIT(flip, 7)); + + /* Update playfields */ m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); @@ -63,7 +66,7 @@ uint32_t rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &b break; } - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true); + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -129,12 +132,16 @@ uint32_t rohga_state::screen_update_wizdfire(screen_device &screen, bitmap_rgb32 uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); uint16_t priority = m_decocomn->priority_r(); + // sprites are flipped relative to tilemaps + flip_screen_set(BIT(flip, 7)); + m_sprgen1->set_flip_screen(!BIT(flip, 7)); + m_sprgen2->set_flip_screen(!BIT(flip, 7)); + /* draw sprite gfx to temp bitmaps */ - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, true); - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true); + m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400); + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); /* Update playfields */ - flip_screen_set(BIT(flip, 7)); m_deco_tilegen1->pf_update(nullptr, nullptr); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); @@ -328,14 +335,17 @@ uint32_t rohga_state::screen_update_nitrobal(screen_device &screen, bitmap_rgb32 uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); uint16_t priority = m_decocomn->priority_r(); + flip_screen_set(BIT(flip, 7)); + m_sprgen1->set_flip_screen(BIT(flip, 7)); + m_sprgen2->set_flip_screen(BIT(flip, 7)); + /* draw sprite gfx to temp bitmaps */ m_sprgen1->set_alt_format(true); m_sprgen2->set_alt_format(true); - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400, false); - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, false); + m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2->buffer(), 0x400); + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); /* Update playfields */ - flip_screen_set(BIT(flip, 7)); m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); diff --git a/src/mame/video/simpl156.cpp b/src/mame/video/simpl156.cpp index ec1246e0a47..3c06f8cff70 100644 --- a/src/mame/video/simpl156.cpp +++ b/src/mame/video/simpl156.cpp @@ -35,8 +35,8 @@ uint32_t simpl156_state::screen_update_simpl156(screen_device &screen, bitmap_in m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); - //FIXME: flip_screen_x should not be written! - flip_screen_set_no_update(1); + // sprites are flipped relative to tilemaps + m_sprgen->set_flip_screen(true); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram.get(), 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more) return 0; diff --git a/src/mame/video/sshangha.cpp b/src/mame/video/sshangha.cpp index a586dfcb531..f176ffb0202 100644 --- a/src/mame/video/sshangha.cpp +++ b/src/mame/video/sshangha.cpp @@ -32,16 +32,18 @@ void sshangha_state::video_start() uint32_t sshangha_state::screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram, 0x800, true); - - // I'm pretty sure only the original has the 2nd spriteram, used for the Japanese text on the 2nd scene (non-scrolling text) in the intro of the quest (3rd in JPN) mode - if (m_spriteram2 != nullptr) - m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2, 0x800, true); - - // flip screen + // sprites are flipped relative to tilemaps address_space &space = machine().dummy_space(); uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); + m_sprgen1->set_flip_screen(!BIT(flip, 7)); + m_sprgen2->set_flip_screen(!BIT(flip, 7)); + + m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram, 0x800); + + // I'm pretty sure only the original has the 2nd spriteram, used for the Japanese text on the 2nd scene (non-scrolling text) in the intro of the quest (3rd in JPN) mode + if (m_spriteram2 != nullptr) + m_sprgen2->draw_sprites(bitmap, cliprect, m_spriteram2, 0x800); bitmap.fill(m_palette->black_pen(), cliprect); diff --git a/src/mame/video/stadhero.cpp b/src/mame/video/stadhero.cpp index ff7d3ec2928..b35c2b33975 100644 --- a/src/mame/video/stadhero.cpp +++ b/src/mame/video/stadhero.cpp @@ -22,7 +22,10 @@ uint32_t stadhero_state::screen_update_stadhero(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - flip_screen_set(m_tilegen1->get_flip_state()); + bool flip = m_tilegen1->get_flip_state(); + m_tilegen1->set_flip_screen(flip); + m_spritegen->set_flip_screen(flip); + m_pf1_tilemap->set_flip(flip ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); m_tilegen1->set_bppmultmask(0x8, 0x7); m_tilegen1->deco_bac06_pf_draw(bitmap,cliprect,TILEMAP_DRAW_OPAQUE, 0x00, 0x00, 0x00, 0x00); diff --git a/src/mame/video/tumbleb.cpp b/src/mame/video/tumbleb.cpp index de68bc40495..a515f219f7d 100644 --- a/src/mame/video/tumbleb.cpp +++ b/src/mame/video/tumbleb.cpp @@ -299,6 +299,7 @@ void tumbleb_state::tumbleb_draw_common(screen_device &screen, bitmap_ind16 &bit else m_pf1_alt_tilemap->draw(screen, bitmap, cliprect, 0, 0); + m_sprgen->set_flip_screen(flip_screen() != 0); m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2); } @@ -425,7 +426,6 @@ uint32_t tumbleb_state::screen_update_sdfight(screen_device &screen, bitmap_ind1 tumbleb_draw_common(screen, bitmap, cliprect, offs2, -16, offs, 0); - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, m_spriteram.bytes()/2); return 0; } diff --git a/src/mame/video/vaportra.cpp b/src/mame/video/vaportra.cpp index 56ff437dbb3..062734f76a0 100644 --- a/src/mame/video/vaportra.cpp +++ b/src/mame/video/vaportra.cpp @@ -59,6 +59,7 @@ uint32_t vaportra_state::screen_update_vaportra(screen_device &screen, bitmap_in m_deco_tilegen1->pf_update(nullptr, nullptr); m_deco_tilegen2->pf_update(nullptr, nullptr); + m_spritegen->set_flip_screen(!BIT(flip, 7)); m_spritegen->set_pri_type(1); // force priorities to be handled in a different way for this driver for now /* Draw playfields */