This commit is contained in:
David Haywood 2016-02-01 20:38:54 +00:00
commit 4c901a669c
2 changed files with 37 additions and 16 deletions

View File

@ -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)
{
@ -142,13 +140,18 @@ WRITE16_MEMBER(overdriv_state::overdriv_soundirq_w)
}
WRITE16_MEMBER(overdriv_state::overdriv_cpuB_irq_x_w)
WRITE16_MEMBER(overdriv_state::slave_irq4_assert_w)
{
m_subcpu->set_input_line(5, HOLD_LINE); // likely wrong
// used in-game
m_subcpu->set_input_line(4, HOLD_LINE);
}
WRITE16_MEMBER(overdriv_state::overdriv_cpuB_irq_y_w)
WRITE16_MEMBER(overdriv_state::slave_irq5_assert_w)
{
// tests GFX ROMs with this irq (indeed enabled only in test mode)
m_subcpu->set_input_line(5, HOLD_LINE);
}
static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state )
@ -174,8 +177,8 @@ static ADDRESS_MAP_START( overdriv_master_map, AS_PROGRAM, 16, overdriv_state )
AM_RANGE(0x218000, 0x218fff) AM_DEVREADWRITE8("k051316_2", k051316_device, read, write, 0xff00)
AM_RANGE(0x220000, 0x220fff) AM_DEVREAD8("k051316_1", k051316_device, rom_r, 0xff00)
AM_RANGE(0x228000, 0x228fff) AM_DEVREAD8("k051316_2", k051316_device, rom_r, 0xff00)
AM_RANGE(0x230000, 0x230001) AM_WRITE(overdriv_cpuB_irq_y_w)
AM_RANGE(0x238000, 0x238001) AM_WRITE(overdriv_cpuB_irq_x_w)
AM_RANGE(0x230000, 0x230001) AM_WRITE(slave_irq4_assert_w)
AM_RANGE(0x238000, 0x238001) AM_WRITE(slave_irq5_assert_w)
ADDRESS_MAP_END
#ifdef UNUSED_FUNCTION
@ -203,6 +206,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,10 +228,11 @@ 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(0x140000, 0x140001) used in later stages, set after writes at 0x208000-0x20bfff range
AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("share1")
AM_RANGE(0x208000, 0x20bfff) AM_RAM
AM_RANGE(0x208000, 0x20bfff) AM_RAM // sprite indirect table?
AM_RANGE(0x218000, 0x219fff) AM_DEVREAD("k053250_1", k053250_device, rom_r)
AM_RANGE(0x220000, 0x221fff) AM_DEVREAD("k053250_2", k053250_device, rom_r)
ADDRESS_MAP_END
@ -303,8 +320,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). */

View File

@ -51,12 +51,15 @@ public:
DECLARE_WRITE16_MEMBER(cpuB_ctrl_w);
DECLARE_WRITE16_MEMBER(overdriv_soundirq_w);
DECLARE_WRITE8_MEMBER(sound_ack_w);
DECLARE_WRITE16_MEMBER(overdriv_cpuB_irq_x_w);
DECLARE_WRITE16_MEMBER(overdriv_cpuB_irq_y_w);
DECLARE_WRITE16_MEMBER(slave_irq4_assert_w);
DECLARE_WRITE16_MEMBER(slave_irq5_assert_w);
DECLARE_WRITE16_MEMBER(objdma_w);
TIMER_CALLBACK_MEMBER(objdma_end_cb);
virtual void machine_start() override;
virtual void machine_reset() override;
UINT32 screen_update_overdriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(cpuB_interrupt);
//INTERRUPT_GEN_MEMBER(cpuB_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(overdriv_cpuA_scanline);
int m_fake_timer;