From f08ec01a02b5e9e25e372b70e643c2c9f05fadf5 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 30 Dec 2024 00:59:34 +1100 Subject: misc/homedata.cpp: Use standard mahjong matrix and added second player position controls for Mahjong Hourouki and similar. --- src/mame/misc/homedata.cpp | 51 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/src/mame/misc/homedata.cpp b/src/mame/misc/homedata.cpp index 17436d9cee2..e1a9f5139d5 100644 --- a/src/mame/misc/homedata.cpp +++ b/src/mame/misc/homedata.cpp @@ -235,6 +235,8 @@ Custom: GX61A01 #include "emu.h" #include "homedata.h" +#include "mahjong.h" + #include "cpu/m6809/m6809.h" #include "cpu/upd7810/upd7810.h" #include "cpu/z80/z80.h" @@ -263,13 +265,10 @@ uint8_t mrokumei_state::mrokumei_keyboard_r(offs_t offset) uint8_t res = 0x3f; // offset 0 is player 1, offset 1 player 2 (not supported) - if (offset == 0) + for (int i = 0; i < 5; i++) { - for (int i = 0; i < 5; i++) - { - if (BIT(m_keyb, i)) - res &= m_keys[i]->read() & 0x3f; - } + if (BIT(m_keyb, i)) + res &= m_keys[i + (offset * 5)]->read() & 0x3f; } if (offset == 0) @@ -662,45 +661,7 @@ static INPUT_PORTS_START( mjhokite ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - - PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_INCLUDE(mahjong_matrix_2p_ff) INPUT_PORTS_END static INPUT_PORTS_START( reikaids ) -- cgit v1.2.3