diff options
author | 2022-01-18 17:24:39 -0900 | |
---|---|---|
committer | 2022-01-18 21:24:39 -0500 | |
commit | 4e701a461ead9b3fd9607a8a550d5ba96c9af0dc (patch) | |
tree | 302daaaabcf60a7fe3c83f32849bbd637000d17d /src/devices/bus | |
parent | 592d3338f20019633d8deb4f5c647cbefe14ecd9 (diff) |
nes/bus: Small fixes for Sunsoft FME-7 IRQ. (#9166)
- Removed hard-coded NTSC timing. Improves raster-split effects for the two PAL games, Gimmick and Batman Return of the Joker.
- Clear IRQs for any write to IRQ control register, as confirmed by hardware tests.
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/nes/sunsoft.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/devices/bus/nes/sunsoft.cpp b/src/devices/bus/nes/sunsoft.cpp index 069bac103bf..9e8bbe5555d 100644 --- a/src/devices/bus/nes/sunsoft.cpp +++ b/src/devices/bus/nes/sunsoft.cpp @@ -168,9 +168,7 @@ void nes_sunsoft_fme7_device::device_start() { common_start(); irq_timer = timer_alloc(TIMER_IRQ); - // this has to be hardcoded because some some scanline code only suits NTSC... it will be fixed with PPU rewrite - irq_timer->adjust(attotime::zero, 0, attotime::from_hz((21477272.724 / 12))); -// irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1)); + irq_timer->adjust(attotime::zero, 0, clocks_to_attotime(1)); save_item(NAME(m_wram_bank)); save_item(NAME(m_latch)); @@ -445,16 +443,13 @@ void nes_sunsoft_fme7_device::device_timer(emu_timer &timer, device_timer_id id, { if (id == TIMER_IRQ) { - if ((m_irq_enable & 0x80)) // bit7, counter decrement + if (BIT(m_irq_enable, 7)) // counter decrement enabled { - if (!m_irq_count) + if (--m_irq_count == 0xffff) { - m_irq_count = 0xffff; - if (m_irq_enable & 0x01) // bit0, trigger enable + if (BIT(m_irq_enable, 0)) // IRQs enabled set_irq_line(ASSERT_LINE); } - else - m_irq_count--; } } } @@ -499,8 +494,7 @@ void nes_sunsoft_fme7_device::fme7_write(offs_t offset, uint8_t data) break; case 0x0d: m_irq_enable = data; - if (!(m_irq_enable & 1)) - set_irq_line(CLEAR_LINE); + set_irq_line(CLEAR_LINE); break; case 0x0e: m_irq_count = (m_irq_count & 0xff00) | data; |