summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author 0kmg <9137159+0kmg@users.noreply.github.com>2021-11-02 11:46:43 -0800
committer GitHub <noreply@github.com>2021-11-03 06:46:43 +1100
commitdce1fd7dfa91b41b82af90069e133d2a83e86976 (patch)
tree42ddc372db2a2dd7e018d43df62f72d1e48a1263
parentfb646fea7906f84e5ad4de95b49e21b5bef6405b (diff)
bus/nes_ctrl: Added emulation for IGS Tap-tap Mat controller. (#8772)
* Refactored Family Trainer and Tap-tap Mat into common base class. Software list items promoted to working (nes.xml) --------------------------------------- Super Mogura Tataki!! Pokkun Moguraa (Japan)
-rw-r--r--hash/nes.xml12
-rw-r--r--scripts/src/bus.lua4
-rw-r--r--src/devices/bus/nes_ctrl/ctrl.cpp3
-rw-r--r--src/devices/bus/nes_ctrl/fcmat.cpp187
-rw-r--r--src/devices/bus/nes_ctrl/fcmat.h76
-rw-r--r--src/devices/bus/nes_ctrl/ftrainer.cpp144
-rw-r--r--src/devices/bus/nes_ctrl/ftrainer.h50
7 files changed, 273 insertions, 203 deletions
diff --git a/hash/nes.xml b/hash/nes.xml
index d0622236a56..9fd420d9bdd 100644
--- a/hash/nes.xml
+++ b/hash/nes.xml
@@ -12167,7 +12167,7 @@ license:CC0
</part>
</software>
- <software name="train1aw" cloneof="athlwrld" supported="partial">
+ <software name="train1aw" cloneof="athlwrld">
<description>Family Trainer 1 - Athletic World (Jpn, v1.1)</description>
<year>1986</year>
<publisher>Bandai</publisher>
@@ -12188,7 +12188,7 @@ license:CC0
</part>
</software>
- <software name="train1aw1" cloneof="athlwrld" supported="partial">
+ <software name="train1aw1" cloneof="athlwrld">
<description>Family Trainer 1 - Athletic World (Jpn)</description>
<year>1986</year>
<publisher>Bandai</publisher>
@@ -12255,7 +12255,7 @@ license:CC0
</part>
</software>
- <software name="train4jr" supported="partial">
+ <software name="train4jr">
<description>Family Trainer 4 - Jogging Race (Jpn)</description>
<year>1987</year>
<publisher>Bandai</publisher>
@@ -37030,18 +37030,18 @@ license:CC0
</part>
</software>
-<!-- This game uses an unemulated whack-a-mole pad -->
- <software name="supermog" supported="no">
+ <software name="supermog">
<description>Super Mogura Tataki!! Pokkun Moguraa (Japan)</description>
<year>1989</year>
<publisher>IGS</publisher>
<info name="serial" value="IGS-X1"/>
<info name="release" value="19891208"/>
- <info name="alt_title" value="ぽっくんモグラー"/>
+ <info name="alt_title" value="スーパーモグラたたき‼︎ぽっくんモグラー"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="cnrom" />
<feature name="pcb" value="HVC-CNROM" />
<feature name="mirroring" value="vertical" />
+ <feature name="peripheral" value="taptapmat" />
<dataarea name="prg" size="32768">
<rom name="0.prg" size="32768" crc="36a9c087" sha1="0f46f52d3995234e933933e3b525ba76fe3aa7d2" offset="00000" />
</dataarea>
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index cb898a2a4c9..561ff9e496f 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -2910,8 +2910,8 @@ if (BUSES["NES_CTRL"]~=null) then
MAME_DIR .. "src/devices/bus/nes_ctrl/arkpaddle.h",
MAME_DIR .. "src/devices/bus/nes_ctrl/bcbattle.cpp",
MAME_DIR .. "src/devices/bus/nes_ctrl/bcbattle.h",
- MAME_DIR .. "src/devices/bus/nes_ctrl/ftrainer.cpp",
- MAME_DIR .. "src/devices/bus/nes_ctrl/ftrainer.h",
+ MAME_DIR .. "src/devices/bus/nes_ctrl/fcmat.cpp",
+ MAME_DIR .. "src/devices/bus/nes_ctrl/fcmat.h",
MAME_DIR .. "src/devices/bus/nes_ctrl/fckeybrd.cpp",
MAME_DIR .. "src/devices/bus/nes_ctrl/fckeybrd.h",
MAME_DIR .. "src/devices/bus/nes_ctrl/hori.cpp",
diff --git a/src/devices/bus/nes_ctrl/ctrl.cpp b/src/devices/bus/nes_ctrl/ctrl.cpp
index 991191a1f0c..77f72d6b687 100644
--- a/src/devices/bus/nes_ctrl/ctrl.cpp
+++ b/src/devices/bus/nes_ctrl/ctrl.cpp
@@ -46,8 +46,8 @@
#include "4score.h"
#include "arkpaddle.h"
#include "bcbattle.h"
-#include "ftrainer.h"
#include "fckeybrd.h"
+#include "fcmat.h"
#include "hori.h"
#include "joypad.h"
#include "konamihs.h"
@@ -211,4 +211,5 @@ void fc_expansion_devices(device_slot_interface &device)
device.option_add("hori_4p", NES_HORI4P);
device.option_add("barcode_battler", NES_BARCODE_BATTLER);
device.option_add("subor_keyboard", NES_SUBORKEYBOARD);
+ device.option_add("taptapmat", NES_TAPTAPMAT);
}
diff --git a/src/devices/bus/nes_ctrl/fcmat.cpp b/src/devices/bus/nes_ctrl/fcmat.cpp
new file mode 100644
index 00000000000..5a01fcd209a
--- /dev/null
+++ b/src/devices/bus/nes_ctrl/fcmat.cpp
@@ -0,0 +1,187 @@
+// license:BSD-3-Clause
+// copyright-holders:kmg, Fabio Priuli
+/**********************************************************************
+
+ Here we emulate two distinct mat controllers which share a common
+ read/write interface with the hardware:
+
+ Nintendo Family Computer - Bandai Family Trainer Mat
+ Nintendo Family Computer - IGS Tap-tap Mat
+
+**********************************************************************/
+
+#include "emu.h"
+#include "fcmat.h"
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(NES_FTRAINER, nes_ftrainer_device, "nes_famtrain", "Bandai Family Trainer")
+DEFINE_DEVICE_TYPE(NES_TAPTAPMAT, nes_taptapmat_device, "nes_taptapmat", "IGS Tap-tap Mat")
+
+
+static INPUT_PORTS_START( nes_ftrainer )
+ PORT_START("LAYOUT")
+ PORT_CONFNAME( 0x01, 0x00, "Family Trainer Button Layout")
+ PORT_CONFSETTING( 0x00, "Side A" )
+ PORT_CONFSETTING( 0x01, "Side B" )
+
+ // difference between the two sides is that we mirror the key mapping to match the real pad layout!
+ PORT_START("MAT_COL.0")
+ // side A layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Family Trainer Mid1") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ // side B layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Family Trainer 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Family Trainer 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Family Trainer 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+
+ PORT_START("MAT_COL.1")
+ // side A layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Family Trainer Low1") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Family Trainer Mid2") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Family Trainer Top1") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ // side B layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Family Trainer 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Family Trainer 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Family Trainer 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+
+ PORT_START("MAT_COL.2")
+ // side A layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Family Trainer Low2") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Family Trainer Mid3") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Family Trainer Top2") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ // side B layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Family Trainer 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Family Trainer 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Family Trainer 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+
+ PORT_START("MAT_COL.3")
+ // side A layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Family Trainer Mid4") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
+ // side B layout
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Family Trainer 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Family Trainer 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Family Trainer 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
+INPUT_PORTS_END
+
+
+static INPUT_PORTS_START( nes_taptapmat )
+ PORT_START("MAT_COL.0")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON12 ) PORT_NAME("Bottom Left (Frankenstein)") PORT_CODE(KEYCODE_V)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Middle Left (Bang!)") PORT_CODE(KEYCODE_F)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Top Left (Antlion)") PORT_CODE(KEYCODE_R)
+
+ PORT_START("MAT_COL.1")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Bottom Mid-Left (Bang!)") PORT_CODE(KEYCODE_B)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Middle Mid-Left (Caveman)") PORT_CODE(KEYCODE_G)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Top Mid-Left (Bang!)") PORT_CODE(KEYCODE_T)
+
+ PORT_START("MAT_COL.2")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("Bottom Mid-Right (Shark)") PORT_CODE(KEYCODE_N)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Middle Mid-Right (Bang!)") PORT_CODE(KEYCODE_H)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Top Mid-Right (Dinosaur)") PORT_CODE(KEYCODE_Y)
+
+ PORT_START("MAT_COL.3")
+ PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("Bottom Right (Bang!)") PORT_CODE(KEYCODE_M)
+ PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Middle Right (Mole)") PORT_CODE(KEYCODE_J)
+ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Top Right (Bang!)") PORT_CODE(KEYCODE_U)
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor nes_ftrainer_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( nes_ftrainer );
+}
+
+ioport_constructor nes_taptapmat_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( nes_taptapmat );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// constructor
+//-------------------------------------------------
+
+nes_fcmat_device::nes_fcmat_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , device_nes_control_port_interface(mconfig, *this)
+ , m_mat(*this, "MAT_COL.%u", 0)
+ , m_row_scan(0)
+{
+}
+
+nes_ftrainer_device::nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_fcmat_device(mconfig, NES_FTRAINER, tag, owner, clock)
+{
+}
+
+nes_taptapmat_device::nes_taptapmat_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : nes_fcmat_device(mconfig, NES_TAPTAPMAT, tag, owner, clock)
+{
+}
+
+
+//-------------------------------------------------
+// device_start
+//-------------------------------------------------
+
+void nes_fcmat_device::device_start()
+{
+ save_item(NAME(m_row_scan));
+}
+
+
+//-------------------------------------------------
+// device_reset
+//-------------------------------------------------
+
+void nes_fcmat_device::device_reset()
+{
+ m_row_scan = 0;
+}
+
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+u8 nes_fcmat_device::read_exp(offs_t offset)
+{
+ u8 ret = 0;
+
+ if (offset == 1) // $4017
+ {
+ for (int row = 0; row < 3; row++) // bottom row first (buttons 9,10,11,12 on Family Trainer)
+ if (!BIT(m_row_scan, row))
+ for (int col = 0; col < 4; col++) // left column first (Family Trainer side A and Tap-tap Mat)
+ ret |= BIT(m_mat[col]->read(), row) << (col + 1);
+ ret = ~ret & 0x1e; // 0: pressed, 1: not pressed
+ }
+
+ return ret;
+}
+
+//-------------------------------------------------
+// write
+//-------------------------------------------------
+
+void nes_fcmat_device::write(u8 data)
+{
+ // select row to scan
+ m_row_scan = data & 0x07;
+}
diff --git a/src/devices/bus/nes_ctrl/fcmat.h b/src/devices/bus/nes_ctrl/fcmat.h
new file mode 100644
index 00000000000..7c6a595e532
--- /dev/null
+++ b/src/devices/bus/nes_ctrl/fcmat.h
@@ -0,0 +1,76 @@
+// license:BSD-3-Clause
+// copyright-holders:kmg, Fabio Priuli
+/**********************************************************************
+
+ Nintendo Family Computer - Bandai Family Trainer Mat
+ Nintendo Family Computer - IGS Tap-tap Mat
+
+**********************************************************************/
+
+#ifndef MAME_BUS_NES_CTRL_FCMAT_H
+#define MAME_BUS_NES_CTRL_FCMAT_H
+
+#pragma once
+
+#include "ctrl.h"
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> nes_fcmat_device
+
+class nes_fcmat_device :
+ public device_t,
+ public device_nes_control_port_interface
+{
+protected:
+ // construction/destruction
+ nes_fcmat_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+ virtual u8 read_exp(offs_t offset) override;
+ virtual void write(u8 data) override;
+
+private:
+ required_ioport_array<4> m_mat;
+ u8 m_row_scan;
+};
+
+
+// ======================> nes_ftrainer_device
+
+class nes_ftrainer_device : public nes_fcmat_device
+{
+public:
+ // construction/destruction
+ nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const override;
+};
+
+
+// ======================> nes_taptapmat_device
+
+class nes_taptapmat_device : public nes_fcmat_device
+{
+public:
+ // construction/destruction
+ nes_taptapmat_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+
+protected:
+ virtual ioport_constructor device_input_ports() const override;
+};
+
+
+// device type definition
+DECLARE_DEVICE_TYPE(NES_FTRAINER, nes_ftrainer_device)
+DECLARE_DEVICE_TYPE(NES_TAPTAPMAT, nes_taptapmat_device)
+
+
+#endif // MAME_BUS_NES_CTRL_FCMAT_H
diff --git a/src/devices/bus/nes_ctrl/ftrainer.cpp b/src/devices/bus/nes_ctrl/ftrainer.cpp
deleted file mode 100644
index fe89436ce90..00000000000
--- a/src/devices/bus/nes_ctrl/ftrainer.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Fabio Priuli
-/**********************************************************************
-
- Nintendo Family Computer - Bandai Family Trainer Mat
-
-**********************************************************************/
-
-#include "emu.h"
-#include "ftrainer.h"
-
-//**************************************************************************
-// DEVICE DEFINITIONS
-//**************************************************************************
-
-DEFINE_DEVICE_TYPE(NES_FTRAINER, nes_ftrainer_device, "nes_famtrain", "Bandai Family Trainer")
-
-
-static INPUT_PORTS_START( nes_ftrainer )
- PORT_START("LAYOUT")
- PORT_CONFNAME( 0x01, 0x00, "Family Trainer Button Layout")
- PORT_CONFSETTING( 0x00, "Side A" )
- PORT_CONFSETTING( 0x01, "Side B" )
-
- // difference between the two sides is that we mirror the key mapping to match the real pad layout!
- PORT_START("FT_COL.0")
- // side A layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid1") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- // side B layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
-
- PORT_START("FT_COL.1")
- // side A layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low1") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid2") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top1") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- // side B layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
-
- PORT_START("FT_COL.2")
- // side A layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low2") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid3") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top2") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- // side B layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
-
- PORT_START("FT_COL.3")
- // side A layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid4") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00)
- // side B layout
- PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
- PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01)
-INPUT_PORTS_END
-
-
-//-------------------------------------------------
-// input_ports - device-specific input ports
-//-------------------------------------------------
-
-ioport_constructor nes_ftrainer_device::device_input_ports() const
-{
- return INPUT_PORTS_NAME( nes_ftrainer );
-}
-
-
-
-//**************************************************************************
-// LIVE DEVICE
-//**************************************************************************
-
-//-------------------------------------------------
-// nes_ftrainer_device - constructor
-//-------------------------------------------------
-
-nes_ftrainer_device::nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NES_FTRAINER, tag, owner, clock)
- , device_nes_control_port_interface(mconfig, *this)
- , m_trainer(*this, "FT_COL.%u", 0)
- , m_row_scan(0)
-{
-}
-
-
-//-------------------------------------------------
-// device_start
-//-------------------------------------------------
-
-void nes_ftrainer_device::device_start()
-{
- save_item(NAME(m_row_scan));
-}
-
-
-//-------------------------------------------------
-// device_reset
-//-------------------------------------------------
-
-void nes_ftrainer_device::device_reset()
-{
- m_row_scan = 0;
-}
-
-
-//-------------------------------------------------
-// read
-//-------------------------------------------------
-
-uint8_t nes_ftrainer_device::read_exp(offs_t offset)
-{
- uint8_t ret = 0;
-
- if (offset == 1) // $4017
- {
- for (int row = 0; row < 3; row++) // bottom row first (buttons 9,10,11,12)
- if (!BIT(m_row_scan, row))
- for (int col = 0; col < 4; col++) // side B right column first (buttons 4,8,12)
- ret |= BIT(m_trainer[col]->read(), row) << (col + 1);
- return ~ret & 0x1e; // 0: pressed, 1: not pressed
- }
-
- return ret;
-}
-
-//-------------------------------------------------
-// write
-//-------------------------------------------------
-
-void nes_ftrainer_device::write(uint8_t data)
-{
- // select row to scan
- m_row_scan = data & 0x07;
-}
diff --git a/src/devices/bus/nes_ctrl/ftrainer.h b/src/devices/bus/nes_ctrl/ftrainer.h
deleted file mode 100644
index d72077c93a2..00000000000
--- a/src/devices/bus/nes_ctrl/ftrainer.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:Fabio Priuli
-/**********************************************************************
-
- Nintendo Family Computer - Bandai Family Trainer Mat
-
-**********************************************************************/
-
-#ifndef MAME_BUS_NES_CTRL_FTRAINER_H
-#define MAME_BUS_NES_CTRL_FTRAINER_H
-
-#pragma once
-
-#include "ctrl.h"
-
-
-//**************************************************************************
-// TYPE DEFINITIONS
-//**************************************************************************
-
-// ======================> nes_ftrainer_device
-
-class nes_ftrainer_device : public device_t,
- public device_nes_control_port_interface
-{
-public:
- // construction/destruction
- nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- virtual ioport_constructor device_input_ports() const override;
-
-protected:
- // device-level overrides
- virtual void device_start() override;
- virtual void device_reset() override;
-
- virtual uint8_t read_exp(offs_t offset) override;
- virtual void write(uint8_t data) override;
-
-private:
- required_ioport_array<4> m_trainer;
- uint8_t m_row_scan;
-};
-
-
-// device type definition
-DECLARE_DEVICE_TYPE(NES_FTRAINER, nes_ftrainer_device)
-
-
-#endif // MAME_BUS_NES_CTRL_FTRAINER_H