summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/overdriv.cpp
diff options
context:
space:
mode:
authorGravatarGravatar angelosa <salese_corp_ltd@email.it>2016-02-01 21:03:59 +0100
committerGravatarGravatar angelosa <salese_corp_ltd@email.it>2016-02-01 21:04:21 +0100
commit59e2e7e7ff3a43f62e23e5f26231cf5c5557a194 (patch) (github)
treed02f8b87fa175d5287efe412ad0e2e2f4b46c4c1 /src/mame/drivers/overdriv.cpp
parent0cd30c1a664c7389b7982076432c3d4d9c613a9c (diff)
downloadmame-59e2e7e7ff3a43f62e23e5f26231cf5c5557a194.tar.bz2
mame-59e2e7e7ff3a43f62e23e5f26231cf5c5557a194.zip
Moved sprite irq DMA into a timer callback, nw
Diffstat (limited to 'src/mame/drivers/overdriv.cpp')
-rw-r--r--src/mame/drivers/overdriv.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/mame/drivers/overdriv.cpp b/src/mame/drivers/overdriv.cpp
index 7d14ae9aca0..bbe9774e7f9 100644
--- a/src/mame/drivers/overdriv.cpp
+++ b/src/mame/drivers/overdriv.cpp
@@ -82,7 +82,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(overdriv_state::overdriv_cpuA_scanline)
{
// m_screen->frame_number() & 1
m_maincpu->set_input_line(4, HOLD_LINE);
- m_subcpu->set_input_line(4, HOLD_LINE); // likely wrong
}
else if(m_fake_timer >= timer_threshold) // timer irq
{
@@ -91,13 +90,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(overdriv_state::overdriv_cpuA_scanline)
}
}
+#ifdef UNUSED_FUNCTION
INTERRUPT_GEN_MEMBER(overdriv_state::cpuB_interrupt)
{
// this doesn't get turned on until the irq has happened? wrong irq?
- if (m_k053246->k053246_is_irq_enabled())
- m_subcpu->set_input_line(6, HOLD_LINE); // likely wrong
}
-
+#endif
WRITE16_MEMBER(overdriv_state::cpuA_ctrl_w)
{
@@ -149,6 +147,7 @@ WRITE16_MEMBER(overdriv_state::overdriv_cpuB_irq_x_w)
WRITE16_MEMBER(overdriv_state::overdriv_cpuB_irq_y_w)
{
+ m_subcpu->set_input_line(4, HOLD_LINE);
}
static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state )
@@ -203,6 +202,19 @@ WRITE16_MEMBER( overdriv_state::overdriv_k053246_word_w )
}
#endif
+TIMER_CALLBACK_MEMBER(overdriv_state::objdma_end_cb )
+{
+ m_subcpu->set_input_line(6, HOLD_LINE);
+}
+
+WRITE16_MEMBER(overdriv_state::objdma_w)
+{
+ if(data & 0x10)
+ machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(overdriv_state::objdma_end_cb), this));
+
+ m_k053246->k053246_w(space,5,data,mem_mask);
+}
+
static ADDRESS_MAP_START( overdriv_slave_map, AS_PROGRAM, 16, overdriv_state )
AM_RANGE(0x000000, 0x03ffff) AM_ROM
AM_RANGE(0x080000, 0x083fff) AM_RAM /* work RAM */
@@ -212,6 +224,7 @@ static ADDRESS_MAP_START( overdriv_slave_map, AS_PROGRAM, 16, overdriv_state )
AM_RANGE(0x118000, 0x118fff) AM_DEVREADWRITE("k053246", k053247_device, k053247_word_r, k053247_word_w) // data gets copied to sprite chip with DMA..
AM_RANGE(0x120000, 0x120001) AM_DEVREAD("k053246", k053247_device, k053246_word_r)
AM_RANGE(0x128000, 0x128001) AM_READWRITE(cpuB_ctrl_r, cpuB_ctrl_w) /* enable K053247 ROM reading, plus something else */
+ AM_RANGE(0x130004, 0x130005) AM_WRITE(objdma_w)
AM_RANGE(0x130000, 0x130007) AM_DEVREADWRITE8("k053246", k053247_device, k053246_r,k053246_w,0xffff)
//AM_RANGE(0x140000, 0x140001) used in later stages
AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
@@ -303,8 +316,9 @@ static MACHINE_CONFIG_START( overdriv, overdriv_state )
MCFG_CPU_ADD("sub", M68000, XTAL_24MHz/2) /* 12 MHz */
MCFG_CPU_PROGRAM_MAP(overdriv_slave_map)
- MCFG_CPU_VBLANK_INT_DRIVER("screen", overdriv_state, cpuB_interrupt) /* IRQ 5 and 6 are generated by the main CPU. */
- /* IRQ 5 is used only in test mode, to request the checksums of the gfx ROMs. */
+ //MCFG_CPU_VBLANK_INT_DRIVER("screen", overdriv_state, cpuB_interrupt)
+ /* IRQ 5 and 6 are generated by the main CPU. */
+ /* IRQ 5 is used only in test mode, to request the checksums of the gfx ROMs. */
MCFG_CPU_ADD("audiocpu", M6809, XTAL_3_579545MHz) /* 1.789 MHz?? This might be the right speed, but ROM testing */
MCFG_CPU_PROGRAM_MAP(overdriv_sound_map) /* takes a little too much (the counter wraps from 0000 to 9999). */