From ec7d9d5f5ec9cb13d4327321bf654aa80581337e Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 4 Dec 2023 01:58:44 +0100 Subject: konami/viper.cpp: filter irq state change until current one is actually serviced, make everything more stable --- src/mame/konami/viper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mame/konami/viper.cpp b/src/mame/konami/viper.cpp index 96ea818de03..c9d85db1d14 100644 --- a/src/mame/konami/viper.cpp +++ b/src/mame/konami/viper.cpp @@ -785,7 +785,7 @@ void viper_state::pci_config_data_w(uint64_t data) // TODO: timing calculation, comes from fdr / dffsr // most if not all games in the driver sets fdr = 0x27 = 512, dffsr = 0x21 -// code1db is *extremely* sensitive to this value +// code1db is *extremely* sensitive to this value, should really be divided by 10 #define I2C_TIMER_FREQ (SDRAM_CLOCK / 512) / 64 uint8_t viper_state::i2cdr_r(offs_t offset) @@ -1138,6 +1138,10 @@ void viper_state::epic_update_interrupts() int irq = -1; int priority = -1; + // Do not change the state until current irq is fully serviced. + if (m_epic.active_irq >= 0) + return; + // find the highest priority pending interrupt for (i=MPC8240_NUM_INTERRUPTS-1; i >= 0; i--) { -- cgit v1.2.3