summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/seibuspi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/seibuspi.cpp')
-rw-r--r--src/mame/drivers/seibuspi.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp
index 1440f20634a..1e3e0d4bd74 100644
--- a/src/mame/drivers/seibuspi.cpp
+++ b/src/mame/drivers/seibuspi.cpp
@@ -1203,6 +1203,7 @@ WRITE_LINE_MEMBER(seibuspi_state::ymf_irqhandler)
m_audiocpu->set_input_line(0, CLEAR_LINE);
}
+template <int N>
CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode)
{
/* E-Jan Highschool has a keyboard with the following keys
@@ -1229,7 +1230,7 @@ CUSTOM_INPUT_MEMBER(seibuspi_state::ejanhs_encode)
Start - 111 port A
*/
static const u8 encoding[] = { 6, 5, 4, 3, 2, 7 };
- ioport_value state = ~m_key[(uintptr_t)param]->read();
+ ioport_value state = ~m_key[N]->read();
for (int bit = 0; bit < ARRAY_LENGTH(encoding); bit++)
if (state & (1 << bit))
@@ -1380,16 +1381,16 @@ static INPUT_PORTS_START( spi_ejanhs )
PORT_INCLUDE( spi_mahjong_keyboard )
PORT_START("INPUTS")
- PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)3)
- PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)4)
- PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)2)
- PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)0)
+ PORT_BIT( 0x00000007, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<3>)
+ PORT_BIT( 0x00000038, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<4>)
+ PORT_BIT( 0x00000700, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<2>)
+ PORT_BIT( 0x00003800, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<0>)
PORT_SPECIAL_ONOFF_DIPLOC( 0x00008000, 0x00000000, Flip_Screen, "SW1:1" )
PORT_BIT( 0xffff4000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("SYSTEM")
// These need a noncontiguous encoding, but are nonfunctional in any case
- //PORT_BIT( 0x00000013, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, seibuspi_state,ejanhs_encode, (uintptr_t)1)
+ //PORT_BIT( 0x00000013, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(seibuspi_state, ejanhs_encode<1>)
PORT_SERVICE_NO_TOGGLE( 0x00000004, IP_ACTIVE_LOW )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x000000f3, IP_ACTIVE_LOW, IPT_UNKNOWN )