diff options
author | 2019-04-04 07:36:51 +0200 | |
---|---|---|
committer | 2019-04-05 00:00:58 +0200 | |
commit | e39802db90860d6628c35265f7c78ce3534f5a53 (patch) | |
tree | 796f3fb6524361b61bad36530f3c56e027db57b9 /src/devices/machine/68340.cpp | |
parent | b54a2a517cdd8d9b9ba0456c54c0cced7dd794fc (diff) |
68000: Rework interrupt handling [O. Galibert]
* Implement the cpu space as an address space
* Make all vectored interrupts use the cpu space
* Make it possible to direct the cpu space to another space, use it for amiga (which handles it as a normal AS_PROGRAM read)
* Make it possible to disable the priority muxer and get 3 lines instead, use it for cps2
Diffstat (limited to 'src/devices/machine/68340.cpp')
-rw-r--r-- | src/devices/machine/68340.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/devices/machine/68340.cpp b/src/devices/machine/68340.cpp index bae8be35b62..7f9671fa12d 100644 --- a/src/devices/machine/68340.cpp +++ b/src/devices/machine/68340.cpp @@ -67,8 +67,15 @@ void m68340_cpu_device::update_ipl() } } -IRQ_CALLBACK_MEMBER(m68340_cpu_device::int_ack) +void m68340_cpu_device::internal_vectors_r(address_map &map) { + map(0xfffff2, 0xffffff).r(FUNC(m68340_cpu_device::int_ack)); +} + + +u16 m68340_cpu_device::int_ack(offs_t offset) +{ + int irqline = offset + 1; uint8_t pit_iarb = pit_arbitrate(irqline); uint8_t scu_iarb = m_serial->arbitrate(irqline); uint8_t t1_iarb = m_timer[0]->arbitrate(irqline); @@ -76,7 +83,7 @@ IRQ_CALLBACK_MEMBER(m68340_cpu_device::int_ack) uint8_t iarb = std::max({pit_iarb, scu_iarb, t1_iarb, t2_iarb}); LOGMASKED(LOG_IPL, "Level %d interrupt arbitration: PIT = %X, SCU = %X, T1 = %X, T2 = %X\n", irqline, pit_iarb, scu_iarb, t1_iarb, t2_iarb); int response = 0; - uint32_t vector = standard_irq_callback(irqline); + uint32_t vector = 0x18; // Spurious interrupt // Valid IARB levels are F (high) to 1 (low) and should be unique among modules using the same interrupt level if (iarb != 0) @@ -228,6 +235,7 @@ m68340_cpu_device::m68340_cpu_device(const machine_config &mconfig, const char * m_m68340DMA = nullptr; m_m68340_base = 0; m_ipl = 0; + m_cpu_space_config.m_internal_map = address_map_constructor(FUNC(m68340_cpu_device::internal_vectors_r), this); } void m68340_cpu_device::device_reset() @@ -259,8 +267,6 @@ void m68340_cpu_device::device_start() m_m68340_base = 0x00000000; m_internal = &space(AS_PROGRAM); - - m_int_ack_callback = device_irq_acknowledge_delegate(FUNC(m68340_cpu_device::int_ack), this); } void m68340_cpu_device::m68k_reset_peripherals() |