summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar angelosa <lordkale4@gmail.com>2019-10-24 16:49:31 +0200
committerGravatarGravatar angelosa <lordkale4@gmail.com>2019-10-24 16:49:31 +0200
commit7015c1ffbca7c6098f3913f4eba8f4144f0be203 (patch) (github)
tree5812e431eec3e73dcebf0d60d388f796e5012054
parent7cbdb66806fb64b6a8a6e808be2a855a8e7ece34 (diff)
downloadmame-arm_vidc20.tar.bz2
mame-arm_vidc20.zip
trigger_irq syntactic sugararm_vidc20
-rw-r--r--src/devices/machine/arm_iomd.cpp8
-rw-r--r--src/devices/machine/arm_iomd.h2
-rw-r--r--src/mame/drivers/ssfindo.cpp5
3 files changed, 8 insertions, 7 deletions
diff --git a/src/devices/machine/arm_iomd.cpp b/src/devices/machine/arm_iomd.cpp
index 8cd90e1ba1e..a9b079d5f83 100644
--- a/src/devices/machine/arm_iomd.cpp
+++ b/src/devices/machine/arm_iomd.cpp
@@ -332,7 +332,7 @@ void arm_iomd_device::device_timer(emu_timer &timer, device_timer_id id, int par
{
case T0_TIMER:
case T1_TIMER:
- trigger_irq(IRQA, id == T1_TIMER ? 0x40 : 0x20);
+ trigger_irq<IRQA>(id == T1_TIMER ? 0x40 : 0x20);
break;
}
}
@@ -437,7 +437,7 @@ inline void arm_iomd_device::flush_irq(unsigned Which)
m_host_cpu->pulse_input_line(ARM7_IRQ_LINE, m_host_cpu->minimum_quantum_time());
}
-inline void arm_iomd_device::trigger_irq(unsigned Which, u8 irq_type)
+template <unsigned Which> inline void arm_iomd_device::trigger_irq(u8 irq_type)
{
m_irq_status[Which] |= irq_type;
flush_irq(Which);
@@ -670,7 +670,7 @@ WRITE_LINE_MEMBER( arm_iomd_device::vblank_irq )
if (!state)
return;
- trigger_irq(IRQA, 0x08);
+ trigger_irq<IRQA>(0x08);
if (m_video_enable == true)
{
// TODO: much more complex, last/end regs, start regs and eventually LCD hooks
@@ -755,7 +755,7 @@ WRITE_LINE_MEMBER( arm_iomd_device::keyboard_irq )
if (!state)
return;
- trigger_irq(IRQB, 0x80);
+ trigger_irq<IRQB>(0x80);
}
WRITE_LINE_MEMBER( arm_iomd_device::keyboard_reset )
diff --git a/src/devices/machine/arm_iomd.h b/src/devices/machine/arm_iomd.h
index 50f0287d175..c996a88b3dd 100644
--- a/src/devices/machine/arm_iomd.h
+++ b/src/devices/machine/arm_iomd.h
@@ -137,7 +137,7 @@ private:
u8 m_irq_status[IRQ_SOURCES_SIZE], m_irq_mask[IRQ_SOURCES_SIZE];
inline u8 update_irqa_type(u8 data);
inline void flush_irq(unsigned Which);
- inline void trigger_irq(unsigned Which, u8 irq_type);
+ template <unsigned Which> inline void trigger_irq(u8 irq_type);
static constexpr int timer_ch_size = 2;
enum {
diff --git a/src/mame/drivers/ssfindo.cpp b/src/mame/drivers/ssfindo.cpp
index ae3b3d796ab..86a4da267b4 100644
--- a/src/mame/drivers/ssfindo.cpp
+++ b/src/mame/drivers/ssfindo.cpp
@@ -246,18 +246,19 @@ WRITE8_MEMBER(ssfindo_state::iolines_w)
}
// inverted compared to riscpc.cpp?
+// TODO: investigate about why with this arrangement doesn't work (gut feeling tells me that i2c doesn't like double reading)
READ_LINE_MEMBER(tetfight_state::iocr_od1_r)
{
// TODO: completely get rid of this speedup fn or move anywhere else
//if (m_speedup) (this->*m_speedup)();
- // returning 0 here causes a tight loop with cyan border.
return (m_i2cmem->read_sda() ? 1 : 0); //eeprom read
}
READ_LINE_MEMBER(tetfight_state::iocr_od0_r)
{
// TODO: presuming same as Acorn Archimedes, where i2c clock can be readback
- return m_i2cmem_clock;
+ return (m_i2cmem->read_sda() ? 1 : 0); //eeprom read
+// return m_i2cmem_clock;
}
// TODO: correct hookup