dcheese.cpp: Interrupt modernization (nw)

This commit is contained in:
AJR 2019-04-04 21:33:14 -04:00
parent a4742d0129
commit 1a4ae78c7d
2 changed files with 23 additions and 12 deletions

View File

@ -58,14 +58,17 @@ void dcheese_state::update_irq_state()
}
IRQ_CALLBACK_MEMBER(dcheese_state::irq_callback)
uint8_t dcheese_state::iack_r(offs_t offset)
{
/* auto-ack the IRQ */
m_irq_state[irqline] = 0;
update_irq_state();
if (!machine().side_effects_disabled())
{
/* auto-ack the IRQ */
m_irq_state[offset] = 0;
update_irq_state();
}
/* vector is 0x40 + index */
return 0x40 + irqline;
return 0x40 + offset;
}
@ -76,10 +79,13 @@ void dcheese_state::signal_irq(u8 which)
}
INTERRUPT_GEN_MEMBER(dcheese_state::vblank)
WRITE_LINE_MEMBER(dcheese_state::vblank)
{
logerror("---- VBLANK ----\n");
signal_irq(4);
if (state)
{
logerror("---- VBLANK ----\n");
signal_irq(4);
}
}
@ -185,6 +191,10 @@ void dcheese_state::main_cpu_map(address_map &map)
map(0x300000, 0x300001).w(FUNC(dcheese_state::blitter_unknown_w));
}
void dcheese_state::main_fc7_map(address_map &map)
{
map(0xfffff0, 0xfffff9).r(FUNC(dcheese_state::iack_r)).umask16(0x00ff);
}
/*************************************
@ -376,8 +386,7 @@ void dcheese_state::dcheese(machine_config &config)
/* basic machine hardware */
M68000(config, m_maincpu, MAIN_OSC);
m_maincpu->set_addrmap(AS_PROGRAM, &dcheese_state::main_cpu_map);
m_maincpu->set_vblank_int("screen", FUNC(dcheese_state::vblank));
m_maincpu->set_irq_acknowledge_callback(FUNC(dcheese_state::irq_callback));
m_maincpu->set_addrmap(m68000_device::AS_CPU_SPACE, &dcheese_state::main_fc7_map);
M6809(config, m_audiocpu, SOUND_OSC/16); // TODO : Unknown CPU type
m_audiocpu->set_addrmap(AS_PROGRAM, &dcheese_state::sound_cpu_map);
@ -396,6 +405,7 @@ void dcheese_state::dcheese(machine_config &config)
m_screen->set_visarea(0, 319, 0, 239);
m_screen->set_screen_update(FUNC(dcheese_state::screen_update));
m_screen->set_palette("palette");
m_screen->screen_vblank().set(FUNC(dcheese_state::vblank));
PALETTE(config, "palette", FUNC(dcheese_state::dcheese_palette), 65536);

View File

@ -91,15 +91,16 @@ private:
DECLARE_READ16_MEMBER(blitter_vidparam_r);
void dcheese_palette(palette_device &palette) const;
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank);
DECLARE_WRITE_LINE_MEMBER(vblank);
void signal_irq(u8 which);
void update_irq_state();
IRQ_CALLBACK_MEMBER(irq_callback);
uint8_t iack_r(offs_t offset);
void update_scanline_irq();
void do_clear();
void do_blit();
void main_cpu_map(address_map &map);
void main_fc7_map(address_map &map);
void sound_cpu_map(address_map &map);
};