diff options
Diffstat (limited to 'src/mame/drivers/ojankohs.cpp')
-rw-r--r-- | src/mame/drivers/ojankohs.cpp | 1047 |
1 files changed, 473 insertions, 574 deletions
diff --git a/src/mame/drivers/ojankohs.cpp b/src/mame/drivers/ojankohs.cpp index 8b0590a2459..bde922fad3a 100644 --- a/src/mame/drivers/ojankohs.cpp +++ b/src/mame/drivers/ojankohs.cpp @@ -1,5 +1,5 @@ -// license:BSD-3-Clause -// copyright-holders:Takahiro Nogi, Uki +// license: BSD-3-Clause +// copyright-holders: Takahiro Nogi, Uki, Dirk Best /****************************************************************************** Game Driver for Video System Mahjong series. @@ -24,12 +24,8 @@ ****************************************************************************** -Memo: - -- Sometimes RAM check in testmode fails (reason unknown). - -- The method to get matrix key data may be incorrect. - 2player's input is not supported. + TODO: + - Figure out the rest of the dip switches ******************************************************************************/ @@ -102,95 +98,6 @@ WRITE8_MEMBER(ojankohs_state::ojankoc_ctrl_w) ojankoc_flipscreen(space, data); } -WRITE8_MEMBER(ojankohs_state::ojankohs_portselect_w) -{ - m_portselect = data; -} - -READ8_MEMBER(ojankohs_state::ojankohs_keymatrix_r) -{ - int ret; - - switch (m_portselect) - { - case 0x01: ret = ioport("KEY0")->read(); break; - case 0x02: ret = ioport("KEY1")->read(); break; - case 0x04: ret = ioport("KEY2")->read(); break; - case 0x08: ret = ioport("KEY3")->read(); break; - case 0x10: ret = ioport("KEY4")->read(); break; - case 0x20: ret = 0xff; break; - case 0x3f: ret = 0xff; - ret &= ioport("KEY0")->read(); - ret &= ioport("KEY1")->read(); - ret &= ioport("KEY2")->read(); - ret &= ioport("KEY3")->read(); - ret &= ioport("KEY4")->read(); - break; - default: ret = 0xff; - logerror("PC:%04X unknown %02X\n", space.device().safe_pc(), m_portselect); - break; - } - - return ret; -} - -READ8_MEMBER(ojankohs_state::ojankoc_keymatrix_r) -{ - int i; - int ret = 0; - static const char *const keynames[2][5] = - { - { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" }, - { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" } - }; - - for (i = 0; i < 5; i++) - { - if (!BIT(m_portselect, i)) - ret |= ioport(keynames[offset][i])->read(); - } - - return (ret & 0x3f) | (ioport(offset ? "IN1" : "IN0")->read() & 0xc0); -} - -READ8_MEMBER(ojankohs_state::ojankohs_ay8910_0_r) -{ - // DIPSW 1 - return (((ioport("DSW1")->read() & 0x01) << 7) | ((ioport("DSW1")->read() & 0x02) << 5) | - ((ioport("DSW1")->read() & 0x04) << 3) | ((ioport("DSW1")->read() & 0x08) << 1) | - ((ioport("DSW1")->read() & 0x10) >> 1) | ((ioport("DSW1")->read() & 0x20) >> 3) | - ((ioport("DSW1")->read() & 0x40) >> 5) | ((ioport("DSW1")->read() & 0x80) >> 7)); -} - -READ8_MEMBER(ojankohs_state::ojankohs_ay8910_1_r) -{ - // DIPSW 1 - return (((ioport("DSW2")->read() & 0x01) << 7) | ((ioport("DSW2")->read() & 0x02) << 5) | - ((ioport("DSW2")->read() & 0x04) << 3) | ((ioport("DSW2")->read() & 0x08) << 1) | - ((ioport("DSW2")->read() & 0x10) >> 1) | ((ioport("DSW2")->read() & 0x20) >> 3) | - ((ioport("DSW2")->read() & 0x40) >> 5) | ((ioport("DSW2")->read() & 0x80) >> 7)); -} - -READ8_MEMBER(ojankohs_state::ccasino_dipsw3_r) -{ - return (ioport("DSW3")->read() ^ 0xff); // DIPSW 3 -} - -READ8_MEMBER(ojankohs_state::ccasino_dipsw4_r) -{ - return (ioport("DSW4")->read() ^ 0xff); // DIPSW 4 -} - -WRITE8_MEMBER(ojankohs_state::ojankoy_coinctr_w) -{ - machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); -} - -WRITE8_MEMBER(ojankohs_state::ccasino_coinctr_w) -{ - machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); -} - static ADDRESS_MAP_START( ojankohs_map, AS_PROGRAM, 8, ojankohs_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM @@ -220,9 +127,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( ojankohs_io_map, AS_IO, 8, ojankohs_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(ojankohs_portselect_w) - AM_RANGE(0x01, 0x01) AM_READWRITE(ojankohs_keymatrix_r, ojankohs_rombank_w) - AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") AM_WRITE(ojankohs_gfxreg_w) + AM_RANGE(0x00, 0x00) AM_READ_PORT("system") AM_WRITE(port_select_w) + AM_RANGE(0x01, 0x01) AM_READWRITE(keymatrix_p1_r, ojankohs_rombank_w) + AM_RANGE(0x02, 0x02) AM_READWRITE(keymatrix_p2_r, ojankohs_gfxreg_w) AM_RANGE(0x03, 0x03) AM_WRITE(ojankohs_adpcm_reset_w) AM_RANGE(0x04, 0x04) AM_WRITE(ojankohs_flipscreen_w) AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w) @@ -233,9 +140,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( ojankoy_io_map, AS_IO, 8, ojankohs_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(ojankohs_portselect_w) - AM_RANGE(0x01, 0x01) AM_READWRITE(ojankohs_keymatrix_r, ojankoy_rombank_w) - AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") AM_WRITE(ojankoy_coinctr_w) + AM_RANGE(0x00, 0x00) AM_READ_PORT("system") AM_WRITE(port_select_w) + AM_RANGE(0x01, 0x01) AM_READWRITE(keymatrix_p1_r, ojankoy_rombank_w) + AM_RANGE(0x02, 0x02) AM_READWRITE(keymatrix_p2_r, ojankoy_coinctr_w) AM_RANGE(0x04, 0x04) AM_WRITE(ojankohs_flipscreen_w) AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w) AM_RANGE(0x06, 0x06) AM_DEVREAD("aysnd", ay8910_device, data_r) @@ -244,9 +151,9 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( ccasino_io_map, AS_IO, 8, ojankohs_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(ojankohs_portselect_w) - AM_RANGE(0x01, 0x01) AM_READWRITE(ojankohs_keymatrix_r, ojankohs_rombank_w) - AM_RANGE(0x02, 0x02) AM_READ_PORT("IN1") AM_WRITE(ccasino_coinctr_w) + AM_RANGE(0x00, 0x00) AM_READ_PORT("system") AM_WRITE(port_select_w) + AM_RANGE(0x01, 0x01) AM_READWRITE(keymatrix_p1_r, ojankohs_rombank_w) + AM_RANGE(0x02, 0x02) AM_READWRITE(keymatrix_p2_r, ccasino_coinctr_w) AM_RANGE(0x03, 0x03) AM_READ(ccasino_dipsw3_r) AM_WRITE(ojankohs_adpcm_reset_w) AM_RANGE(0x04, 0x04) AM_READ(ccasino_dipsw4_r) AM_WRITE(ojankohs_flipscreen_w) AM_RANGE(0x05, 0x05) AM_WRITE(ojankohs_msm5205_w) @@ -261,483 +168,475 @@ static ADDRESS_MAP_START( ojankoc_io_map, AS_IO, 8, ojankohs_state ) AM_RANGE(0x00, 0x1f) AM_WRITE(ojankoc_palette_w) AM_RANGE(0xf9, 0xf9) AM_WRITE(ojankohs_msm5205_w) AM_RANGE(0xfb, 0xfb) AM_WRITE(ojankoc_ctrl_w) - AM_RANGE(0xfc, 0xfd) AM_READ(ojankoc_keymatrix_r) - AM_RANGE(0xfd, 0xfd) AM_WRITE(ojankohs_portselect_w) + AM_RANGE(0xfc, 0xfc) AM_READ(ojankoc_keymatrix_p1_r) + AM_RANGE(0xfd, 0xfd) AM_READ(ojankoc_keymatrix_p2_r) + AM_RANGE(0xfd, 0xfd) AM_WRITE(port_select_w) AM_RANGE(0xfe, 0xff) AM_DEVWRITE("aysnd", ay8910_device, data_address_w) AM_RANGE(0xff, 0xff) AM_DEVREAD("aysnd", ay8910_device, data_r) ADDRESS_MAP_END -static INPUT_PORTS_START( mahjong_p1 ) - 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_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - 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_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - 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_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, 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_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) - - PORT_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) -INPUT_PORTS_END +//************************************************************************** +// INPUTS +//************************************************************************** static INPUT_PORTS_START( ojankohs ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER - PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW) // TEST - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0x07, "1 (Easy)" ) - PORT_DIPSETTING( 0x03, "2" ) - PORT_DIPSETTING( 0x05, "3" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPSETTING( 0x06, "5" ) - PORT_DIPSETTING( 0x02, "6" ) - PORT_DIPSETTING( 0x04, "7" ) - PORT_DIPSETTING( 0x00, "8 (Hard)" ) - PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Lives ) ) - PORT_DIPSETTING ( 0x20, "1" ) - PORT_DIPSETTING ( 0x00, "2" ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_DIPNAME( 0x02, 0x02, "Opponent's initial score" ) - PORT_DIPSETTING ( 0x02, "2000" ) - PORT_DIPSETTING ( 0x00, "3000" ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_INCLUDE( mahjong_p1 ) + PORT_START("system") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_SERVICE2) PORT_NAME("Freeze") + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MEMORY_RESET) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW) + PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("coin") + PORT_BIT(0x3f, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_COIN1) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p1_0") + 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_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p1_1") + 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_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p1_2") + 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_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p1_3") + 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_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p1_4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL) + PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p2_0") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_START2) + PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p2_1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET) PORT_PLAYER(2) + PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p2_2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p2_3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("p2_4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL) PORT_PLAYER(2) + PORT_BIT(0xc0, IP_ACTIVE_LOW, IPT_UNUSED) + + PORT_START("dsw1") + PORT_DIPNAME(0x07, 0x07, DEF_STR( Difficulty )) PORT_DIPLOCATION("DSW1:1,2,3") + PORT_DIPSETTING( 0x07, "1 (Easy)" ) + PORT_DIPSETTING( 0x03, "2" ) + PORT_DIPSETTING( 0x05, "3" ) + PORT_DIPSETTING( 0x01, "4" ) + PORT_DIPSETTING( 0x06, "5" ) + PORT_DIPSETTING( 0x02, "6" ) + PORT_DIPSETTING( 0x04, "7" ) + PORT_DIPSETTING( 0x00, "8 (Hard)" ) + PORT_DIPNAME(0x18, 0x18, DEF_STR( Coinage )) PORT_DIPLOCATION("DSW1:4,5") + PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C )) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C )) + PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C )) + PORT_DIPNAME(0x20, 0x20, DEF_STR( Lives )) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x20, "1") + PORT_DIPSETTING( 0x00, "2") + PORT_DIPNAME(0x40, 0x40, DEF_STR( Allow_Continue )) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x00, DEF_STR( No )) + PORT_DIPSETTING( 0x40, DEF_STR( Yes )) + PORT_DIPNAME(0x80, 0x80, DEF_STR( Flip_Screen )) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off )) + PORT_DIPSETTING( 0x00, DEF_STR( On )) + + PORT_START("dsw2") + PORT_DIPUNKNOWN_DIPLOC(0x01, IP_ACTIVE_LOW, "DSW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, IP_ACTIVE_LOW, "DSW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, IP_ACTIVE_LOW, "DSW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, IP_ACTIVE_LOW, "DSW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, IP_ACTIVE_LOW, "DSW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, IP_ACTIVE_LOW, "DSW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, IP_ACTIVE_LOW, "DSW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, IP_ACTIVE_LOW, "DSW2:8") INPUT_PORTS_END static INPUT_PORTS_START( ojankoy ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER - PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW) // TEST - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0x07, "1 (Easy)" ) - PORT_DIPSETTING( 0x03, "2" ) - PORT_DIPSETTING( 0x05, "3" ) - PORT_DIPSETTING( 0x01, "4" ) - PORT_DIPSETTING( 0x06, "5" ) - PORT_DIPSETTING( 0x02, "6" ) - PORT_DIPSETTING( 0x04, "7" ) - PORT_DIPSETTING( 0x00, "8 (Hard)" ) - PORT_DIPNAME( 0x18, 0x18, "Player's initial score" ) - PORT_DIPSETTING( 0x18, "1000" ) - PORT_DIPSETTING( 0x08, "2000" ) - PORT_DIPSETTING( 0x10, "3000" ) - PORT_DIPSETTING( 0x00, "5000" ) - PORT_DIPNAME( 0x60, 0x60, "Noten penalty after ryukyoku" ) - PORT_DIPSETTING( 0x60, "1000" ) - PORT_DIPSETTING( 0x20, "2000" ) - PORT_DIPSETTING( 0x40, "3000" ) - PORT_DIPSETTING( 0x00, "5000" ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x03, 0x02, "Number of ending chance" ) - PORT_DIPSETTING( 0x03, "0" ) - PORT_DIPSETTING( 0x01, "3" ) - PORT_DIPSETTING( 0x02, "5" ) - PORT_DIPSETTING( 0x00, "10" ) - PORT_DIPNAME( 0x04, 0x04, "Ending chance requires fee" ) - PORT_DIPSETTING ( 0x04, DEF_STR( No ) ) - PORT_DIPSETTING ( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) ) - PORT_DIPNAME( 0x60, 0x60, "Opponent's initial score" ) - PORT_DIPSETTING ( 0x60, "3000 - 8000" ) - PORT_DIPSETTING ( 0x20, "5000 - 10000" ) - PORT_DIPSETTING ( 0x40, "8000" ) - PORT_DIPSETTING ( 0x00, "10000" ) - PORT_DIPNAME( 0x80, 0x00, "Gal select / Continue" ) - PORT_DIPSETTING( 0x80, "Yes / No" ) - PORT_DIPSETTING( 0x00, "No / Yes" ) - - PORT_INCLUDE( mahjong_p1 ) + PORT_INCLUDE(ojankohs) + + PORT_MODIFY("system") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE1) PORT_NAME("Statistics") + + PORT_MODIFY("dsw1") + PORT_DIPNAME(0x07, 0x07, DEF_STR( Difficulty )) + PORT_DIPSETTING( 0x07, "1 (Easy)") + PORT_DIPSETTING( 0x03, "2") + PORT_DIPSETTING( 0x05, "3") + PORT_DIPSETTING( 0x01, "4") + PORT_DIPSETTING( 0x06, "5") + PORT_DIPSETTING( 0x02, "6") + PORT_DIPSETTING( 0x04, "7") + PORT_DIPSETTING( 0x00, "8 (Hard)") + PORT_DIPNAME(0x18, 0x18, "Player Initial Score") + PORT_DIPSETTING( 0x18, "1000") + PORT_DIPSETTING( 0x08, "2000") + PORT_DIPSETTING( 0x10, "3000") + PORT_DIPSETTING( 0x00, "5000") + PORT_DIPNAME(0x60, 0x60, "Noten penalty after ryukyoku") + PORT_DIPSETTING( 0x60, "1000") + PORT_DIPSETTING( 0x20, "2000") + PORT_DIPSETTING( 0x40, "3000") + PORT_DIPSETTING( 0x00, "5000") + PORT_DIPNAME(0x80, 0x80, DEF_STR( Flip_Screen )) + PORT_DIPSETTING( 0x80, DEF_STR( Off )) + PORT_DIPSETTING( 0x00, DEF_STR( On )) + + PORT_MODIFY("dsw2") + PORT_DIPNAME(0x03, 0x02, "Number of ending chance") + PORT_DIPSETTING( 0x03, "0") + PORT_DIPSETTING( 0x01, "3") + PORT_DIPSETTING( 0x02, "5") + PORT_DIPSETTING( 0x00, "10") + PORT_DIPNAME(0x04, 0x04, "Ending chance requires fee") + PORT_DIPSETTING( 0x04, DEF_STR( No )) + PORT_DIPSETTING( 0x00, DEF_STR( Yes )) + PORT_DIPNAME(0x18, 0x18, DEF_STR( Coinage )) + PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C )) + PORT_DIPSETTING( 0x18, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x10, DEF_STR( 1C_2C )) + PORT_DIPSETTING( 0x00, DEF_STR( Free_Play )) + PORT_DIPNAME(0x60, 0x60, "Opponent Initial Score") + PORT_DIPSETTING( 0x60, "3000 - 8000") + PORT_DIPSETTING( 0x20, "5000 - 10000") + PORT_DIPSETTING( 0x40, "8000") + PORT_DIPSETTING( 0x00, "10000") + PORT_DIPNAME(0x80, 0x00, "Gal select / Continue") + PORT_DIPSETTING( 0x80, "Yes / No") + PORT_DIPSETTING( 0x00, "No / Yes") INPUT_PORTS_END static INPUT_PORTS_START( ccasino ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) // MEMORY RESET - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) // ANALYZER - PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW) // TEST - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // COIN1 - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, "DIPSW 1-1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "DIPSW 1-2" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "DIPSW 1-3" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "DIPSW 1-4" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "DIPSW 1-5" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "DIPSW 1-6" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "DIPSW 1-7" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "DIPSW 1-8" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "DIPSW 2-1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "DIPSW 2-2" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "DIPSW 2-3" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "DIPSW 2-4" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "DIPSW 2-5" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "DIPSW 2-6" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "DIPSW 2-7" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "DIPSW 2-8" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_INCLUDE( mahjong_p1 ) - - PORT_START("DSW3") - PORT_DIPNAME( 0x01, 0x01, "DIPSW 3-1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "DIPSW 3-2" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "DIPSW 3-3" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "DIPSW 3-4" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "DIPSW 3-5" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "DIPSW 3-6" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "DIPSW 3-7" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "DIPSW 3-8" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("DSW4") - PORT_DIPNAME( 0x01, 0x01, "DIPSW 4-1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "DIPSW 4-2" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "DIPSW 4-3" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "DIPSW 4-4" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "DIPSW 4-5" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "DIPSW 4-6" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "DIPSW 4-7" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "DIPSW 4-8" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_INCLUDE(ojankohs) + + PORT_MODIFY("system") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_COIN2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_SERVICE1) PORT_NAME("Statistics") + + PORT_MODIFY("dsw1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW1:8") + + PORT_MODIFY("dsw2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW2:3") + PORT_DIPNAME(0x18, 0x18, "Girl Select") PORT_DIPLOCATION("DSW2:4,5") + PORT_DIPSETTING(0x18, "A/B/C") + PORT_DIPSETTING(0x10, "A") + PORT_DIPSETTING(0x08, "B") + PORT_DIPSETTING(0x00, "C") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW2:8") + + PORT_START("dsw3") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW3:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW3:2") + PORT_DIPNAME(0x04, 0x04, "Score Display" ) PORT_DIPLOCATION("DSW3:3") + PORT_DIPSETTING( 0x04, "Normal") + PORT_DIPSETTING( 0x00, "* 1000") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW3:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW3:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW3:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW3:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW3:8") + + PORT_START("dsw4") + PORT_DIPNAME(0x01, 0x01, DEF_STR( Coin_B )) PORT_DIPLOCATION("DSW4:1") + PORT_DIPSETTING( 0x01, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x00, "1 Coin/20 Credits" ) + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW4:2") + PORT_DIPNAME(0x0c, 0x0c, DEF_STR( Coin_A )) PORT_DIPLOCATION("DSW4:3,4") + PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C )) + PORT_DIPSETTING( 0x08, DEF_STR( 1C_5C )) + PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C )) + PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C )) + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW4:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW4:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW4:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW4:8") INPUT_PORTS_END static INPUT_PORTS_START( ojankoc ) - PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "1-2" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "1-3" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "1-4" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "1-5" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "1-6" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "1-7" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) - - PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "2-1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, "2-2" ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "2-3" ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "2-4" ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "2-5" ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, "2-6" ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, "2-7" ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "2-8" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("KEY0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("KEY1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_BET ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("KEY2") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("KEY3") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("KEY4") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_FLIP_FLOP ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_BIG ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_SMALL ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("KEY5") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START2 ) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("KEY6") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_BET ) PORT_PLAYER(2) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("KEY7") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("KEY8") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("KEY9") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_BIG ) PORT_PLAYER(2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_SMALL ) PORT_PLAYER(2) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED ) - - PORT_START("IN0") - PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - - PORT_START("IN1") - PORT_BIT( 0x3f, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN1 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_START("coin") + PORT_BIT(0x3f, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN1) + PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p1_0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_START1) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p1_1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p1_2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p1_3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p2_0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_A) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_E) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_I) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_START2) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p2_1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_B) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_F) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_J) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_N) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p2_2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_C) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_K) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_RON) PORT_PLAYER(2) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("p2_3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_D) PORT_PLAYER(2) + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_H) PORT_PLAYER(2) + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_L) PORT_PLAYER(2) + PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_PON) PORT_PLAYER(2) + PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) + PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED) + + PORT_START("dsw1") + PORT_DIPNAME(0x01, 0x01, DEF_STR( Flip_Screen )) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off )) + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPNAME(0x06, 0x06, "Player Initial Score") PORT_DIPLOCATION("DSW1:2,3") + PORT_DIPSETTING( 0x06, "1000") + PORT_DIPSETTING( 0x04, "2000") + PORT_DIPSETTING( 0x02, "3000") + PORT_DIPSETTING( 0x00, "5000") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW1:7") + PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "DSW1:8") + + PORT_START("dsw2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "DSW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "DSW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "DSW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "DSW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "DSW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "DSW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "DSW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "DSW2:8") INPUT_PORTS_END +//************************************************************************** +// INPUT PORT HANDLING +//************************************************************************** + +WRITE8_MEMBER( ojankohs_state::port_select_w ) +{ + m_port_select = data; +} + +READ8_MEMBER( ojankohs_state::keymatrix_p1_r ) +{ + uint8_t data = 0xff; + + if (BIT(m_port_select, 0)) data &= ioport("p1_0")->read(); + if (BIT(m_port_select, 1)) data &= ioport("p1_1")->read(); + if (BIT(m_port_select, 2)) data &= ioport("p1_2")->read(); + if (BIT(m_port_select, 3)) data &= ioport("p1_3")->read(); + if (BIT(m_port_select, 4)) data &= ioport("p1_4")->read(); + + data &= ioport("coin")->read(); + + return data; +} + +READ8_MEMBER( ojankohs_state::keymatrix_p2_r ) +{ + uint8_t data = 0xff; + + if (BIT(m_port_select, 0)) data &= ioport("p2_0")->read(); + if (BIT(m_port_select, 1)) data &= ioport("p2_1")->read(); + if (BIT(m_port_select, 2)) data &= ioport("p2_2")->read(); + if (BIT(m_port_select, 3)) data &= ioport("p2_3")->read(); + if (BIT(m_port_select, 4)) data &= ioport("p2_4")->read(); + + data &= ioport("coin")->read(); + + return data; +} + +READ8_MEMBER( ojankohs_state::ojankoc_keymatrix_p1_r ) +{ + uint8_t data = 0x00; + + if (BIT(m_port_select, 0) == 0) data |= ioport("p1_0")->read(); + if (BIT(m_port_select, 1) == 0) data |= ioport("p1_1")->read(); + if (BIT(m_port_select, 2) == 0) data |= ioport("p1_2")->read(); + if (BIT(m_port_select, 3) == 0) data |= ioport("p1_3")->read(); + + data |= ioport("coin")->read(); + + return data; +} + +READ8_MEMBER( ojankohs_state::ojankoc_keymatrix_p2_r ) +{ + uint8_t data = 0x00; + + if (BIT(m_port_select, 0) == 0) data |= ioport("p2_0")->read(); + if (BIT(m_port_select, 1) == 0) data |= ioport("p2_1")->read(); + if (BIT(m_port_select, 2) == 0) data |= ioport("p2_2")->read(); + if (BIT(m_port_select, 3) == 0) data |= ioport("p2_3")->read(); + + data |= ioport("coin")->read(); + + return data; +} + +READ8_MEMBER( ojankohs_state::ojankohs_dipsw1_r ) +{ + uint8_t data = ioport("dsw1")->read(); + return BITSWAP8(data, 0, 1, 2, 3, 4, 5, 6, 7); +} + +READ8_MEMBER( ojankohs_state::ojankohs_dipsw2_r ) +{ + uint8_t data = ioport("dsw2")->read(); + return BITSWAP8(data, 0, 1, 2, 3, 4, 5, 6, 7); +} + +READ8_MEMBER( ojankohs_state::ccasino_dipsw3_r ) +{ + return ioport("dsw3")->read() ^ 0xff; +} + +READ8_MEMBER( ojankohs_state::ccasino_dipsw4_r ) +{ + return ioport("dsw4")->read() ^ 0xff; +} + +WRITE8_MEMBER( ojankohs_state::ojankoy_coinctr_w ) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); +} + +WRITE8_MEMBER( ojankohs_state::ccasino_coinctr_w ) +{ + machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); +} + + static const gfx_layout ojankohs_bglayout = { 8, 4, @@ -761,7 +660,7 @@ MACHINE_START_MEMBER(ojankohs_state,common) save_item(NAME(m_scrollx)); save_item(NAME(m_scrolly)); save_item(NAME(m_screen_refresh)); - save_item(NAME(m_portselect)); + save_item(NAME(m_port_select)); save_item(NAME(m_adpcm_reset)); save_item(NAME(m_adpcm_data)); save_item(NAME(m_vclk_left)); @@ -796,7 +695,7 @@ MACHINE_START_MEMBER(ojankohs_state,ojankoc) void ojankohs_state::machine_reset() { - m_portselect = 0; + m_port_select = 0; m_adpcm_reset = 0; m_adpcm_data = 0; @@ -841,8 +740,8 @@ static MACHINE_CONFIG_START( ojankohs ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("aysnd", AY8910, 12000000/6) - MCFG_AY8910_PORT_A_READ_CB(READ8(ojankohs_state, ojankohs_ay8910_0_r)) /* read port #0 */ - MCFG_AY8910_PORT_B_READ_CB(READ8(ojankohs_state, ojankohs_ay8910_1_r)) /* read port #1 */ + MCFG_AY8910_PORT_A_READ_CB(READ8(ojankohs_state, ojankohs_dipsw1_r)) + MCFG_AY8910_PORT_B_READ_CB(READ8(ojankohs_state, ojankohs_dipsw2_r)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) MCFG_SOUND_ADD("msm", MSM5205, 384000) @@ -881,8 +780,8 @@ static MACHINE_CONFIG_START( ojankoy ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("aysnd", AY8910, 12000000/8) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("dsw1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("dsw2")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) MCFG_SOUND_ADD("msm", MSM5205, 384000) @@ -922,8 +821,8 @@ static MACHINE_CONFIG_START( ccasino ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("aysnd", AY8910, 12000000/8) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("dsw1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("dsw2")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) MCFG_SOUND_ADD("msm", MSM5205, 384000) @@ -960,8 +859,8 @@ static MACHINE_CONFIG_START( ojankoc ) MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("aysnd", AY8910, 8000000/4) - MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) - MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) + MCFG_AY8910_PORT_A_READ_CB(IOPORT("dsw1")) + MCFG_AY8910_PORT_B_READ_CB(IOPORT("dsw2")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15) MCFG_SOUND_ADD("msm", MSM5205, 8000000/22) |