summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2018-01-28 18:34:14 +0100
committer Dirk Best <mail@dirk-best.de>2018-01-28 18:35:03 +0100
commitfe8e8d5c7c1076ac7113fe1e9cf5bd7086d1855e (patch)
tree9d72bc07e45d927d4a1997e5d3799bfb7acc8e7b
parentf9acab9688c0ea21a96a0ce547bff9c5a2cd368d (diff)
namcos1: Use LS157 device for dip switches, correct order of switches
-rw-r--r--src/mame/drivers/namcos1.cpp241
-rw-r--r--src/mame/includes/namcos1.h6
2 files changed, 130 insertions, 117 deletions
diff --git a/src/mame/drivers/namcos1.cpp b/src/mame/drivers/namcos1.cpp
index eca5feff204..148b3daa089 100644
--- a/src/mame/drivers/namcos1.cpp
+++ b/src/mame/drivers/namcos1.cpp
@@ -362,9 +362,16 @@ WRITE8_MEMBER(namcos1_state::mcu_irq_ack_w)
READ8_MEMBER(namcos1_state::dsw_r)
{
- int ret = m_io_dipsw->read();
- if (!(offset & 2)) ret >>= 4;
- return 0xf0 | ret;
+ // 7654---- not used
+ // ----3--- ls257 dsw selector 1y
+ // -----2-- ls257 dsw selector 2y
+ // ------1- ls257 dsw selector 3y
+ // -------0 ls257 dsw selector 4y
+
+ m_dsw_sel->ba_w(m_io_dipsw->read());
+ m_dsw_sel->select_w(BIT(offset, 1));
+
+ return 0xf0 | bitswap<4>(m_dsw_sel->output_r(space, 0), 0, 1, 2, 3);
}
WRITE8_MEMBER(namcos1_state::coin_w)
@@ -469,14 +476,14 @@ static INPUT_PORTS_START( ns1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START( "DIPSW" )
- PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW:1" )
- PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW:2" )
- PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW:3" )
- PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW:4" )
- PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW:5" )
- PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW:6" )
- PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW:7" )
- PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW:8" )
+ PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW:1" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW:2" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW:3" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x08, IP_ACTIVE_LOW, "SW:4" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW:5" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW:6" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW:7" )
+ PORT_DIPUNKNOWN_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW:8" )
PORT_START( "COIN" )
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* OUT:coin lockout */
@@ -495,11 +502,11 @@ static INPUT_PORTS_START( shadowld )
PORT_INCLUDE( ns1 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x40, 0x40, "Freeze" ) PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, "Alternate sound effects" ) PORT_DIPLOCATION("SW:3") // e.g. the red bird
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x04, 0x04, "Alternate sound effects" ) PORT_DIPLOCATION("SW:3") // e.g. the red bird
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -509,30 +516,30 @@ static INPUT_PORTS_START( dspirit )
PORT_MODIFY( "DIPSW" )
#ifdef PRIORITY_EASINESS_TO_PLAY
- PORT_DIPNAME( 0x7f, 0x7f, "Life" ) PORT_DIPLOCATION("SW:8,7,6,5,4,3,2")
- PORT_DIPSETTING( 0x7f, "2" )
- PORT_DIPSETTING( 0x16, "3" )
+ PORT_DIPNAME( 0xfe, 0xfe, "Life" ) PORT_DIPLOCATION("SW:2,3,4,5,6,7,8")
+ PORT_DIPSETTING( 0xfe, "2" )
+ PORT_DIPSETTING( 0x68, "3" )
#else
- PORT_DIPNAME( 0x40, 0x40, "Open 3rd Life (step1of7)" ) PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, "No (off)" )
+ PORT_DIPNAME( 0x02, 0x02, "Open 3rd Life (step1of7)" ) PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, "No (off)" )
PORT_DIPSETTING( 0x00, "Yes (on)" )
- PORT_DIPNAME( 0x20, 0x20, "Open 3rd Life (step2of7)" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, "No (off)" )
+ PORT_DIPNAME( 0x04, 0x04, "Open 3rd Life (step2of7)" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, "No (off)" )
PORT_DIPSETTING( 0x00, "Yes (on)" )
- PORT_DIPNAME( 0x10, 0x10, "Open 3rd Life (step3of7)" ) PORT_DIPLOCATION("SW:4")
- PORT_DIPSETTING( 0x10, "Yes (off)" )
+ PORT_DIPNAME( 0x08, 0x08, "Open 3rd Life (step3of7)" ) PORT_DIPLOCATION("SW:4")
+ PORT_DIPSETTING( 0x08, "Yes (off)" )
PORT_DIPSETTING( 0x00, "No (on)" )
- PORT_DIPNAME( 0x08, 0x08, "Open 3rd Life (step4of7)" ) PORT_DIPLOCATION("SW:5")
- PORT_DIPSETTING( 0x08, "No (off)" )
+ PORT_DIPNAME( 0x10, 0x10, "Open 3rd Life (step4of7)" ) PORT_DIPLOCATION("SW:5")
+ PORT_DIPSETTING( 0x10, "No (off)" )
PORT_DIPSETTING( 0x00, "Yes (on)" )
- PORT_DIPNAME( 0x04, 0x04, "Open 3rd Life (step5of7)" ) PORT_DIPLOCATION("SW:6")
- PORT_DIPSETTING( 0x04, "Yes (off)" )
+ PORT_DIPNAME( 0x20, 0x20, "Open 3rd Life (step5of7)" ) PORT_DIPLOCATION("SW:6")
+ PORT_DIPSETTING( 0x20, "Yes (off)" )
PORT_DIPSETTING( 0x00, "No (on)" )
- PORT_DIPNAME( 0x02, 0x02, "Open 3rd Life (step6of7)" ) PORT_DIPLOCATION("SW:7")
- PORT_DIPSETTING( 0x02, "Yes (off)" )
+ PORT_DIPNAME( 0x40, 0x40, "Open 3rd Life (step6of7)" ) PORT_DIPLOCATION("SW:7")
+ PORT_DIPSETTING( 0x40, "Yes (off)" )
PORT_DIPSETTING( 0x00, "No (on)" )
- PORT_DIPNAME( 0x01, 0x01, "Open 3rd Life (step7of7)" ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, "No (off)" )
+ PORT_DIPNAME( 0x80, 0x80, "Open 3rd Life (step7of7)" ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, "No (off)" )
PORT_DIPSETTING( 0x00, "Yes (on)" )
// Allow "Open 3rd Life" = _ooxoxxo
// 12345678
@@ -558,17 +565,17 @@ static INPUT_PORTS_START( quester )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x40, 0x40, "Unk 1" ) PORT_DIPLOCATION("SW:2") // read @ fac7
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x02, 0x02, "Unk 1" ) PORT_DIPLOCATION("SW:2") // read @ fac7
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, "Freeze" ) PORT_DIPLOCATION("SW:4")
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("SW:4")
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x04, 0x00, "Brightness" ) PORT_DIPLOCATION("SW:6")
- PORT_DIPSETTING( 0x04, DEF_STR( Low ) )
+ PORT_DIPNAME( 0x20, 0x00, "Brightness" ) PORT_DIPLOCATION("SW:6")
+ PORT_DIPSETTING( 0x20, DEF_STR( Low ) )
PORT_DIPSETTING( 0x00, DEF_STR( Normal ) )
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x80, 0x80, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START( "PADDLE0" ) /* fake input port for player 1 paddle */
@@ -639,16 +646,16 @@ static INPUT_PORTS_START( pacmania )
PORT_INCLUDE( ns1 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x40, 0x40, "Freeze" ) PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* this doesn't seem to have much use... */
- PORT_DIPNAME( 0x20, 0x20, "Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, DEF_STR( No ) )
+ PORT_DIPNAME( 0x04, 0x04, "Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
/* to enter the A.D.S. menu, set the dip switch and reset with service coin pressed */
- PORT_DIPNAME( 0x08, 0x08, "Auto Data Sampling" ) PORT_DIPLOCATION("SW:5")
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x10, 0x10, "Auto Data Sampling" ) PORT_DIPLOCATION("SW:5")
+ PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -662,11 +669,11 @@ static INPUT_PORTS_START( galaga88 )
PORT_DIPSETTING( 0x28, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
#else
- PORT_DIPNAME( 0x20, 0x20, "Auto Data Sampling (step1of2)" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x04, 0x04, "Auto Data Sampling (step1of2)" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, "Auto Data Sampling (step2of2)" ) PORT_DIPLOCATION("SW:5")
- PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x10, 0x10, "Auto Data Sampling (step2of2)" ) PORT_DIPLOCATION("SW:5")
+ PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
// Allow "Auto Data Sampling" = __o_o___
// 12345678
@@ -684,11 +691,11 @@ static INPUT_PORTS_START( berabohm )
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_SPECIAL ) /* timing from the buttons interface */
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x20, 0x20, "Invulnerability" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x04, 0x04, "Invulnerability" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x01, 0x01, "Freeze" ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
#ifdef PRESSURE_SENSITIVE
@@ -749,11 +756,11 @@ static INPUT_PORTS_START( mmaze )
PORT_INCLUDE( ns1 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x10, 0x10, "Freeze" ) PORT_DIPLOCATION("SW:4")
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("SW:4")
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x01, 0x01, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x80, 0x80, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -762,20 +769,20 @@ static INPUT_PORTS_START( bakutotu )
PORT_INCLUDE( ns1 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x40, 0x40, "Invincibility (Cheat)") PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x20, 0x20, "Show Coordinates" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x02, 0x02, "Invincibility (Cheat)") PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x10, 0x10, "Level Selection" ) PORT_DIPLOCATION("SW:4")
- PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x04, 0x04, "Show Coordinates" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x08, 0x08, "Sprite Viewer" ) PORT_DIPLOCATION("SW:5")
+ PORT_DIPNAME( 0x08, 0x08, "Level Selection" ) PORT_DIPLOCATION("SW:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x01, 0x01, "Freeze" ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x10, 0x10, "Sprite Viewer" ) PORT_DIPLOCATION("SW:5")
+ PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -786,33 +793,33 @@ static INPUT_PORTS_START( wldcourt )
PORT_MODIFY( "DIPSW" )
#ifdef PRIORITY_EASINESS_TO_PLAY
/* see code @ e331. The lines this draws can't even be seen because they are erased afterwards */
- PORT_DIPNAME( 0x7e, 0x7e, "Draw Debug Lines" ) PORT_DIPLOCATION("SW:7,6,5,4,3,2")
+ PORT_DIPNAME( 0x7e, 0x7e, "Draw Debug Lines" ) PORT_DIPLOCATION("SW:2,3,4,5,6,7")
PORT_DIPSETTING( 0x7e, DEF_STR( Off ) )
- PORT_DIPSETTING( 0x5c, DEF_STR( On ) )
+ PORT_DIPSETTING( 0x3a, DEF_STR( On ) )
#else
- PORT_DIPNAME( 0x40, 0x40, "Draw Debug Lines (step1of6)" ) PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, "Yes (off)" )
+ PORT_DIPNAME( 0x02, 0x02, "Draw Debug Lines (step1of6)" ) PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, "Yes (off)" )
PORT_DIPSETTING( 0x00, "No (on)" )
- PORT_DIPNAME( 0x20, 0x20, "Draw Debug Lines (step2of6)" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, "No (off)" )
+ PORT_DIPNAME( 0x04, 0x04, "Draw Debug Lines (step2of6)" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, "No (off)" )
PORT_DIPSETTING( 0x00, "Yes (on)" )
- PORT_DIPNAME( 0x10, 0x10, "Draw Debug Lines (step3of6)" ) PORT_DIPLOCATION("SW:4")
- PORT_DIPSETTING( 0x10, "Yes (off)" )
- PORT_DIPSETTING( 0x00, "No (on)" )
- PORT_DIPNAME( 0x08, 0x08, "Draw Debug Lines (step4of6)" ) PORT_DIPLOCATION("SW:5")
+ PORT_DIPNAME( 0x08, 0x08, "Draw Debug Lines (step3of6)" ) PORT_DIPLOCATION("SW:4")
PORT_DIPSETTING( 0x08, "Yes (off)" )
PORT_DIPSETTING( 0x00, "No (on)" )
- PORT_DIPNAME( 0x04, 0x04, "Draw Debug Lines (step5of6)" ) PORT_DIPLOCATION("SW:6")
- PORT_DIPSETTING( 0x04, "Yes (off)" )
+ PORT_DIPNAME( 0x10, 0x10, "Draw Debug Lines (step4of6)" ) PORT_DIPLOCATION("SW:5")
+ PORT_DIPSETTING( 0x10, "Yes (off)" )
+ PORT_DIPSETTING( 0x00, "No (on)" )
+ PORT_DIPNAME( 0x20, 0x20, "Draw Debug Lines (step5of6)" ) PORT_DIPLOCATION("SW:6")
+ PORT_DIPSETTING( 0x20, "Yes (off)" )
PORT_DIPSETTING( 0x00, "No (on)" )
- PORT_DIPNAME( 0x02, 0x02, "Draw Debug Lines (step6of6)" ) PORT_DIPLOCATION("SW:7")
- PORT_DIPSETTING( 0x02, "No (off)" )
+ PORT_DIPNAME( 0x40, 0x40, "Draw Debug Lines (step6of6)" ) PORT_DIPLOCATION("SW:7")
+ PORT_DIPSETTING( 0x40, "No (off)" )
PORT_DIPSETTING( 0x00, "Yes (on)" )
// Allow "Draw Debug Lines" = _xxoxxo_
// 12345678
#endif
- PORT_DIPNAME( 0x01, 0x01, "Freeze" ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -823,29 +830,29 @@ static INPUT_PORTS_START( splatter )
PORT_MODIFY( "DIPSW" )
/* these two don't seem to have much use... */
#ifdef PRIORITY_EASINESS_TO_PLAY
- PORT_DIPNAME( 0x11, 0x11, "CPU #0 Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:8,4")
- PORT_DIPSETTING( 0x11, DEF_STR( No ) )
+ PORT_DIPNAME( 0x88, 0x88, "CPU #0 Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:4,8")
+ PORT_DIPSETTING( 0x88, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
#else
- PORT_DIPNAME( 0x10, 0x10, "CPU #0 Kick Watchdog in IRQ (step1of2)" ) PORT_DIPLOCATION("SW:4")
- PORT_DIPSETTING( 0x10, DEF_STR( No ) )
+ PORT_DIPNAME( 0x08, 0x08, "CPU #0 Kick Watchdog in IRQ (step1of2)" ) PORT_DIPLOCATION("SW:4")
+ PORT_DIPSETTING( 0x08, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
- PORT_DIPNAME( 0x01, 0x01, "CPU #0 Kick Watchdog in IRQ (step2of2)" ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( No ) )
+ PORT_DIPNAME( 0x80, 0x80, "CPU #0 Kick Watchdog in IRQ (step2of2)" ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
// Allow "CPU #0 Kick Watchdog in IRQ" = ___o___o
// 12345678
#endif
#ifdef PRIORITY_EASINESS_TO_PLAY
- PORT_DIPNAME( 0x06, 0x06, "CPU #0&1 Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:7,6")
- PORT_DIPSETTING( 0x06, DEF_STR( No ) )
+ PORT_DIPNAME( 0x60, 0x60, "CPU #0&1 Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:6,7")
+ PORT_DIPSETTING( 0x60, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
#else
- PORT_DIPNAME( 0x04, 0x04, "CPU #0&1 Kick Watchdog in IRQ (step1of2)" ) PORT_DIPLOCATION("SW:6")
- PORT_DIPSETTING( 0x04, DEF_STR( No ) )
+ PORT_DIPNAME( 0x20, 0x20, "CPU #0&1 Kick Watchdog in IRQ (step1of2)" ) PORT_DIPLOCATION("SW:6")
+ PORT_DIPSETTING( 0x20, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
- PORT_DIPNAME( 0x02, 0x02, "CPU #0&1 Kick Watchdog in IRQ (step2of2)" ) PORT_DIPLOCATION("SW:7")
- PORT_DIPSETTING( 0x02, DEF_STR( No ) )
+ PORT_DIPNAME( 0x40, 0x40, "CPU #0&1 Kick Watchdog in IRQ (step2of2)" ) PORT_DIPLOCATION("SW:7")
+ PORT_DIPSETTING( 0x40, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
// Allow "CPU #0&1 Kick Watchdog in IRQ" = _____oo_
// 12345678
@@ -857,8 +864,8 @@ static INPUT_PORTS_START( splatter3 )
PORT_INCLUDE( splatter )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x20, 0x20, "Stage Select" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x04, 0x04, "Stage Select" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -913,11 +920,11 @@ static INPUT_PORTS_START( ws89 )
PORT_MODIFY( "DIPSW" )
/* see code @ e90c. The lines this draws can't even be seen because they are erased afterwards */
- PORT_DIPNAME( 0x02, 0x02, "Draw Debug Lines" ) PORT_DIPLOCATION("SW:7")
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x40, 0x40, "Draw Debug Lines" ) PORT_DIPLOCATION("SW:7")
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x01, 0x01, "Freeze" ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -926,16 +933,16 @@ static INPUT_PORTS_START( dangseed )
PORT_INCLUDE( ns1 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x40, 0x40, "Freeze" ) PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
/* this doesn't seem to have much use... */
- PORT_DIPNAME( 0x20, 0x20, "Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:3")
- PORT_DIPSETTING( 0x20, DEF_STR( No ) )
+ PORT_DIPNAME( 0x04, 0x04, "Kick Watchdog in IRQ" ) PORT_DIPLOCATION("SW:3")
+ PORT_DIPSETTING( 0x04, DEF_STR( No ) )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) )
/* to enter the A.D.S. menu, set the dip switch, keep 1p start pressed and press service coin */
- PORT_DIPNAME( 0x04, 0x04, "Auto Data Sampling" ) PORT_DIPLOCATION("SW:6")
- PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x20, 0x20, "Auto Data Sampling" ) PORT_DIPLOCATION("SW:6")
+ PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -945,11 +952,11 @@ static INPUT_PORTS_START( ws90 )
PORT_MODIFY( "DIPSW" )
/* see code @ e8ff. The lines this draws can't even be seen because they are erased afterwards */
- PORT_DIPNAME( 0x02, 0x02, "Draw Debug Lines" ) PORT_DIPLOCATION("SW:7")
- PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x40, 0x40, "Draw Debug Lines" ) PORT_DIPLOCATION("SW:7")
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
- PORT_DIPNAME( 0x01, 0x01, "Freeze" ) PORT_DIPLOCATION("SW:8")
- PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW:8")
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -958,8 +965,8 @@ static INPUT_PORTS_START( boxyboy )
PORT_INCLUDE( ns1 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x40, 0x40, "Freeze" ) PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x02, 0x02, "Freeze" ) PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -968,8 +975,8 @@ static INPUT_PORTS_START( puzlclub )
PORT_INCLUDE( ns1 )
PORT_MODIFY( "DIPSW" )
- PORT_DIPNAME( 0x40, 0x40, "Auto Data Sampling" ) PORT_DIPLOCATION("SW:2")
- PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPNAME( 0x02, 0x02, "Auto Data Sampling" ) PORT_DIPLOCATION("SW:2")
+ PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
@@ -1046,6 +1053,8 @@ MACHINE_CONFIG_START(namcos1_state::ns1)
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_DEVICE_ADD("dsw_sel", LS157, 0) // LS257 'A3'
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_RAW_PARAMS(XTAL(49'152'000)/8, 384, 9+8*8, 9+44*8, 264, 2*8, 30*8)
diff --git a/src/mame/includes/namcos1.h b/src/mame/includes/namcos1.h
index 7fde1de7881..e63ffec4542 100644
--- a/src/mame/includes/namcos1.h
+++ b/src/mame/includes/namcos1.h
@@ -4,6 +4,7 @@
#include "sound/dac.h"
#include "sound/namco.h"
#include "video/namco_c116.h"
+#include "machine/74157.h"
class namcos1_state : public driver_device
{
@@ -27,7 +28,9 @@ public:
m_rom(*this, "user1"),
m_soundbank(*this, "soundbank"),
m_mcubank(*this, "mcubank"),
- m_io_dipsw(*this, "DIPSW") { }
+ m_io_dipsw(*this, "DIPSW"),
+ m_dsw_sel(*this, "dsw_sel")
+ { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_subcpu;
@@ -50,6 +53,7 @@ public:
required_memory_bank m_mcubank;
required_ioport m_io_dipsw;
+ required_device<ls157_device> m_dsw_sel;
int m_key_id;
int m_key_reg;