summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mephisto_polgar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/mephisto_polgar.cpp')
-rw-r--r--src/mame/drivers/mephisto_polgar.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/mame/drivers/mephisto_polgar.cpp b/src/mame/drivers/mephisto_polgar.cpp
index 97c23edfd21..9cafe14136c 100644
--- a/src/mame/drivers/mephisto_polgar.cpp
+++ b/src/mame/drivers/mephisto_polgar.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Sandro Ronco
+// copyright-holders:Sandro Ronco, hap
/******************************************************************************
Mephisto Polgar
@@ -8,7 +8,7 @@ Hardware notes:
- RP65C02G @ 4.91MHz
- 64KB ROM (25% unused)
- Mephisto modular display module
-- Mephisto Exclusive/Muenchen chessboard
+- Mephisto modular chessboard
The 10MHz version has a W65C02P-8 @ 9.83MHz.
@@ -58,7 +58,7 @@ private:
u8 polgar_state::keys_r(offs_t offset)
{
- return (BIT(m_keys->read(), offset) << 7) | 0x7f;
+ return ~(BIT(m_keys->read(), offset) << 7);
}
@@ -70,8 +70,8 @@ u8 polgar_state::keys_r(offs_t offset)
void polgar_state::polgar_mem(address_map &map)
{
map(0x0000, 0x1fff).ram().share("nvram");
- map(0x2000, 0x2000).w("display", FUNC(mephisto_display_module2_device::latch_w));
- map(0x2004, 0x2004).w("display", FUNC(mephisto_display_module2_device::io_w));
+ map(0x2000, 0x2000).w("display", FUNC(mephisto_display2_device::latch_w));
+ map(0x2004, 0x2004).w("display", FUNC(mephisto_display2_device::io_w));
map(0x2400, 0x2400).w("board", FUNC(mephisto_board_device::led_w));
map(0x2800, 0x2800).w("board", FUNC(mephisto_board_device::mux_w));
map(0x2c00, 0x2c07).r(FUNC(polgar_state::keys_r));
@@ -88,14 +88,14 @@ void polgar_state::polgar_mem(address_map &map)
static INPUT_PORTS_START( polgar )
PORT_START("KEY")
- PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T)
- PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I)
- PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M)
- PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O)
- PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L)
- PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F)
- PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME
- PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("CL / New Game") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // "
+ PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("TRN / Pawn") PORT_CODE(KEYCODE_T)
+ PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("INFO / Knight") PORT_CODE(KEYCODE_I)
+ PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("MEM / Bishop") PORT_CODE(KEYCODE_M)
+ PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("POS / Rook") PORT_CODE(KEYCODE_O)
+ PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("LEV / Queen") PORT_CODE(KEYCODE_L)
+ PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("FCT / King") PORT_CODE(KEYCODE_F)
+ PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("ENT / New Game") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_F1) // combine for NEW GAME
+ PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("CL / New Game") PORT_CODE(KEYCODE_BACKSPACE) PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_F1) // "
INPUT_PORTS_END
@@ -108,7 +108,9 @@ void polgar_state::polgar(machine_config &config)
{
R65C02(config, m_maincpu, 4.9152_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &polgar_state::polgar_mem);
- m_maincpu->set_periodic_int(FUNC(polgar_state::nmi_line_pulse), attotime::from_hz(4.9152_MHz_XTAL / (1 << 13)));
+
+ const attotime nmi_period = attotime::from_hz(4.9152_MHz_XTAL / 0x2000);
+ m_maincpu->set_periodic_int(FUNC(polgar_state::nmi_line_pulse), nmi_period);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
@@ -131,7 +133,9 @@ void polgar_state::polgar10(machine_config &config)
M65C02(config.replace(), m_maincpu, 9.8304_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, &polgar_state::polgar_mem);
- m_maincpu->set_periodic_int(FUNC(polgar_state::nmi_line_pulse), attotime::from_hz(9.8304_MHz_XTAL / (1 << 13)));
+
+ const attotime nmi_period = attotime::from_hz(9.8304_MHz_XTAL / 0x2000);
+ m_maincpu->set_periodic_int(FUNC(polgar_state::nmi_line_pulse), nmi_period);
}