-seta/ssv.cpp: Better effort at using common mahjong matrix.

-dynax/ddenlovr.cpp: Demoted Hanafuda Hana Gokou and Hanafuda Gokou
 Bangaihen to not working - neither of these games works properly.
This commit is contained in:
Vas Crabb 2024-12-03 13:25:43 +11:00
parent bfb725374d
commit 7e5b31e25f
2 changed files with 29 additions and 111 deletions

View File

@ -643,12 +643,12 @@ uint16_t ssv_state::srmp4_input_r()
{
const uint16_t input_sel = *m_input_sel;
uint16_t result = 0xffff;
if (BIT(input_sel, 1)) result &= m_io_key[0]->read();
if (BIT(input_sel, 2)) result &= m_io_key[1]->read();
if (BIT(input_sel, 3)) result &= m_io_key[2]->read();
if (BIT(input_sel, 4)) result &= m_io_key[3]->read();
return result;
uint16_t result = 0x3f;
if (BIT(input_sel, 1)) result &= m_io_key[3]->read();
if (BIT(input_sel, 2)) result &= m_io_key[2]->read();
if (BIT(input_sel, 3)) result &= m_io_key[1]->read();
if (BIT(input_sel, 4)) result &= m_io_key[0]->read();
return bitswap<6>(result, 0, 1, 2, 3, 4, 5) | 0xffc0;
}
void ssv_state::srmp4_map(address_map &map)
@ -666,6 +666,18 @@ void ssv_state::srmp4_map(address_map &map)
Super Real Mahjong P7
***************************************************************************/
uint16_t ssv_state::srmp7_input_r()
{
const uint16_t input_sel = *m_input_sel;
uint16_t result = 0x3f;
if (BIT(input_sel, 1)) result &= m_io_key[2]->read();
if (BIT(input_sel, 2)) result &= m_io_key[1]->read();
if (BIT(input_sel, 3)) result &= m_io_key[0]->read();
if (BIT(input_sel, 4)) result &= m_io_key[3]->read();
return bitswap<6>(result, 0, 1, 2, 3, 4, 5) | 0x00c0;
}
/*
Interrupts aren't supported by the chip emulator yet
(lev 5 in this case, I guess)
@ -695,7 +707,7 @@ void ssv_state::srmp7_map(address_map &map)
map(0x300076, 0x300077).r(FUNC(ssv_state::srmp7_irqv_r)); // Sound
// 0x540000, 0x540003, related to lev 5 irq?
map(0x580000, 0x580001).w(FUNC(ssv_state::srmp7_sound_bank_w)); // Sound Bank
map(0x600000, 0x600001).r(FUNC(ssv_state::srmp4_input_r)); // Inputs
map(0x600000, 0x600001).r(FUNC(ssv_state::srmp7_input_r)); // Inputs
map(0x680000, 0x680001).writeonly().share(m_input_sel); // Inputs
}
@ -1022,7 +1034,7 @@ static INPUT_PORTS_START( ssv_mahjong )
PORT_INCLUDE(ssv_joystick)
PORT_INCLUDE(mahjong_matrix_1p) // IN5-IN8 - $800002
PORT_MODIFY("KEY2")
PORT_MODIFY("KEY1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) // uses bet button, but not the rest of the gambling controls
INPUT_PORTS_END
@ -1439,38 +1451,9 @@ static INPUT_PORTS_START( hypreact )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x00f0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY0") // IN5 - $c00000(0)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1") // IN6 - $c00000(1)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2") // IN7 - $c00000(2)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY3") // IN8 - $c00000(3)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_INCLUDE(mahjong_matrix_1p) // IN5-IN8 - $c00000
PORT_MODIFY("KEY1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) // uses bet button, but not the rest of the gambling controls
INPUT_PORTS_END
@ -1514,37 +1497,7 @@ static INPUT_PORTS_START( hypreac2 )
PORT_DIPSETTING( 0x0000, "MASTER" )
PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "DSWB:8" )
PORT_START("KEY0") // IN5 - $500000(0)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0xffc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1") // IN6 - $500000(1)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2") // IN7 - $500000(2)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_C )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0xffe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY3") // IN8 - $500000(3)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_D )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0xfff0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_INCLUDE(mahjong_matrix_1p) // IN5-IN8 - $c00000
INPUT_PORTS_END
@ -1600,7 +1553,9 @@ INPUT_PORTS_END
***************************************************************************/
static INPUT_PORTS_START( janjans2 )
PORT_INCLUDE(ssv_mahjong)
PORT_INCLUDE(ssv_joystick)
PORT_INCLUDE(mahjong_matrix_1p) // IN5-IN8 - $800002
PORT_MODIFY("DSW1") // IN0 - $210002
PORT_DIPUNKNOWN_DIPLOC( 0x0001, 0x0001, "DSW1:1" )
@ -2021,45 +1976,7 @@ static INPUT_PORTS_START( srmp7 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested
PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY0") // IN6 - $600000(0)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_C )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1") // IN7 - $600000(1)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2") // IN8 - $600000(2)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY3") // IN5 - $600000(3)
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_D )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_INCLUDE(mahjong_matrix_1p) // IN5-IN8 - $800002
INPUT_PORTS_END

View File

@ -75,6 +75,7 @@ protected:
uint16_t mainram_r(offs_t offset);
void mainram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t srmp4_input_r();
uint16_t srmp7_input_r();
uint16_t srmp7_irqv_r();
void srmp7_sound_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint32_t latch32_r(offs_t offset);