summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes_ctrl/konamibag.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/nes_ctrl/konamibag.cpp')
-rw-r--r--src/devices/bus/nes_ctrl/konamibag.cpp88
1 files changed, 88 insertions, 0 deletions
diff --git a/src/devices/bus/nes_ctrl/konamibag.cpp b/src/devices/bus/nes_ctrl/konamibag.cpp
new file mode 100644
index 00000000000..26620dfe5ce
--- /dev/null
+++ b/src/devices/bus/nes_ctrl/konamibag.cpp
@@ -0,0 +1,88 @@
+// license:BSD-3-Clause
+// copyright-holders:kmg, Fabio Priuli
+/**********************************************************************
+
+ Nintendo Family Computer - Konami Exciting Boxing Air Bag
+
+**********************************************************************/
+
+#include "emu.h"
+#include "konamibag.h"
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+DEFINE_DEVICE_TYPE(NES_KONAMIBAG, nes_konamibag_device, "nes_konamibag", "Konami Exciting Boxing Air Bag")
+
+
+static INPUT_PORTS_START( nes_konamibag )
+ PORT_START("BAG.0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("Left Hook")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // opponent dodges right, unclear how this is triggered
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // opponent dodges left, unclear how this is triggered
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("Right Hook")
+
+ PORT_START("BAG.1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("Left Jab")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("Body")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("Right Jab")
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("Straight")
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor nes_konamibag_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( nes_konamibag );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// nes_konamibag_device - constructor
+//-------------------------------------------------
+
+nes_konamibag_device::nes_konamibag_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
+ : device_t(mconfig, NES_KONAMIBAG, tag, owner, clock)
+ , device_nes_control_port_interface(mconfig, *this)
+ , m_sensor(*this, "BAG.%u", 0)
+ , m_cur_sensor(0)
+{
+}
+
+
+//-------------------------------------------------
+// device_start
+//-------------------------------------------------
+
+void nes_konamibag_device::device_start()
+{
+ save_item(NAME(m_cur_sensor));
+}
+
+
+//-------------------------------------------------
+// read
+//-------------------------------------------------
+
+u8 nes_konamibag_device::read_exp(offs_t offset)
+{
+ return (offset == 1) ? m_sensor[m_cur_sensor]->read() << 1 : 0;
+}
+
+//-------------------------------------------------
+// write
+//-------------------------------------------------
+
+void nes_konamibag_device::write(u8 data)
+{
+ m_cur_sensor = BIT(data, 1);
+}
mitgraph'>| * Add AVI writing to bgfx, nw therealmogminer@gmail.com2016-04-177-179/+382 | * HLSL settings are reset now, when a new machine is selected ImJezze2016-04-172-2/+11 | * Fix compile error on SDL targets therealmogminer@gmail.com2016-04-161-0/+2 | * Merge branch 'master' of https://github.com/GiuseppeGorgoglione/mame ImJezze2016-04-161-192/+45 |\ | | | | | | | | # Conflicts solved: # src/osd/modules/render/d3d/d3dhlsl.cpp | * Save Windows post-fx scheenshots as a single .png Giuseppe Gorgoglione2016-04-051-191/+32 | | | | | | | | Currently in Windows post-fx screenshots (L-ALT + F12) are split in 4 chunks and saved as 4 separate .png files. This was probably done to facilitate fx code debugging, since post-fx screenshots are usually very big and old monitors were low in resolution. With current monitors this shouldn't be a problem any more. | * Fix Windows rendering after post-fx snapshot or video recording Giuseppe Gorgoglione2016-04-051-1/+13 | | | | | | | | In Windows OSD, when post-processing effects are enabled, after taking a post-fx screenshot (L-ALT + F12) or enabling post-fx video recording (L-SHIFT + L-ALT + F12) the window is not updated anymore while the emulation goes on normally. This patch fixes that. * | Add pillarboxing shaders and layout for bgfx, nw therealmogminer@gmail.com2016-04-1631-44/+650 | | * | Reduction code for entries of "enum class ui_menu_item_type" and the use of ↵ dankan18902016-04-152-4/+4 | | | | | | | | item_append with separators. * | bgfx: Add data-driven render target clearing [Ryan Holtz] therealmogminer@gmail.com2016-04-1411-20/+218 | | * | Removed hacks for vector screens from shaders (nw) ImJezze2016-04-133-58/+131 | | | | | | | | | | - added handling of texture coordinates for vector screens to core render - added handling of orientation/rotation for vector screens to D3D renderer * | Make OSDs return ui_menu_item lists, not slider_state lists therealmogminer@gmail.com2016-04-106-20/+53 | | * | Add dividing line to bgfx slider list where applicable, nw therealmogminer@gmail.com2016-04-101-7/+6 | | * | Add render.h no longer indirectly supplied via emu.h <- ui/ui.h Vas Crabb2016-04-102-0/+6 | | * | Fix compile on linux and windows. couriersud2016-04-101-12/+0 | | * | Fix memory leak when changing screen chains, will fix any issues later, nw therealmogminer@gmail.com2016-04-101-2/+3 | | * | Make sliders use an std::vector instead of a linked list, nw therealmogminer@gmail.com2016-04-108-79/+46 | | * | Fix linux compile. couriersud2016-04-101-3/+3 | | * | Fix compile on windows, nw therealmogminer@gmail.com2016-04-101-1/+13 | | * | Include modules/osdwindow.h instead of window.h. couriersud2016-04-092-3/+3 | | * | Fix SDL build on linux: couriersud2016-04-091-0/+1 | | | | | | | | | | | | | | - removed inclusion of SDL headers in all headers. - replaced those by forward declarations and in one case by a wrapper class (for a typedef struct). - added -Wno-strict-prototypes to 7z build (gmake target) * | Add runtime screen chain selection, nw therealmogminer@gmail.com2016-04-0942-136/+468 | | * | Try to fix issue on some linux platforms (nw) Miodrag Milanovic2016-04-083-7/+8 | | * | fix Miodrag Milanovic2016-04-081-0/+2 | | * | Revert "Fix SDL compile on linux. Took the opportunity to remove a number of" Miodrag Milanovic2016-04-0811-21/+19 | | | | | | | | | | Partial revert only, some changes still in This reverts commit 632b10cd0ec304c0367321a5be62164d00b18ff1. * | Revert "compile fix on windows (nw)" Miodrag Milanovic2016-04-084-11/+1 | | | | | | | | This reverts commit f862b775205e7b07e3803a8f1c789e7d6b710f24. * | compile fix on windows (nw) Miodrag Milanovic2016-04-084-1/+11 | | * | Fix SDL compile on linux. Took the opportunity to remove a number of couriersud2016-04-0816-24/+26 | | | | | | | | | | "emu.h" includes from src/osd/modules/render/bgfx code. There is still a conflict between mame memory.h and bgfx memory.h to be resolved. * | Pull a bunch of screen chain code from drawbgfx to chainmanager where it ↵ therealmogminer@gmail.com2016-04-066-272/+329 | | | | | | | | belongs, nw * | Fixed typo and updated shaders (nw)