From 616e52f8c260a682f557bcddd914e45b8b357d79 Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 13 Dec 2018 00:29:49 +0100 Subject: cps2: do cps2_set_sprite_priorities() before video update instead of at interrupt handler (nw) https://mametesters.org/view.php?id=4954 --- src/mame/drivers/cps2.cpp | 9 +-------- src/mame/includes/cps1.h | 1 + src/mame/video/cps1.cpp | 7 +++++++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mame/drivers/cps2.cpp b/src/mame/drivers/cps2.cpp index 6ab94eacccc..2f5ad6bd244 100644 --- a/src/mame/drivers/cps2.cpp +++ b/src/mame/drivers/cps2.cpp @@ -674,7 +674,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(cps2_state::cps2_interrupt) { m_cps_b_regs[0x10/2] = 0; m_maincpu->set_input_line(4, HOLD_LINE); - cps2_set_sprite_priorities(); m_screen->update_partial(param); m_scancalls++; // popmessage("IRQ4 scancounter = %04i", param); @@ -685,7 +684,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(cps2_state::cps2_interrupt) { m_cps_b_regs[0x12 / 2] = 0; m_maincpu->set_input_line(4, HOLD_LINE); - cps2_set_sprite_priorities(); m_screen->update_partial(param); m_scancalls++; // popmessage("IRQ4 scancounter = %04i", param); @@ -696,11 +694,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(cps2_state::cps2_interrupt) m_cps_b_regs[0x10 / 2] = m_scanline1; m_cps_b_regs[0x12 / 2] = m_scanline2; m_maincpu->set_input_line(2, HOLD_LINE); - if(m_scancalls) - { - cps2_set_sprite_priorities(); - m_screen->update_partial(256); - } cps2_objram_latch(); } // popmessage("Raster calls = %i", m_scancalls); @@ -1322,7 +1315,7 @@ MACHINE_CONFIG_START(cps2_state::cps2) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) MCFG_SCREEN_RAW_PARAMS(CPS_PIXEL_CLOCK, CPS_HTOTAL, CPS_HBEND, CPS_HBSTART, CPS_VTOTAL, CPS_VBEND, CPS_VBSTART) - MCFG_SCREEN_UPDATE_DRIVER(cps2_state, screen_update_cps1) + MCFG_SCREEN_UPDATE_DRIVER(cps2_state, screen_update_cps2) MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, cps2_state, screen_vblank_cps1)) MCFG_SCREEN_PALETTE("palette") diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h index 70a8d5e9a8c..8134893c5e4 100644 --- a/src/mame/includes/cps1.h +++ b/src/mame/includes/cps1.h @@ -465,6 +465,7 @@ private: void cps2_objram_latch(); uint16_t *cps2_objbase(); virtual void render_layers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) override; + uint32_t screen_update_cps2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_MACHINE_START(cps2); virtual void video_start() override; diff --git a/src/mame/video/cps1.cpp b/src/mame/video/cps1.cpp index 5607f3672bf..1e9bcb9396b 100644 --- a/src/mame/video/cps1.cpp +++ b/src/mame/video/cps1.cpp @@ -3126,6 +3126,13 @@ WRITE_LINE_MEMBER(cps_state::screen_vblank_cps1) } } + +uint32_t cps2_state::screen_update_cps2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + cps2_set_sprite_priorities(); + return screen_update_cps1(screen, bitmap, cliprect); +} + void cps2_state::cps2_set_sprite_priorities() { m_pri_ctrl = m_output[CPS2_OBJ_PRI /2]; -- cgit v1.2.3