Skip to content

Commit

Permalink
hgokou: Use standard hanafuda panel input matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrhacker committed Dec 1, 2024
1 parent 31bd17e commit 590f70e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 79 deletions.
80 changes: 1 addition & 79 deletions src/mame/dynax/ddenlovr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7726,85 +7726,7 @@ static INPUT_PORTS_START( hgokou )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_START("KEY0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // I
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) // Kan
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1)

PORT_START("KEY1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // J
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) // Reach
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // BET

PORT_START("KEY2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // G
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // K
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) // Chi
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Ron
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_START("KEY3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // H
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // L
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) // 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 ) // "t"
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "w"
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "b"
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "s"

PORT_START("KEY5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // I
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_YES ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) // Kan
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2)

PORT_START("KEY6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // J
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_HANAFUDA_NO ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // Reach
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // BET

PORT_START("KEY7")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_PLAYER(2) // G
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // K
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_PLAYER(2) // Chi
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Ron
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_START("KEY8")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_PLAYER(2) // H
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // L
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) // PON
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_START("KEY9")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "t"
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "w"
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "b"
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // "s"
PORT_INCLUDE( dynax_hanafuda_6keys_bet )

// Note the PCB has 4x 10-position DIP switches and SW5 is a 4-position DIP switch.
// SW5 is used to select either the Mahjong edge connector, or the 18/10 Edge connectors (i.e. emulation of SW5 is not required)
Expand Down
16 changes: 16 additions & 0 deletions src/mame/dynax/dynax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,22 @@ INPUT_PORTS_START( dynax_hanafuda_keys_bet )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) // "s"
INPUT_PORTS_END

INPUT_PORTS_START( dynax_hanafuda_6keys_bet )
PORT_INCLUDE( dynax_hanafuda_keys_bet )

PORT_MODIFY("KEY2")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_MODIFY("KEY3")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_MODIFY("KEY6")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )

PORT_MODIFY("KEY7")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END

#if 0
[[maybe_unused]] static INPUT_PORTS_START( HANAFUDA_KEYS_BET_ALT )
PORT_INCLUDE( dynax_hanafuda_keys )
Expand Down
1 change: 1 addition & 0 deletions src/mame/dynax/dynax.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,5 +462,6 @@ class cdracula_state : public dynax_state
INPUT_PORTS_EXTERN(dynax_mahjong_keys);
INPUT_PORTS_EXTERN(dynax_mahjong_keys_bet);
INPUT_PORTS_EXTERN(dynax_hanafuda_keys_bet);
INPUT_PORTS_EXTERN(dynax_hanafuda_6keys_bet);

#endif // MAME_DYNAX_DYNAX_H

1 comment on commit 590f70e

@cuavas
Copy link
Member

@cuavas cuavas commented on 590f70e Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you actually manage to finish a game that you won? I tried that, but Double Up and Take Score didn't seem to work.

Also the same input port definitions are used for hgokbang, which seems to want different controls to hgokou. The DIP switche labels seem to be closer to hgokbang than hgokou, but still not right.

As an aside, I dont think any Dynax medal hanafuda games use eight-card hands - they all use six-card hands. The ones that use eight-card hands aren't medal games.

Please sign in to comment.