From 2e483cb32c3ec542e005cd6087c590146d586c91 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 7 Dec 2015 21:55:08 +0100 Subject: [PATCH] Handled single screen at 60 FPS, nw --- src/mame/drivers/rungun.cpp | 5 +---- src/mame/includes/rungun.h | 3 ++- src/mame/video/rungun.cpp | 21 +++++++++++++++++++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/mame/drivers/rungun.cpp b/src/mame/drivers/rungun.cpp index ff9b5825517..f6d5054a8b1 100644 --- a/src/mame/drivers/rungun.cpp +++ b/src/mame/drivers/rungun.cpp @@ -161,10 +161,7 @@ INTERRUPT_GEN_MEMBER(rungun_state::rng_interrupt) { // send to sprite device current state (i.e. bread & butter sprite DMA) // TODO: firing this in screen update causes sprites to desync badly ... - address_space &space = m_maincpu->space(AS_PROGRAM); - - for(int i=0;i<0x1000;i+=2) - m_k055673->k053247_word_w(space,i/2,m_banked_ram[(i + m_current_display_bank*0x2000) /2],0xffff); + sprite_dma_trigger(); if (m_sysreg[0x0c / 2] & 0x09) device.execute().set_input_line(M68K_IRQ_5, ASSERT_LINE); diff --git a/src/mame/includes/rungun.h b/src/mame/includes/rungun.h index 5dfcc161bff..bc6e45babfd 100644 --- a/src/mame/includes/rungun.h +++ b/src/mame/includes/rungun.h @@ -101,7 +101,8 @@ public: UINT32 screen_update_rng_dual_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); bitmap_ind16 m_rng_dual_demultiplex_left_temp; bitmap_ind16 m_rng_dual_demultiplex_right_temp; - + void sprite_dma_trigger(void); + INTERRUPT_GEN_MEMBER(rng_interrupt); INTERRUPT_GEN_MEMBER(audio_interrupt); }; diff --git a/src/mame/video/rungun.cpp b/src/mame/video/rungun.cpp index 9fb6e2b62e4..11044d788ac 100644 --- a/src/mame/video/rungun.cpp +++ b/src/mame/video/rungun.cpp @@ -121,7 +121,9 @@ UINT32 rungun_state::screen_update_rng(screen_device &screen, bitmap_ind16 &bitm bitmap.fill(m_palette->black_pen(), cliprect); screen.priority().fill(0, cliprect); m_current_display_bank = machine().first_screen()->frame_number() & 1; - + if(m_single_screen_mode == true) + m_current_display_bank = 0; + if(m_video_priority_mode == false) { m_k053936->zoom_draw(screen, bitmap, cliprect, m_936_tilemap[m_current_display_bank], 0, 0, 1); @@ -160,4 +162,19 @@ UINT32 rungun_state::screen_update_rng_dual_right(screen_device &screen, bitmap_ { copybitmap( bitmap, m_rng_dual_demultiplex_right_temp, 0, 0, 0, 0, cliprect); return 0; -} \ No newline at end of file +} + +void rungun_state::sprite_dma_trigger(void) +{ + address_space &space = m_maincpu->space(AS_PROGRAM); + UINT32 src_address; + + if(m_single_screen_mode == true) + src_address = 1*0x2000; + else + src_address = m_current_display_bank*0x2000; + + // TODO: size could be programmable somehow. + for(int i=0;i<0x1000;i+=2) + m_k055673->k053247_word_w(space,i/2,m_banked_ram[(i + src_address) /2],0xffff); +}