mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
simpsons: fix sound problems after soft reset
This commit is contained in:
parent
8d3f76a569
commit
5a5f220698
@ -172,15 +172,13 @@ void simpsons_state::z80_arm_nmi_w(uint8_t data)
|
||||
// MAME instead does not emulate memory cycle timing and checks the NMI before executing an instruction,
|
||||
// so we have to manually delay the NMI until the following HALT instruction has started.
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
|
||||
m_nmi_enabled = machine().time().as_ticks(m_audiocpu->clock()) + 3;
|
||||
m_nmi_blocked->adjust(m_audiocpu->cycles_to_attotime(4));
|
||||
}
|
||||
|
||||
void simpsons_state::z80_nmi_w(int state)
|
||||
{
|
||||
if(state && m_nmi_enabled && machine().time().as_ticks(m_audiocpu->clock()) > m_nmi_enabled) {
|
||||
m_nmi_enabled = 0;
|
||||
if (state && !m_nmi_blocked->enabled())
|
||||
m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
void simpsons_state::z80_map(address_map &map)
|
||||
|
@ -51,7 +51,7 @@ private:
|
||||
|
||||
/* misc */
|
||||
int m_firq_enabled = 0;
|
||||
u64 m_nmi_enabled = 0;
|
||||
emu_timer *m_nmi_blocked;
|
||||
|
||||
/* views */
|
||||
memory_view m_palette_view;
|
||||
|
@ -47,7 +47,9 @@ void simpsons_state::coin_counter_w(uint8_t data)
|
||||
|
||||
uint8_t simpsons_state::sound_interrupt_r()
|
||||
{
|
||||
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff ); // Z80
|
||||
if (!machine().side_effects_disabled())
|
||||
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); // Z80
|
||||
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
@ -73,7 +75,6 @@ void simpsons_state::machine_start()
|
||||
membank("bank2")->configure_entries(2, 6, memregion("audiocpu")->base() + 0x10000, 0x4000);
|
||||
|
||||
save_item(NAME(m_firq_enabled));
|
||||
save_item(NAME(m_nmi_enabled));
|
||||
save_item(NAME(m_sprite_colorbase));
|
||||
save_item(NAME(m_layer_colorbase));
|
||||
save_item(NAME(m_layerpri));
|
||||
@ -81,6 +82,7 @@ void simpsons_state::machine_start()
|
||||
|
||||
m_dma_start_timer = timer_alloc(FUNC(simpsons_state::dma_start), this);
|
||||
m_dma_end_timer = timer_alloc(FUNC(simpsons_state::dma_end), this);
|
||||
m_nmi_blocked = timer_alloc(timer_expired_delegate());
|
||||
}
|
||||
|
||||
void simpsons_state::machine_reset()
|
||||
@ -93,7 +95,6 @@ void simpsons_state::machine_reset()
|
||||
|
||||
m_sprite_colorbase = 0;
|
||||
m_firq_enabled = 0;
|
||||
m_nmi_enabled = 0;
|
||||
|
||||
/* init the default banks */
|
||||
membank("bank1")->set_entry(0);
|
||||
|
Loading…
Reference in New Issue
Block a user