| Previous | 199869 Revisions | Next |
| r34640 Tuesday 27th January, 2015 at 00:48:47 UTC by Couriersud |
|---|
| Merge branch 'master' of https://github.com/mamedev/mame.git |
| [src/emu/bus] | bus.mak |
| [src/emu/bus/nes_ctrl] | 4score.c* 4score.h* arkpaddle.c* arkpaddle.h* bcbattle.c* bcbattle.h* ctrl.c* ctrl.h* fckeybrd.c* fckeybrd.h* ftrainer.c* ftrainer.h* hori.c* hori.h* joypad.c* joypad.h* konamihs.c* konamihs.h* miracle.c* miracle.h* mjpanel.c* mjpanel.h* pachinko.c* pachinko.h* partytap.c* partytap.h* powerpad.c* powerpad.h* suborkey.c* suborkey.h* zapper.c* zapper.h* |
| [src/mame] | mame.lst mame.mak |
| [src/mame/drivers] | btime.c cps1.c hikaru.c naomi.c silvmil.c |
| [src/mame/machine] | 315-5838_317-0229_comp.h naomibd.h |
| [src/mame/video] | cps1.c |
| [src/mess] | mess.lst mess.mak |
| [src/mess/drivers] | banctec.c* nes.c |
| [src/mess/includes] | banctec.h* nes.h |
| [src/mess/machine] | nes.c |
| r243151 | r243152 | |
|---|---|---|
| 1087 | 1087 | |
| 1088 | 1088 | #------------------------------------------------- |
| 1089 | 1089 | # |
| 1090 | #@src/emu/bus/nes_ctrl/ctrl.h,BUSES += NES_CTRL | |
| 1091 | #------------------------------------------------- | |
| 1092 | ||
| 1093 | ifneq ($(filter NES_CTRL,$(BUSES)),) | |
| 1094 | OBJDIRS += $(BUSOBJ)/nes_ctrl | |
| 1095 | BUSOBJS += $(BUSOBJ)/nes_ctrl/ctrl.o | |
| 1096 | BUSOBJS += $(BUSOBJ)/nes_ctrl/joypad.o | |
| 1097 | BUSOBJS += $(BUSOBJ)/nes_ctrl/4score.o | |
| 1098 | BUSOBJS += $(BUSOBJ)/nes_ctrl/arkpaddle.o | |
| 1099 | BUSOBJS += $(BUSOBJ)/nes_ctrl/bcbattle.o | |
| 1100 | BUSOBJS += $(BUSOBJ)/nes_ctrl/ftrainer.o | |
| 1101 | BUSOBJS += $(BUSOBJ)/nes_ctrl/fckeybrd.o | |
| 1102 | BUSOBJS += $(BUSOBJ)/nes_ctrl/hori.o | |
| 1103 | BUSOBJS += $(BUSOBJ)/nes_ctrl/konamihs.o | |
| 1104 | BUSOBJS += $(BUSOBJ)/nes_ctrl/miracle.o | |
| 1105 | BUSOBJS += $(BUSOBJ)/nes_ctrl/mjpanel.o | |
| 1106 | BUSOBJS += $(BUSOBJ)/nes_ctrl/pachinko.o | |
| 1107 | BUSOBJS += $(BUSOBJ)/nes_ctrl/partytap.o | |
| 1108 | BUSOBJS += $(BUSOBJ)/nes_ctrl/powerpad.o | |
| 1109 | BUSOBJS += $(BUSOBJ)/nes_ctrl/suborkey.o | |
| 1110 | BUSOBJS += $(BUSOBJ)/nes_ctrl/zapper.o | |
| 1111 | endif | |
| 1112 | ||
| 1113 | #------------------------------------------------- | |
| 1114 | # | |
| 1090 | 1115 | #@src/emu/bus/snes/snes_slot.h,BUSES += SNES |
| 1091 | 1116 | #------------------------------------------------- |
| 1092 | 1117 |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Entertainment System Four Score Adapter | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | ||
| 9 | TODO: current implementation is a HACK, due to limitations of the | |
| 10 | slot system! | |
| 11 | A real Four Score would be connected to both the controller ports of | |
| 12 | the NES, but current core cannot emulate something like this until | |
| 13 | devices can live their own life and being connected to other devices | |
| 14 | at request. | |
| 15 | In current implementation the device has to be mounted separately in | |
| 16 | the two ports and each enables 2 inputs (this is more or less as hacky | |
| 17 | as the non-slot previous one, where the 4 ports were always available | |
| 18 | to the emulated system, but it's not a great consolation :( ) | |
| 19 | Two subdevices are currently used so to warn the user that the first | |
| 20 | one gives P1+P3 inputs and the second one gives P2+P4 inputs. | |
| 21 | For the same reason, we don't currently emulate the 2P/4P switch, | |
| 22 | since we could at best have two switches to disable the second player | |
| 23 | inputs. | |
| 24 | ||
| 25 | Note: Two Pads are hardcoded in inputs below, instead of acting as | |
| 26 | passthrough for 2 standard joypad devices, in order to show in the | |
| 27 | internal UI that they belong to P1+P3 and P2+P4, otherwise they would | |
| 28 | be listed as P1+P2 and P3+P4 respectively. This *HAS* to be changed | |
| 29 | once the slot support in the code has improved (4 standard joypads | |
| 30 | shall be attached to the unit!) | |
| 31 | ||
| 32 | **********************************************************************/ | |
| 33 | ||
| 34 | #include "4score.h" | |
| 35 | ||
| 36 | //************************************************************************** | |
| 37 | // DEVICE DEFINITIONS | |
| 38 | //************************************************************************** | |
| 39 | ||
| 40 | const device_type NES_4SCORE_P1P3 = &device_creator<nes_4score_p1p3_device>; | |
| 41 | const device_type NES_4SCORE_P2P4 = &device_creator<nes_4score_p2p4_device>; | |
| 42 | ||
| 43 | ||
| 44 | static INPUT_PORTS_START( nes_4score_p1p3 ) | |
| 45 | PORT_START("PAD1") | |
| 46 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") PORT_PLAYER(1) | |
| 47 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") PORT_PLAYER(1) | |
| 48 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) | |
| 49 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) | |
| 50 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) | |
| 51 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) | |
| 52 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) | |
| 53 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) | |
| 54 | ||
| 55 | PORT_START("PAD3") | |
| 56 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") PORT_PLAYER(3) | |
| 57 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") PORT_PLAYER(3) | |
| 58 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3) | |
| 59 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3) | |
| 60 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) | |
| 61 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) | |
| 62 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) | |
| 63 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) | |
| 64 | INPUT_PORTS_END | |
| 65 | ||
| 66 | ||
| 67 | static INPUT_PORTS_START( nes_4score_p2p4 ) | |
| 68 | PORT_START("PAD2") | |
| 69 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") PORT_PLAYER(2) | |
| 70 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") PORT_PLAYER(2) | |
| 71 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2) | |
| 72 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) | |
| 73 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) | |
| 74 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) | |
| 75 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) | |
| 76 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) | |
| 77 | ||
| 78 | PORT_START("PAD4") | |
| 79 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") PORT_PLAYER(4) | |
| 80 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") PORT_PLAYER(4) | |
| 81 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4) | |
| 82 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4) | |
| 83 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) | |
| 84 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) | |
| 85 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) | |
| 86 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) | |
| 87 | INPUT_PORTS_END | |
| 88 | ||
| 89 | ||
| 90 | //------------------------------------------------- | |
| 91 | // input_ports - device-specific input ports | |
| 92 | //------------------------------------------------- | |
| 93 | ||
| 94 | ioport_constructor nes_4score_p1p3_device::device_input_ports() const | |
| 95 | { | |
| 96 | return INPUT_PORTS_NAME( nes_4score_p1p3 ); | |
| 97 | } | |
| 98 | ||
| 99 | ioport_constructor nes_4score_p2p4_device::device_input_ports() const | |
| 100 | { | |
| 101 | return INPUT_PORTS_NAME( nes_4score_p2p4 ); | |
| 102 | } | |
| 103 | ||
| 104 | ||
| 105 | ||
| 106 | //************************************************************************** | |
| 107 | // LIVE DEVICE | |
| 108 | //************************************************************************** | |
| 109 | ||
| 110 | //------------------------------------------------- | |
| 111 | // nes_4score_device - constructor | |
| 112 | //------------------------------------------------- | |
| 113 | ||
| 114 | nes_4score_device::nes_4score_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) | |
| 115 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 116 | device_nes_control_port_interface(mconfig, *this) | |
| 117 | { | |
| 118 | } | |
| 119 | ||
| 120 | nes_4score_p1p3_device::nes_4score_p1p3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 121 | nes_4score_device(mconfig, NES_4SCORE_P1P3, "Nintendo Four Score Adapter P1/P3", tag, owner, clock, "nes_4score_p1p3", __FILE__), | |
| 122 | m_joypad1(*this, "PAD1"), | |
| 123 | m_joypad3(*this, "PAD3") | |
| 124 | { | |
| 125 | } | |
| 126 | ||
| 127 | nes_4score_p2p4_device::nes_4score_p2p4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 128 | nes_4score_device(mconfig, NES_4SCORE_P2P4, "Nintendo Four Score Adapter P2/P4", tag, owner, clock, "nes_4score_p2p4", __FILE__), | |
| 129 | m_joypad2(*this, "PAD2"), | |
| 130 | m_joypad4(*this, "PAD4") | |
| 131 | { | |
| 132 | } | |
| 133 | ||
| 134 | ||
| 135 | //------------------------------------------------- | |
| 136 | // device_start | |
| 137 | //------------------------------------------------- | |
| 138 | ||
| 139 | void nes_4score_device::device_start() | |
| 140 | { | |
| 141 | save_item(NAME(m_latch)); | |
| 142 | } | |
| 143 | ||
| 144 | ||
| 145 | //------------------------------------------------- | |
| 146 | // device_reset | |
| 147 | //------------------------------------------------- | |
| 148 | ||
| 149 | void nes_4score_device::device_reset() | |
| 150 | { | |
| 151 | m_latch = 0; | |
| 152 | } | |
| 153 | ||
| 154 | ||
| 155 | //------------------------------------------------- | |
| 156 | // read | |
| 157 | //------------------------------------------------- | |
| 158 | ||
| 159 | UINT8 nes_4score_device::read_bit0() | |
| 160 | { | |
| 161 | UINT8 ret = m_latch & 1; | |
| 162 | m_latch >>= 1; | |
| 163 | return ret; | |
| 164 | } | |
| 165 | ||
| 166 | //------------------------------------------------- | |
| 167 | // write | |
| 168 | //------------------------------------------------- | |
| 169 | ||
| 170 | void nes_4score_p1p3_device::write(UINT8 data) | |
| 171 | { | |
| 172 | if (data & 0x01) | |
| 173 | return; | |
| 174 | ||
| 175 | // P3 & P4 inputs in NES Four Score are read serially with P1 & P2 | |
| 176 | m_latch = m_joypad1->read(); | |
| 177 | m_latch |= (m_joypad3->read() << 8); // pad 3 | |
| 178 | m_latch |= (0x08 << 16); // signature | |
| 179 | } | |
| 180 | ||
| 181 | void nes_4score_p2p4_device::write(UINT8 data) | |
| 182 | { | |
| 183 | if (data & 0x01) | |
| 184 | return; | |
| 185 | ||
| 186 | // P3 & P4 inputs in NES Four Score are read serially with P1 & P2 | |
| 187 | m_latch = m_joypad2->read(); | |
| 188 | m_latch |= (m_joypad4->read() << 8); // pad 4 | |
| 189 | m_latch |= (0x04 << 16); // signature | |
| 190 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Entertainment System Four Score Adapter | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_FOURSCORE__ | |
| 13 | #define __NES_FOURSCORE__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_4score_device | |
| 24 | ||
| 25 | class nes_4score_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_4score_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); | |
| 31 | ||
| 32 | protected: | |
| 33 | // device-level overrides | |
| 34 | virtual void device_start(); | |
| 35 | virtual void device_reset(); | |
| 36 | ||
| 37 | virtual UINT8 read_bit0(); | |
| 38 | ||
| 39 | protected: | |
| 40 | UINT32 m_latch; | |
| 41 | }; | |
| 42 | ||
| 43 | // ======================> nes_4score_p1p3_device | |
| 44 | ||
| 45 | class nes_4score_p1p3_device : public nes_4score_device | |
| 46 | { | |
| 47 | public: | |
| 48 | // construction/destruction | |
| 49 | nes_4score_p1p3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 50 | ||
| 51 | virtual ioport_constructor device_input_ports() const; | |
| 52 | ||
| 53 | protected: | |
| 54 | virtual void write(UINT8 data); | |
| 55 | ||
| 56 | private: | |
| 57 | required_ioport m_joypad1; | |
| 58 | required_ioport m_joypad3; | |
| 59 | }; | |
| 60 | ||
| 61 | // ======================> nes_4score_p2p4_device | |
| 62 | ||
| 63 | class nes_4score_p2p4_device : public nes_4score_device | |
| 64 | { | |
| 65 | public: | |
| 66 | // construction/destruction | |
| 67 | nes_4score_p2p4_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 68 | ||
| 69 | virtual ioport_constructor device_input_ports() const; | |
| 70 | ||
| 71 | protected: | |
| 72 | virtual void write(UINT8 data); | |
| 73 | ||
| 74 | private: | |
| 75 | required_ioport m_joypad2; | |
| 76 | required_ioport m_joypad4; | |
| 77 | }; | |
| 78 | ||
| 79 | ||
| 80 | // device type definition | |
| 81 | extern const device_type NES_4SCORE_P1P3; | |
| 82 | extern const device_type NES_4SCORE_P2P4; | |
| 83 | ||
| 84 | ||
| 85 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System - | |
| 4 | Arkanoid Paddle input device | |
| 5 | ||
| 6 | Copyright MESS Team. | |
| 7 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 8 | ||
| 9 | **********************************************************************/ | |
| 10 | ||
| 11 | #include "arkpaddle.h" | |
| 12 | ||
| 13 | //************************************************************************** | |
| 14 | // DEVICE DEFINITIONS | |
| 15 | //************************************************************************** | |
| 16 | ||
| 17 | const device_type NES_ARKPADDLE = &device_creator<nes_vaus_device>; | |
| 18 | const device_type NES_ARKPADDLE_FC = &device_creator<nes_vausfc_device>; | |
| 19 | ||
| 20 | ||
| 21 | static INPUT_PORTS_START( arkanoid_paddle ) | |
| 22 | PORT_START("PADDLE") | |
| 23 | PORT_BIT( 0xff, 0x7f, IPT_PADDLE) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CENTERDELTA(0) PORT_MINMAX(0x62,0xf2) | |
| 24 | PORT_START("BUTTON") | |
| 25 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Paddle button") | |
| 26 | INPUT_PORTS_END | |
| 27 | ||
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // input_ports - device-specific input ports | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | ioport_constructor nes_vaus_device::device_input_ports() const | |
| 34 | { | |
| 35 | return INPUT_PORTS_NAME( arkanoid_paddle ); | |
| 36 | } | |
| 37 | ||
| 38 | ||
| 39 | ||
| 40 | //************************************************************************** | |
| 41 | // LIVE DEVICE | |
| 42 | //************************************************************************** | |
| 43 | ||
| 44 | //------------------------------------------------- | |
| 45 | // nes_vaus_device - constructor | |
| 46 | //------------------------------------------------- | |
| 47 | ||
| 48 | nes_vaus_device::nes_vaus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) | |
| 49 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 50 | device_nes_control_port_interface(mconfig, *this), | |
| 51 | m_paddle(*this, "PADDLE"), | |
| 52 | m_button(*this, "BUTTON") | |
| 53 | { | |
| 54 | } | |
| 55 | ||
| 56 | nes_vaus_device::nes_vaus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 57 | device_t(mconfig, NES_ARKPADDLE, "Arkanoid Vaus NES Controller", tag, owner, clock, "nes_vaus", __FILE__), | |
| 58 | device_nes_control_port_interface(mconfig, *this), | |
| 59 | m_paddle(*this, "PADDLE"), | |
| 60 | m_button(*this, "BUTTON") | |
| 61 | { | |
| 62 | } | |
| 63 | ||
| 64 | nes_vausfc_device::nes_vausfc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 65 | nes_vaus_device(mconfig, NES_ARKPADDLE_FC, "Arkanoid Vaus FC Controller", tag, owner, clock, "nes_vausfc", __FILE__) | |
| 66 | { | |
| 67 | } | |
| 68 | ||
| 69 | ||
| 70 | //------------------------------------------------- | |
| 71 | // device_start | |
| 72 | //------------------------------------------------- | |
| 73 | ||
| 74 | void nes_vaus_device::device_start() | |
| 75 | { | |
| 76 | save_item(NAME(m_latch)); | |
| 77 | save_item(NAME(m_start_conv)); | |
| 78 | } | |
| 79 | ||
| 80 | ||
| 81 | //------------------------------------------------- | |
| 82 | // device_reset | |
| 83 | //------------------------------------------------- | |
| 84 | ||
| 85 | void nes_vaus_device::device_reset() | |
| 86 | { | |
| 87 | m_latch = 0; | |
| 88 | m_start_conv = 0; | |
| 89 | } | |
| 90 | ||
| 91 | ||
| 92 | //------------------------------------------------- | |
| 93 | // read | |
| 94 | //------------------------------------------------- | |
| 95 | ||
| 96 | UINT8 nes_vaus_device::read_bit34() | |
| 97 | { | |
| 98 | UINT8 ret = (m_button->read() << 3); | |
| 99 | ret |= (m_latch & 0x80) >> 3; | |
| 100 | m_latch <<= 1; | |
| 101 | m_latch &= 0xff; | |
| 102 | return ret; | |
| 103 | } | |
| 104 | ||
| 105 | UINT8 nes_vausfc_device::read_exp(offs_t offset) | |
| 106 | { | |
| 107 | UINT8 ret = 0; | |
| 108 | if (offset == 0) //$4016 | |
| 109 | ret = m_button->read() << 1; | |
| 110 | else //$4017 | |
| 111 | { | |
| 112 | ret = (m_latch & 0x80) >> 6; | |
| 113 | m_latch <<= 1; | |
| 114 | m_latch &= 0xff; | |
| 115 | } | |
| 116 | return ret; | |
| 117 | } | |
| 118 | ||
| 119 | //------------------------------------------------- | |
| 120 | // write | |
| 121 | //------------------------------------------------- | |
| 122 | ||
| 123 | void nes_vaus_device::write(UINT8 data) | |
| 124 | { | |
| 125 | int old = m_start_conv; | |
| 126 | ||
| 127 | if (data == 0 && old == 1) | |
| 128 | m_latch = (UINT8) (m_paddle->read() ^ 0xff); | |
| 129 | ||
| 130 | m_start_conv = data; | |
| 131 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System - | |
| 4 | Arkanoid Paddle input device | |
| 5 | ||
| 6 | Copyright MESS Team. | |
| 7 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 8 | ||
| 9 | **********************************************************************/ | |
| 10 | ||
| 11 | #pragma once | |
| 12 | ||
| 13 | #ifndef __NES_ARKPADDLE__ | |
| 14 | #define __NES_ARKPADDLE__ | |
| 15 | ||
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | #include "ctrl.h" | |
| 19 | ||
| 20 | //************************************************************************** | |
| 21 | // TYPE DEFINITIONS | |
| 22 | //************************************************************************** | |
| 23 | ||
| 24 | // ======================> nes_vaus_device | |
| 25 | ||
| 26 | class nes_vaus_device : public device_t, | |
| 27 | public device_nes_control_port_interface | |
| 28 | { | |
| 29 | public: | |
| 30 | // construction/destruction | |
| 31 | nes_vaus_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); | |
| 32 | nes_vaus_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ||
| 34 | // optional information overrides | |
| 35 | virtual ioport_constructor device_input_ports() const; | |
| 36 | ||
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_start(); | |
| 40 | virtual void device_reset(); | |
| 41 | ||
| 42 | virtual UINT8 read_bit34(); | |
| 43 | virtual void write(UINT8 data); | |
| 44 | ||
| 45 | required_ioport m_paddle; | |
| 46 | required_ioport m_button; | |
| 47 | UINT8 m_start_conv; | |
| 48 | UINT32 m_latch; | |
| 49 | }; | |
| 50 | ||
| 51 | ||
| 52 | // ======================> nes_vaus_device | |
| 53 | ||
| 54 | class nes_vausfc_device : public nes_vaus_device | |
| 55 | { | |
| 56 | public: | |
| 57 | // construction/destruction | |
| 58 | nes_vausfc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 59 | ||
| 60 | protected: | |
| 61 | virtual UINT8 read_bit34() { return 0; } | |
| 62 | virtual UINT8 read_exp(offs_t offset); | |
| 63 | }; | |
| 64 | ||
| 65 | ||
| 66 | // device type definition | |
| 67 | extern const device_type NES_ARKPADDLE; | |
| 68 | extern const device_type NES_ARKPADDLE_FC; | |
| 69 | ||
| 70 | ||
| 71 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer - Epoch Barcode Battler | |
| 4 | ||
| 5 | TODO: this should be actually emulated as a standalone system with | |
| 6 | a few 7segments LEDs, once we get a dump of its BIOS | |
| 7 | At the moment we only emulated the connection with a Famicom | |
| 8 | ||
| 9 | Copyright MESS Team. | |
| 10 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 11 | ||
| 12 | **********************************************************************/ | |
| 13 | ||
| 14 | #include "bcbattle.h" | |
| 15 | ||
| 16 | //************************************************************************** | |
| 17 | // DEVICE DEFINITIONS | |
| 18 | //************************************************************************** | |
| 19 | ||
| 20 | const device_type NES_BARCODE_BATTLER = &device_creator<nes_bcbattle_device>; | |
| 21 | ||
| 22 | ||
| 23 | static INPUT_PORTS_START( nes_battler ) | |
| 24 | INPUT_PORTS_END | |
| 25 | ||
| 26 | //------------------------------------------------- | |
| 27 | // input_ports - device-specific input ports | |
| 28 | //------------------------------------------------- | |
| 29 | ||
| 30 | ioport_constructor nes_bcbattle_device::device_input_ports() const | |
| 31 | { | |
| 32 | return INPUT_PORTS_NAME( nes_battler ); | |
| 33 | } | |
| 34 | ||
| 35 | MACHINE_CONFIG_FRAGMENT( nes_battler ) | |
| 36 | MCFG_BARCODE_READER_ADD("battler") | |
| 37 | MACHINE_CONFIG_END | |
| 38 | ||
| 39 | machine_config_constructor nes_bcbattle_device::device_mconfig_additions() const | |
| 40 | { | |
| 41 | return MACHINE_CONFIG_NAME( nes_battler ); | |
| 42 | } | |
| 43 | ||
| 44 | ||
| 45 | //------------------------------------------------- | |
| 46 | // device_timer - handler timer events | |
| 47 | //------------------------------------------------- | |
| 48 | ||
| 49 | void nes_bcbattle_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
| 50 | { | |
| 51 | if (id == TIMER_BATTLER) | |
| 52 | { | |
| 53 | int old = m_new_code; | |
| 54 | // has something new been scanned? | |
| 55 | if (old < m_reader->get_pending_code()) | |
| 56 | { | |
| 57 | if (m_reader->get_byte_length() == 13) | |
| 58 | { | |
| 59 | for (int i = 0; i < 13; i++) | |
| 60 | m_current_barcode[i] = m_reader->read_code() + '0'; | |
| 61 | } | |
| 62 | else if (m_reader->get_byte_length() == 8) | |
| 63 | { | |
| 64 | for (int i = 0; i < 5; i++) | |
| 65 | m_current_barcode[i] = 0x20; | |
| 66 | for (int i = 5; i < 13; i++) | |
| 67 | m_current_barcode[i] = m_reader->read_code() + '0'; | |
| 68 | } | |
| 69 | // read one more, to reset the internal byte counter | |
| 70 | m_reader->read_code(); | |
| 71 | ||
| 72 | // the string "SUNSOFT" is accepted as well by Barcode World | |
| 73 | m_current_barcode[13] = 'E'; | |
| 74 | m_current_barcode[14] = 'P'; | |
| 75 | m_current_barcode[15] = 'O'; | |
| 76 | m_current_barcode[16] = 'C'; | |
| 77 | m_current_barcode[17] = 'H'; | |
| 78 | m_current_barcode[18] = 0x0d; | |
| 79 | m_current_barcode[19] = 0x0a; | |
| 80 | m_pending_code = 1; | |
| 81 | } | |
| 82 | m_new_code = m_reader->get_pending_code(); | |
| 83 | } | |
| 84 | } | |
| 85 | ||
| 86 | //************************************************************************** | |
| 87 | // LIVE DEVICE | |
| 88 | //************************************************************************** | |
| 89 | ||
| 90 | //------------------------------------------------- | |
| 91 | // nes_bcbattle_device - constructor | |
| 92 | //------------------------------------------------- | |
| 93 | ||
| 94 | nes_bcbattle_device::nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 95 | device_t(mconfig, NES_BARCODE_BATTLER, "Epoch Barcode Battler", tag, owner, clock, "nes_bcbattle", __FILE__), | |
| 96 | device_nes_control_port_interface(mconfig, *this), | |
| 97 | m_reader(*this, "battler") | |
| 98 | { | |
| 99 | } | |
| 100 | ||
| 101 | ||
| 102 | //------------------------------------------------- | |
| 103 | // device_start | |
| 104 | //------------------------------------------------- | |
| 105 | ||
| 106 | void nes_bcbattle_device::device_start() | |
| 107 | { | |
| 108 | // lacking emulation of the standalone Barcode Battler, we refresh periodically the input from the reader | |
| 109 | // proper emulation would have the standalone unit acknowledging that a new barcode has been scanned | |
| 110 | // and sending the proper serial bits, instead of our read_current_bit() function! | |
| 111 | battler_timer = timer_alloc(TIMER_BATTLER); | |
| 112 | battler_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1000)); | |
| 113 | ||
| 114 | save_item(NAME(m_current_barcode)); | |
| 115 | save_item(NAME(m_new_code)); | |
| 116 | save_item(NAME(m_pending_code)); | |
| 117 | save_item(NAME(m_transmitting)); | |
| 118 | save_item(NAME(m_cur_bit)); | |
| 119 | save_item(NAME(m_cur_byte)); | |
| 120 | } | |
| 121 | ||
| 122 | ||
| 123 | //------------------------------------------------- | |
| 124 | // device_reset | |
| 125 | //------------------------------------------------- | |
| 126 | ||
| 127 | void nes_bcbattle_device::device_reset() | |
| 128 | { | |
| 129 | m_pending_code = 0; | |
| 130 | m_new_code = 0; | |
| 131 | m_transmitting = 0; | |
| 132 | m_cur_bit = 0; | |
| 133 | m_cur_byte = 0; | |
| 134 | memset(m_current_barcode, 0, ARRAY_LENGTH(m_current_barcode)); | |
| 135 | } | |
| 136 | ||
| 137 | ||
| 138 | //------------------------------------------------- | |
| 139 | // read | |
| 140 | //------------------------------------------------- | |
| 141 | ||
| 142 | int nes_bcbattle_device::read_current_bit() | |
| 143 | { | |
| 144 | if (m_pending_code && !m_transmitting) | |
| 145 | { | |
| 146 | // we start with 1 | |
| 147 | m_transmitting = 1; | |
| 148 | m_cur_byte = 0; | |
| 149 | m_cur_bit = 0; | |
| 150 | return 1; | |
| 151 | } | |
| 152 | ||
| 153 | if (m_transmitting) | |
| 154 | { | |
| 155 | if (m_cur_bit == 0) | |
| 156 | { | |
| 157 | m_cur_bit++; | |
| 158 | return 1; | |
| 159 | } | |
| 160 | if (m_cur_bit < 9) | |
| 161 | { | |
| 162 | int bit = (BIT(m_current_barcode[m_cur_byte], m_cur_bit - 1)) ^ 1; | |
| 163 | m_cur_bit++; | |
| 164 | return bit; | |
| 165 | } | |
| 166 | if (m_cur_bit == 9) | |
| 167 | { | |
| 168 | m_cur_bit = 0; | |
| 169 | //printf("%X ", m_current_barcode[m_cur_byte]); | |
| 170 | m_cur_byte++; | |
| 171 | if (m_cur_byte == 20) | |
| 172 | { | |
| 173 | m_cur_byte = 0; | |
| 174 | m_transmitting = 0; | |
| 175 | m_pending_code = 0; | |
| 176 | } | |
| 177 | return 0; | |
| 178 | } | |
| 179 | } | |
| 180 | ||
| 181 | return 0; | |
| 182 | } | |
| 183 | ||
| 184 | UINT8 nes_bcbattle_device::read_exp(offs_t offset) | |
| 185 | { | |
| 186 | UINT8 ret = 0; | |
| 187 | if (offset == 1) //$4017 | |
| 188 | { | |
| 189 | ret |= read_current_bit() << 2; | |
| 190 | } | |
| 191 | ||
| 192 | return ret; | |
| 193 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer - Epoch Barcode Battler | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_BCBATTLE__ | |
| 13 | #define __NES_BCBATTLE__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | #include "machine/bcreader.h" | |
| 19 | ||
| 20 | //************************************************************************** | |
| 21 | // TYPE DEFINITIONS | |
| 22 | //************************************************************************** | |
| 23 | ||
| 24 | // ======================> nes_bcbattle_device | |
| 25 | ||
| 26 | class nes_bcbattle_device : public device_t, | |
| 27 | public device_nes_control_port_interface | |
| 28 | { | |
| 29 | public: | |
| 30 | // construction/destruction | |
| 31 | nes_bcbattle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ||
| 33 | virtual ioport_constructor device_input_ports() const; | |
| 34 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 35 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 36 | ||
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_start(); | |
| 40 | virtual void device_reset(); | |
| 41 | ||
| 42 | virtual UINT8 read_exp(offs_t offset); | |
| 43 | int read_current_bit(); | |
| 44 | ||
| 45 | static const device_timer_id TIMER_BATTLER = 1; | |
| 46 | required_device<barcode_reader_device> m_reader; | |
| 47 | UINT8 m_current_barcode[20]; | |
| 48 | int m_pending_code, m_new_code, m_transmitting, m_cur_bit, m_cur_byte; | |
| 49 | emu_timer *battler_timer; | |
| 50 | }; | |
| 51 | ||
| 52 | // device type definition | |
| 53 | extern const device_type NES_BARCODE_BATTLER; | |
| 54 | ||
| 55 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System controller ports | |
| 4 | and Family Computer expansion port emulation | |
| 5 | ||
| 6 | Here we emulate in fact 3 different kind of ports, which are | |
| 7 | connected to different bis of memory locations $4016 and $4017: | |
| 8 | - NES controller ports: these are hooked to bit 0,3,4 of the | |
| 9 | corresponding address ($4016 for port1, $4017 for port2) | |
| 10 | - FC controller ports: these are only hooked to bit 0 of the | |
| 11 | corresponding address (so that e.g. a NES Zapper could not | |
| 12 | be connected to a later FC AV model, because its inputs | |
| 13 | would not be detected) | |
| 14 | - FC expansion port: this is hooked to bits 0-4 of both addresses | |
| 15 | To make things a little bit more complex, old FC models have the | |
| 16 | controller hardwired to the unit, and the P2 controllers are | |
| 17 | directly hooked also to one of the expansion port lines (namely, | |
| 18 | microphone inputs from P2 go to $4016 bit 2) | |
| 19 | ||
| 20 | Even if the controller port and the expansion port are | |
| 21 | physically different (the FC expansion is a 15pin port, while | |
| 22 | the controller ports are 7pin), we emulate them as variants of a | |
| 23 | common device, exposing the following handlers: | |
| 24 | - read_bit0: for bit0 reads, which are typically used for serial | |
| 25 | inputs from controllers | |
| 26 | - read_bit34: for bit3,4 reading, expected to be at the correct | |
| 27 | offset (but we don't currently check for read_bit34 & 0xf8==0) | |
| 28 | - read_exp: for reads going through the expansion, with a offset | |
| 29 | parameter to decide whether we are reading from $4016 and $4017 | |
| 30 | - write: to acknowledge writes to $4016 | |
| 31 | ||
| 32 | The driver emulation will take care to only call the correct | |
| 33 | handlers they have hooks for: Basic usage is that the expansion | |
| 34 | port calls read_exp, FC ctrl ports call read_bit0, and NES ctrl | |
| 35 | ports call both read_bit0 and read_bit34. However, to cope with | |
| 36 | the original FC microphone, we will have the second controller | |
| 37 | port calling read_exp too. | |
| 38 | ||
| 39 | Copyright MESS Team. | |
| 40 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 41 | ||
| 42 | **********************************************************************/ | |
| 43 | ||
| 44 | #include "ctrl.h" | |
| 45 | // slot devices | |
| 46 | #include "4score.h" | |
| 47 | #include "arkpaddle.h" | |
| 48 | #include "bcbattle.h" | |
| 49 | #include "ftrainer.h" | |
| 50 | #include "fckeybrd.h" | |
| 51 | #include "hori.h" | |
| 52 | #include "joypad.h" | |
| 53 | #include "konamihs.h" | |
| 54 | #include "miracle.h" | |
| 55 | #include "mjpanel.h" | |
| 56 | #include "pachinko.h" | |
| 57 | #include "partytap.h" | |
| 58 | #include "powerpad.h" | |
| 59 | #include "suborkey.h" | |
| 60 | #include "zapper.h" | |
| 61 | ||
| 62 | ||
| 63 | //************************************************************************** | |
| 64 | // GLOBAL VARIABLES | |
| 65 | //************************************************************************** | |
| 66 | ||
| 67 | const device_type NES_CONTROL_PORT = &device_creator<nes_control_port_device>; | |
| 68 | ||
| 69 | ||
| 70 | ||
| 71 | //************************************************************************** | |
| 72 | // CARD INTERFACE | |
| 73 | //************************************************************************** | |
| 74 | ||
| 75 | //------------------------------------------------- | |
| 76 | // device_nes_control_port_interface - constructor | |
| 77 | //------------------------------------------------- | |
| 78 | ||
| 79 | device_nes_control_port_interface::device_nes_control_port_interface(const machine_config &mconfig, device_t &device) : | |
| 80 | device_slot_card_interface(mconfig, device) | |
| 81 | { | |
| 82 | m_port = dynamic_cast<nes_control_port_device *>(device.owner()); | |
| 83 | } | |
| 84 | ||
| 85 | ||
| 86 | //------------------------------------------------- | |
| 87 | // ~device_nes_control_port_interface - destructor | |
| 88 | //------------------------------------------------- | |
| 89 | ||
| 90 | device_nes_control_port_interface::~device_nes_control_port_interface() | |
| 91 | { | |
| 92 | } | |
| 93 | ||
| 94 | ||
| 95 | ||
| 96 | //************************************************************************** | |
| 97 | // LIVE DEVICE | |
| 98 | //************************************************************************** | |
| 99 | ||
| 100 | //------------------------------------------------- | |
| 101 | // nes_control_port_device - constructor | |
| 102 | //------------------------------------------------- | |
| 103 | ||
| 104 | nes_control_port_device::nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 105 | device_t(mconfig, NES_CONTROL_PORT, "Nintendo NES/FC control port", tag, owner, clock, "nes_control_port", __FILE__), | |
| 106 | device_slot_interface(mconfig, *this) | |
| 107 | { | |
| 108 | } | |
| 109 | ||
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // nes_control_port_device - destructor | |
| 113 | //------------------------------------------------- | |
| 114 | ||
| 115 | nes_control_port_device::~nes_control_port_device() | |
| 116 | { | |
| 117 | } | |
| 118 | ||
| 119 | ||
| 120 | //------------------------------------------------- | |
| 121 | // device_start - device-specific startup | |
| 122 | //------------------------------------------------- | |
| 123 | ||
| 124 | void nes_control_port_device::device_start() | |
| 125 | { | |
| 126 | m_device = dynamic_cast<device_nes_control_port_interface *>(get_card_device()); | |
| 127 | m_brightpixel_cb.bind_relative_to(*owner()); | |
| 128 | } | |
| 129 | ||
| 130 | ||
| 131 | UINT8 nes_control_port_device::read_bit0() | |
| 132 | { | |
| 133 | UINT8 data = 0; | |
| 134 | if (m_device) | |
| 135 | data = m_device->read_bit0(); | |
| 136 | return data; | |
| 137 | } | |
| 138 | ||
| 139 | UINT8 nes_control_port_device::read_bit34() | |
| 140 | { | |
| 141 | UINT8 data = 0; | |
| 142 | if (m_device) | |
| 143 | data = m_device->read_bit34(); | |
| 144 | return data; | |
| 145 | } | |
| 146 | ||
| 147 | UINT8 nes_control_port_device::read_exp(offs_t offset) | |
| 148 | { | |
| 149 | UINT8 data = 0; | |
| 150 | if (m_device) | |
| 151 | data = m_device->read_exp(offset); | |
| 152 | return data; | |
| 153 | } | |
| 154 | ||
| 155 | void nes_control_port_device::write(UINT8 data) | |
| 156 | { | |
| 157 | if (m_device) | |
| 158 | m_device->write(data); | |
| 159 | } | |
| 160 | ||
| 161 | ||
| 162 | ||
| 163 | //------------------------------------------------- | |
| 164 | // SLOT_INTERFACE( nes_control_port_devices ) | |
| 165 | //------------------------------------------------- | |
| 166 | ||
| 167 | SLOT_INTERFACE_START( nes_control_port1_devices ) | |
| 168 | SLOT_INTERFACE("joypad", NES_JOYPAD) | |
| 169 | SLOT_INTERFACE("zapper", NES_ZAPPER) | |
| 170 | SLOT_INTERFACE("4score_p1p3", NES_4SCORE_P1P3) | |
| 171 | // SLOT_INTERFACE("miracle_piano", NES_MIRACLE) | |
| 172 | SLOT_INTERFACE_END | |
| 173 | ||
| 174 | SLOT_INTERFACE_START( nes_control_port2_devices ) | |
| 175 | SLOT_INTERFACE("joypad", NES_JOYPAD) | |
| 176 | SLOT_INTERFACE("zapper", NES_ZAPPER) | |
| 177 | SLOT_INTERFACE("vaus", NES_ARKPADDLE) | |
| 178 | SLOT_INTERFACE("powerpad", NES_POWERPAD) | |
| 179 | SLOT_INTERFACE("4score_p2p4", NES_4SCORE_P2P4) | |
| 180 | SLOT_INTERFACE_END | |
| 181 | ||
| 182 | SLOT_INTERFACE_START( fc_control_port1_devices ) | |
| 183 | SLOT_INTERFACE("joypad", NES_JOYPAD) | |
| 184 | SLOT_INTERFACE("ccpad_left", NES_CCPAD_LEFT) | |
| 185 | SLOT_INTERFACE_END | |
| 186 | ||
| 187 | SLOT_INTERFACE_START( fc_control_port2_devices ) | |
| 188 | SLOT_INTERFACE("joypad", NES_JOYPAD) | |
| 189 | SLOT_INTERFACE("joypad_old", NES_FCPAD_P2) | |
| 190 | SLOT_INTERFACE("ccpad_right", NES_CCPAD_RIGHT) | |
| 191 | SLOT_INTERFACE_END | |
| 192 | ||
| 193 | SLOT_INTERFACE_START( fc_expansion_devices ) | |
| 194 | SLOT_INTERFACE("joypad", NES_JOYPAD) | |
| 195 | SLOT_INTERFACE("arcstick", NES_ARCSTICK) | |
| 196 | SLOT_INTERFACE("fc_keyboard", NES_FCKEYBOARD) | |
| 197 | SLOT_INTERFACE("zapper", NES_ZAPPER) | |
| 198 | SLOT_INTERFACE("vaus", NES_ARKPADDLE_FC) | |
| 199 | SLOT_INTERFACE("family_trainer", NES_FTRAINER) | |
| 200 | SLOT_INTERFACE("konamihs", NES_KONAMIHS) | |
| 201 | SLOT_INTERFACE("mj_panel", NES_MJPANEL) | |
| 202 | SLOT_INTERFACE("pachinko", NES_PACHINKO) | |
| 203 | SLOT_INTERFACE("partytap", NES_PARTYTAP) | |
| 204 | SLOT_INTERFACE("hori_twin", NES_HORITWIN) | |
| 205 | SLOT_INTERFACE("hori_4p", NES_HORI4P) | |
| 206 | SLOT_INTERFACE("barcode_battler", NES_BARCODE_BATTLER) | |
| 207 | SLOT_INTERFACE("subor_keyboard", NES_SUBORKEYBOARD) | |
| 208 | SLOT_INTERFACE_END |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System controller port | |
| 4 | emulation | |
| 5 | ||
| 6 | Copyright MESS Team. | |
| 7 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 8 | ||
| 9 | ********************************************************************** | |
| 10 | ||
| 11 | ||
| 12 | **********************************************************************/ | |
| 13 | ||
| 14 | #pragma once | |
| 15 | ||
| 16 | #ifndef __NES_CONTROL_PORT__ | |
| 17 | #define __NES_CONTROL_PORT__ | |
| 18 | ||
| 19 | #include "emu.h" | |
| 20 | ||
| 21 | //************************************************************************** | |
| 22 | // TYPE DEFINITIONS | |
| 23 | //************************************************************************** | |
| 24 | ||
| 25 | class nes_control_port_device; | |
| 26 | ||
| 27 | // ======================> device_nes_control_port_interface | |
| 28 | ||
| 29 | class device_nes_control_port_interface : public device_slot_card_interface | |
| 30 | { | |
| 31 | public: | |
| 32 | // construction/destruction | |
| 33 | device_nes_control_port_interface(const machine_config &mconfig, device_t &device); | |
| 34 | virtual ~device_nes_control_port_interface(); | |
| 35 | ||
| 36 | virtual UINT8 read_bit0() { return 0; }; | |
| 37 | virtual UINT8 read_bit34() { return 0; }; | |
| 38 | virtual UINT8 read_exp(offs_t offset) { return 0; }; | |
| 39 | virtual void write(UINT8 data) { }; | |
| 40 | ||
| 41 | protected: | |
| 42 | nes_control_port_device *m_port; | |
| 43 | }; | |
| 44 | ||
| 45 | ||
| 46 | typedef device_delegate<bool (int x, int y)> nesctrl_brightpixel_delegate; | |
| 47 | #define NESCTRL_BRIGHTPIXEL_CB(name) bool name(int x, int y) | |
| 48 | ||
| 49 | ||
| 50 | // ======================> nes_control_port_device | |
| 51 | ||
| 52 | class nes_control_port_device : public device_t, | |
| 53 | public device_slot_interface | |
| 54 | { | |
| 55 | public: | |
| 56 | // construction/destruction | |
| 57 | nes_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 58 | virtual ~nes_control_port_device(); | |
| 59 | ||
| 60 | static void set_brightpixel_callback(device_t &device, nesctrl_brightpixel_delegate callback) { downcast<nes_control_port_device &>(device).m_brightpixel_cb = callback; } | |
| 61 | ||
| 62 | UINT8 read_bit0(); | |
| 63 | UINT8 read_bit34(); | |
| 64 | UINT8 read_exp(offs_t offset); | |
| 65 | void write(UINT8 data); | |
| 66 | ||
| 67 | nesctrl_brightpixel_delegate m_brightpixel_cb; | |
| 68 | ||
| 69 | protected: | |
| 70 | // device-level overrides | |
| 71 | virtual void device_start(); | |
| 72 | device_nes_control_port_interface *m_device; | |
| 73 | }; | |
| 74 | ||
| 75 | ||
| 76 | // device type definition | |
| 77 | extern const device_type NES_CONTROL_PORT; | |
| 78 | ||
| 79 | ||
| 80 | //************************************************************************** | |
| 81 | // INTERFACE CONFIGURATION MACROS | |
| 82 | //************************************************************************** | |
| 83 | ||
| 84 | #define MCFG_NES_CONTROL_PORT_ADD(_tag, _slot_intf, _def_slot) \ | |
| 85 | MCFG_DEVICE_ADD(_tag, NES_CONTROL_PORT, 0) \ | |
| 86 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) | |
| 87 | ||
| 88 | // currently this is emulated as a control port... | |
| 89 | #define MCFG_FC_EXPANSION_PORT_ADD(_tag, _slot_intf, _def_slot) \ | |
| 90 | MCFG_DEVICE_ADD(_tag, NES_CONTROL_PORT, 0) \ | |
| 91 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) | |
| 92 | ||
| 93 | #define MCFG_NESCTRL_BRIGHTPIXEL_CB(_class, _method) \ | |
| 94 | nes_control_port_device::set_brightpixel_callback(*device, nesctrl_brightpixel_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); | |
| 95 | ||
| 96 | ||
| 97 | SLOT_INTERFACE_EXTERN( nes_control_port1_devices ); | |
| 98 | SLOT_INTERFACE_EXTERN( nes_control_port2_devices ); | |
| 99 | SLOT_INTERFACE_EXTERN( fc_control_port1_devices ); | |
| 100 | SLOT_INTERFACE_EXTERN( fc_control_port2_devices ); | |
| 101 | SLOT_INTERFACE_EXTERN( fc_expansion_devices ); | |
| 102 | ||
| 103 | ||
| 104 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Keyboard Component | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "fckeybrd.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_FCKEYBOARD = &device_creator<nes_fckeybrd_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( fc_keyboard ) | |
| 20 | PORT_START("FCKEY.0") | |
| 21 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) | |
| 22 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) | |
| 23 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') | |
| 24 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') | |
| 25 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Kana") | |
| 26 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT) | |
| 27 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\\') | |
| 28 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Stop") PORT_CODE(KEYCODE_BACKSPACE) | |
| 29 | ||
| 30 | PORT_START("FCKEY.1") | |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) | |
| 32 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') | |
| 33 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') | |
| 34 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') | |
| 35 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('_') | |
| 36 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('/') | |
| 37 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') | |
| 38 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') | |
| 39 | ||
| 40 | PORT_START("FCKEY.2") | |
| 41 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) | |
| 42 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') | |
| 43 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') | |
| 44 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') | |
| 45 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') | |
| 46 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') | |
| 47 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') | |
| 48 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') | |
| 49 | ||
| 50 | PORT_START("FCKEY.3") | |
| 51 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) | |
| 52 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') | |
| 53 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') | |
| 54 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') | |
| 55 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') | |
| 56 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') | |
| 57 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') | |
| 58 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') | |
| 59 | ||
| 60 | PORT_START("FCKEY.4") | |
| 61 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) | |
| 62 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') | |
| 63 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') | |
| 64 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') | |
| 65 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') | |
| 66 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') | |
| 67 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') | |
| 68 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') | |
| 69 | ||
| 70 | PORT_START("FCKEY.5") | |
| 71 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) | |
| 72 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') | |
| 73 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') | |
| 74 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') | |
| 75 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') | |
| 76 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') | |
| 77 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') | |
| 78 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') | |
| 79 | ||
| 80 | PORT_START("FCKEY.6") | |
| 81 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) | |
| 82 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') | |
| 83 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') | |
| 84 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') | |
| 85 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') | |
| 86 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') | |
| 87 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') | |
| 88 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') | |
| 89 | ||
| 90 | PORT_START("FCKEY.7") | |
| 91 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) | |
| 92 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(ESC)) | |
| 93 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') | |
| 94 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) | |
| 95 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 96 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Grph") PORT_CODE(KEYCODE_LALT) | |
| 97 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') | |
| 98 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') | |
| 99 | ||
| 100 | PORT_START("FCKEY.8") | |
| 101 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Clr") | |
| 102 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) | |
| 103 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) | |
| 104 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) | |
| 105 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) | |
| 106 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') | |
| 107 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL) | |
| 108 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ins") PORT_CODE(KEYCODE_INSERT) | |
| 109 | INPUT_PORTS_END | |
| 110 | ||
| 111 | ||
| 112 | //------------------------------------------------- | |
| 113 | // input_ports - device-specific input ports | |
| 114 | //------------------------------------------------- | |
| 115 | ||
| 116 | ioport_constructor nes_fckeybrd_device::device_input_ports() const | |
| 117 | { | |
| 118 | return INPUT_PORTS_NAME( fc_keyboard ); | |
| 119 | } | |
| 120 | ||
| 121 | ||
| 122 | static MACHINE_CONFIG_FRAGMENT( fc_keyboard ) | |
| 123 | MCFG_CASSETTE_ADD("tape") | |
| 124 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) | |
| 125 | MCFG_CASSETTE_INTERFACE("fc_cass") | |
| 126 | MACHINE_CONFIG_END | |
| 127 | ||
| 128 | ||
| 129 | //------------------------------------------------- | |
| 130 | // machine_config_additions - device-specific | |
| 131 | // machine configurations | |
| 132 | //------------------------------------------------- | |
| 133 | ||
| 134 | machine_config_constructor nes_fckeybrd_device::device_mconfig_additions() const | |
| 135 | { | |
| 136 | return MACHINE_CONFIG_NAME( fc_keyboard ); | |
| 137 | } | |
| 138 | ||
| 139 | ||
| 140 | //************************************************************************** | |
| 141 | // LIVE DEVICE | |
| 142 | //************************************************************************** | |
| 143 | ||
| 144 | //------------------------------------------------- | |
| 145 | // nes_fckeybrd_device - constructor | |
| 146 | //------------------------------------------------- | |
| 147 | ||
| 148 | nes_fckeybrd_device::nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 149 | device_t(mconfig, NES_FCKEYBOARD, "Nintendo Family Computer Keyboard Component", tag, owner, clock, "nes_fckeybrd", __FILE__), | |
| 150 | device_nes_control_port_interface(mconfig, *this), | |
| 151 | m_cassette(*this, "tape"), | |
| 152 | m_kbd(*this, "FCKEY") | |
| 153 | { | |
| 154 | } | |
| 155 | ||
| 156 | ||
| 157 | //------------------------------------------------- | |
| 158 | // device_start | |
| 159 | //------------------------------------------------- | |
| 160 | ||
| 161 | void nes_fckeybrd_device::device_start() | |
| 162 | { | |
| 163 | save_item(NAME(m_fck_scan)); | |
| 164 | save_item(NAME(m_fck_mode)); | |
| 165 | } | |
| 166 | ||
| 167 | ||
| 168 | //------------------------------------------------- | |
| 169 | // device_reset | |
| 170 | //------------------------------------------------- | |
| 171 | ||
| 172 | void nes_fckeybrd_device::device_reset() | |
| 173 | { | |
| 174 | m_fck_scan = 0; | |
| 175 | m_fck_mode = 0; | |
| 176 | } | |
| 177 | ||
| 178 | ||
| 179 | //------------------------------------------------- | |
| 180 | // read | |
| 181 | //------------------------------------------------- | |
| 182 | ||
| 183 | UINT8 nes_fckeybrd_device::read_exp(offs_t offset) | |
| 184 | { | |
| 185 | UINT8 ret = 0; | |
| 186 | if (offset == 0) //$4016 | |
| 187 | { | |
| 188 | // FC Keyboard: tape input | |
| 189 | if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY) | |
| 190 | { | |
| 191 | double level = m_cassette->input(); | |
| 192 | if (level < 0) | |
| 193 | ret |= 0x00; | |
| 194 | else | |
| 195 | ret |= 0x02; | |
| 196 | } | |
| 197 | } | |
| 198 | else //$4017 | |
| 199 | { | |
| 200 | // FC Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4 | |
| 201 | if (m_fck_scan < 9) | |
| 202 | ret |= ~(((m_kbd[m_fck_scan]->read() >> (m_fck_mode * 4)) & 0x0f) << 1) & 0x1e; | |
| 203 | else | |
| 204 | ret |= 0x1e; | |
| 205 | } | |
| 206 | ||
| 207 | return ret; | |
| 208 | } | |
| 209 | ||
| 210 | //------------------------------------------------- | |
| 211 | // write | |
| 212 | //------------------------------------------------- | |
| 213 | ||
| 214 | void nes_fckeybrd_device::write(UINT8 data) | |
| 215 | { | |
| 216 | // tape output (not fully tested) | |
| 217 | if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_RECORD) | |
| 218 | m_cassette->output(((data & 0x07) == 0x07) ? +1.0 : -1.0); | |
| 219 | ||
| 220 | if (BIT(data, 2)) // keyboard active | |
| 221 | { | |
| 222 | UINT8 out = BIT(data, 1); // scan | |
| 223 | ||
| 224 | if (m_fck_mode && !out && ++m_fck_scan > 9) | |
| 225 | m_fck_scan = 0; | |
| 226 | ||
| 227 | m_fck_mode = out; // access lower or upper 4 bits | |
| 228 | ||
| 229 | if (BIT(data, 0)) // reset | |
| 230 | m_fck_scan = 0; | |
| 231 | } | |
| 232 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Keyboard Component | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_FCKEYBRD__ | |
| 13 | #define __NES_FCKEYBRD__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | #include "imagedev/cassette.h" | |
| 19 | ||
| 20 | //************************************************************************** | |
| 21 | // TYPE DEFINITIONS | |
| 22 | //************************************************************************** | |
| 23 | ||
| 24 | // ======================> nes_fckeybrd_device | |
| 25 | ||
| 26 | class nes_fckeybrd_device : public device_t, | |
| 27 | public device_nes_control_port_interface | |
| 28 | { | |
| 29 | public: | |
| 30 | // construction/destruction | |
| 31 | nes_fckeybrd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ||
| 33 | virtual ioport_constructor device_input_ports() const; | |
| 34 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 35 | ||
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_start(); | |
| 39 | virtual void device_reset(); | |
| 40 | ||
| 41 | virtual UINT8 read_exp(offs_t offset); | |
| 42 | virtual void write(UINT8 data); | |
| 43 | ||
| 44 | private: | |
| 45 | required_device<cassette_image_device> m_cassette; | |
| 46 | required_ioport_array<9> m_kbd; | |
| 47 | UINT8 m_fck_scan, m_fck_mode; | |
| 48 | }; | |
| 49 | ||
| 50 | ||
| 51 | // device type definition | |
| 52 | extern const device_type NES_FCKEYBOARD; | |
| 53 | ||
| 54 | ||
| 55 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer - Bandai Family Trainer Mat | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "ftrainer.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_FTRAINER = &device_creator<nes_ftrainer_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( nes_joypad ) | |
| 20 | PORT_START("LAYOUT") | |
| 21 | PORT_CONFNAME( 0x01, 0x00, "Family Trainer Button Layout") | |
| 22 | PORT_CONFSETTING( 0x00, "Side A" ) | |
| 23 | PORT_CONFSETTING( 0x01, "Side B" ) | |
| 24 | ||
| 25 | // difference between the two sides is that we mirror the key mapping to match the real pad layout! | |
| 26 | PORT_START("FT_COL.0") | |
| 27 | // side A layout | |
| 28 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 29 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid1") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 30 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 31 | // side B layout | |
| 32 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 33 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 34 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 35 | ||
| 36 | PORT_START("FT_COL.1") | |
| 37 | // side A layout | |
| 38 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low1") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 39 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid2") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 40 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top1") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 41 | // side B layout | |
| 42 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 43 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 44 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 45 | ||
| 46 | PORT_START("FT_COL.2") | |
| 47 | // side A layout | |
| 48 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low2") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 49 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid3") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 50 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top2") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 51 | // side B layout | |
| 52 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 53 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 54 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 55 | ||
| 56 | PORT_START("FT_COL.3") | |
| 57 | // side A layout | |
| 58 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 59 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid4") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 60 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 61 | // side B layout | |
| 62 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 63 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 64 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 65 | INPUT_PORTS_END | |
| 66 | ||
| 67 | ||
| 68 | //------------------------------------------------- | |
| 69 | // input_ports - device-specific input ports | |
| 70 | //------------------------------------------------- | |
| 71 | ||
| 72 | ioport_constructor nes_ftrainer_device::device_input_ports() const | |
| 73 | { | |
| 74 | return INPUT_PORTS_NAME( nes_joypad ); | |
| 75 | } | |
| 76 | ||
| 77 | ||
| 78 | ||
| 79 | //************************************************************************** | |
| 80 | // LIVE DEVICE | |
| 81 | //************************************************************************** | |
| 82 | ||
| 83 | //------------------------------------------------- | |
| 84 | // nes_ftrainer_device - constructor | |
| 85 | //------------------------------------------------- | |
| 86 | ||
| 87 | nes_ftrainer_device::nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 88 | device_t(mconfig, NES_FTRAINER, "Bandai Family Trainer", tag, owner, clock, "nes_famtrain", __FILE__), | |
| 89 | device_nes_control_port_interface(mconfig, *this), | |
| 90 | m_trainer(*this, "FT_COL") | |
| 91 | { | |
| 92 | } | |
| 93 | ||
| 94 | ||
| 95 | //------------------------------------------------- | |
| 96 | // device_start | |
| 97 | //------------------------------------------------- | |
| 98 | ||
| 99 | void nes_ftrainer_device::device_start() | |
| 100 | { | |
| 101 | save_item(NAME(m_row_scan)); | |
| 102 | } | |
| 103 | ||
| 104 | ||
| 105 | //------------------------------------------------- | |
| 106 | // device_reset | |
| 107 | //------------------------------------------------- | |
| 108 | ||
| 109 | void nes_ftrainer_device::device_reset() | |
| 110 | { | |
| 111 | m_row_scan = 0; | |
| 112 | } | |
| 113 | ||
| 114 | ||
| 115 | //------------------------------------------------- | |
| 116 | // read | |
| 117 | //------------------------------------------------- | |
| 118 | ||
| 119 | UINT8 nes_ftrainer_device::read_exp(offs_t offset) | |
| 120 | { | |
| 121 | UINT8 ret = 0; | |
| 122 | if (offset == 1) //$4017 | |
| 123 | { | |
| 124 | if (!BIT(m_row_scan, 0)) | |
| 125 | { | |
| 126 | // read low line: buttons 9,10,11,12 | |
| 127 | for (int i = 0; i < 4; i++) | |
| 128 | ret |= ((m_trainer[i]->read() & 0x01) << (1 + i)); | |
| 129 | } | |
| 130 | else if (!BIT(m_row_scan, 1)) | |
| 131 | { | |
| 132 | // read mid line: buttons 5,6,7,8 | |
| 133 | for (int i = 0; i < 4; i++) | |
| 134 | ret |= ((m_trainer[i]->read() & 0x02) << (1 + i)); | |
| 135 | } | |
| 136 | else if (!BIT(m_row_scan, 2)) | |
| 137 | { | |
| 138 | // read high line: buttons 1,2,3,4 | |
| 139 | for (int i = 0; i < 4; i++) | |
| 140 | ret |= ((m_trainer[i]->read() & 0x04) << (1 + i)); | |
| 141 | } | |
| 142 | } | |
| 143 | return ret; | |
| 144 | } | |
| 145 | ||
| 146 | //------------------------------------------------- | |
| 147 | // write | |
| 148 | //------------------------------------------------- | |
| 149 | ||
| 150 | void nes_ftrainer_device::write(UINT8 data) | |
| 151 | { | |
| 152 | // select row to scan | |
| 153 | m_row_scan = data & 0x07; | |
| 154 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer - Bandai Family Trainer Mat | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_FTRAINER__ | |
| 13 | #define __NES_FTRAINER__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_ftrainer_device | |
| 24 | ||
| 25 | class nes_ftrainer_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_ftrainer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_exp(offs_t offset); | |
| 40 | virtual void write(UINT8 data); | |
| 41 | ||
| 42 | private: | |
| 43 | required_ioport_array<4> m_trainer; | |
| 44 | UINT8 m_row_scan; | |
| 45 | }; | |
| 46 | ||
| 47 | ||
| 48 | // device type definition | |
| 49 | extern const device_type NES_FTRAINER; | |
| 50 | ||
| 51 | ||
| 52 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Hori Twin (and 4P?) adapters | |
| 4 | ||
| 5 | Emulation of the 4Players adapter is quite pointless: if 2P mode | |
| 6 | (default mode) it behaves like a Hori Twin adapter, in 4P mode | |
| 7 | it has P1 and P2 inputs overwriting the inputs coming from the | |
| 8 | main controllers (possibly creating a bit of confusion, since | |
| 9 | you get 6 sets of inputs with only 4 acknowledged by the running | |
| 10 | system). | |
| 11 | For the moment we keep it available for documentation purposes. | |
| 12 | ||
| 13 | TODO: find out confirmation whether in 2P mode, inputs from joypads | |
| 14 | connected to the 4players adapter are really seen as P3 and P4 inputs. | |
| 15 | it seems the most reasonable setup (so that users with only 2 | |
| 16 | external pads can use the adapter in 4P games), but one never knows... | |
| 17 | ||
| 18 | Copyright MESS Team. | |
| 19 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 20 | ||
| 21 | **********************************************************************/ | |
| 22 | ||
| 23 | #include "hori.h" | |
| 24 | #include "joypad.h" | |
| 25 | ||
| 26 | //************************************************************************** | |
| 27 | // DEVICE DEFINITIONS | |
| 28 | //************************************************************************** | |
| 29 | ||
| 30 | const device_type NES_HORITWIN = &device_creator<nes_horitwin_device>; | |
| 31 | const device_type NES_HORI4P = &device_creator<nes_hori4p_device>; | |
| 32 | ||
| 33 | ||
| 34 | static INPUT_PORTS_START( nes_hori4p ) | |
| 35 | PORT_START("CONFIG") | |
| 36 | PORT_CONFNAME( 0x01, 0x00, "4 Players / 2 Players") | |
| 37 | PORT_CONFSETTING( 0x00, "2 Players" ) | |
| 38 | PORT_CONFSETTING( 0x01, "4 Players" ) | |
| 39 | INPUT_PORTS_END | |
| 40 | ||
| 41 | ||
| 42 | //------------------------------------------------- | |
| 43 | // input_ports - device-specific input ports | |
| 44 | //------------------------------------------------- | |
| 45 | ||
| 46 | ioport_constructor nes_hori4p_device::device_input_ports() const | |
| 47 | { | |
| 48 | return INPUT_PORTS_NAME( nes_hori4p ); | |
| 49 | } | |
| 50 | ||
| 51 | ||
| 52 | static SLOT_INTERFACE_START( hori_adapter ) | |
| 53 | SLOT_INTERFACE("joypad", NES_JOYPAD) | |
| 54 | SLOT_INTERFACE_END | |
| 55 | ||
| 56 | static MACHINE_CONFIG_FRAGMENT( horitwin ) | |
| 57 | MCFG_FC_EXPANSION_PORT_ADD("port1", hori_adapter, "joypad") | |
| 58 | MCFG_FC_EXPANSION_PORT_ADD("port2", hori_adapter, "joypad") | |
| 59 | MACHINE_CONFIG_END | |
| 60 | ||
| 61 | static MACHINE_CONFIG_FRAGMENT( hori4p ) | |
| 62 | MCFG_FC_EXPANSION_PORT_ADD("port1", hori_adapter, "joypad") | |
| 63 | MCFG_FC_EXPANSION_PORT_ADD("port2", hori_adapter, "joypad") | |
| 64 | MCFG_FC_EXPANSION_PORT_ADD("port3", hori_adapter, "joypad") | |
| 65 | MCFG_FC_EXPANSION_PORT_ADD("port4", hori_adapter, "joypad") | |
| 66 | MACHINE_CONFIG_END | |
| 67 | ||
| 68 | ||
| 69 | //------------------------------------------------- | |
| 70 | // machine_config_additions - device-specific | |
| 71 | // machine configurations | |
| 72 | //------------------------------------------------- | |
| 73 | ||
| 74 | machine_config_constructor nes_horitwin_device::device_mconfig_additions() const | |
| 75 | { | |
| 76 | return MACHINE_CONFIG_NAME( horitwin ); | |
| 77 | } | |
| 78 | ||
| 79 | machine_config_constructor nes_hori4p_device::device_mconfig_additions() const | |
| 80 | { | |
| 81 | return MACHINE_CONFIG_NAME( hori4p ); | |
| 82 | } | |
| 83 | ||
| 84 | ||
| 85 | //************************************************************************** | |
| 86 | // LIVE DEVICE | |
| 87 | //************************************************************************** | |
| 88 | ||
| 89 | //------------------------------------------------- | |
| 90 | // nes_horitwin_device - constructor | |
| 91 | //------------------------------------------------- | |
| 92 | ||
| 93 | nes_horitwin_device::nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 94 | device_t(mconfig, NES_HORITWIN, "Hori Twin Adapter", tag, owner, clock, "nes_horitwin", __FILE__), | |
| 95 | device_nes_control_port_interface(mconfig, *this), | |
| 96 | m_port1(*this, "port1"), | |
| 97 | m_port2(*this, "port2") | |
| 98 | { | |
| 99 | } | |
| 100 | ||
| 101 | nes_hori4p_device::nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 102 | device_t(mconfig, NES_HORI4P, "Hori 4P Adapter", tag, owner, clock, "nes_hori4p", __FILE__), | |
| 103 | device_nes_control_port_interface(mconfig, *this), | |
| 104 | m_port1(*this, "port1"), | |
| 105 | m_port2(*this, "port2"), | |
| 106 | m_port3(*this, "port3"), | |
| 107 | m_port4(*this, "port4"), | |
| 108 | m_cfg(*this, "CONFIG") | |
| 109 | { | |
| 110 | } | |
| 111 | ||
| 112 | ||
| 113 | //------------------------------------------------- | |
| 114 | // read | |
| 115 | //------------------------------------------------- | |
| 116 | ||
| 117 | UINT8 nes_horitwin_device::read_exp(offs_t offset) | |
| 118 | { | |
| 119 | UINT8 ret = 0; | |
| 120 | if (offset == 0) //$4016 | |
| 121 | ret |= (m_port1->read_bit0() << 1); | |
| 122 | else //$4017 | |
| 123 | ret |= (m_port2->read_bit0() << 1); | |
| 124 | return ret; | |
| 125 | } | |
| 126 | ||
| 127 | UINT8 nes_hori4p_device::read_exp(offs_t offset) | |
| 128 | { | |
| 129 | UINT8 ret = 0; | |
| 130 | if (m_cfg->read() == 0) // 2P | |
| 131 | { | |
| 132 | if (offset == 0) //$4016 | |
| 133 | ret |= (m_port1->read_bit0() << 1); | |
| 134 | else //$4017 | |
| 135 | ret |= (m_port2->read_bit0() << 1); | |
| 136 | } | |
| 137 | else // 4P | |
| 138 | { | |
| 139 | if (offset == 0) //$4016 | |
| 140 | { | |
| 141 | ret |= (m_port1->read_bit0() << 0); | |
| 142 | ret |= (m_port3->read_bit0() << 1); | |
| 143 | } | |
| 144 | else //$4017 | |
| 145 | { | |
| 146 | ret |= (m_port2->read_bit0() << 0); | |
| 147 | ret |= (m_port4->read_bit0() << 1); | |
| 148 | } | |
| 149 | } | |
| 150 | return ret; | |
| 151 | } | |
| 152 | ||
| 153 | //------------------------------------------------- | |
| 154 | // write | |
| 155 | //------------------------------------------------- | |
| 156 | ||
| 157 | void nes_horitwin_device::write(UINT8 data) | |
| 158 | { | |
| 159 | m_port1->write(data); | |
| 160 | m_port2->write(data); | |
| 161 | } | |
| 162 | ||
| 163 | void nes_hori4p_device::write(UINT8 data) | |
| 164 | { | |
| 165 | m_port1->write(data); | |
| 166 | m_port2->write(data); | |
| 167 | m_port3->write(data); | |
| 168 | m_port4->write(data); | |
| 169 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Hori Twin (and 4P?) adapters | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_HORI__ | |
| 13 | #define __NES_HORI__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_horitwin_device | |
| 24 | ||
| 25 | class nes_horitwin_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_horitwin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start() {} | |
| 37 | ||
| 38 | virtual UINT8 read_exp(offs_t offset); | |
| 39 | virtual void write(UINT8 data); | |
| 40 | ||
| 41 | private: | |
| 42 | required_device<nes_control_port_device> m_port1; | |
| 43 | required_device<nes_control_port_device> m_port2; | |
| 44 | }; | |
| 45 | ||
| 46 | // ======================> nes_hori4p_device | |
| 47 | ||
| 48 | class nes_hori4p_device : public device_t, | |
| 49 | public device_nes_control_port_interface | |
| 50 | { | |
| 51 | public: | |
| 52 | // construction/destruction | |
| 53 | nes_hori4p_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 54 | ||
| 55 | virtual ioport_constructor device_input_ports() const; | |
| 56 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 57 | ||
| 58 | protected: | |
| 59 | // device-level overrides | |
| 60 | virtual void device_start() {} | |
| 61 | ||
| 62 | virtual UINT8 read_exp(offs_t offset); | |
| 63 | virtual void write(UINT8 data); | |
| 64 | ||
| 65 | private: | |
| 66 | required_device<nes_control_port_device> m_port1; | |
| 67 | required_device<nes_control_port_device> m_port2; | |
| 68 | required_device<nes_control_port_device> m_port3; | |
| 69 | required_device<nes_control_port_device> m_port4; | |
| 70 | required_ioport m_cfg; | |
| 71 | }; | |
| 72 | ||
| 73 | ||
| 74 | // device type definition | |
| 75 | extern const device_type NES_HORITWIN; | |
| 76 | extern const device_type NES_HORI4P; | |
| 77 | ||
| 78 | ||
| 79 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System Joypads | |
| 4 | ||
| 5 | The original Famicom had two hardwired controller, with the second | |
| 6 | controller slightly different from the first one: it featured no | |
| 7 | Start nor Select buttons, but had a built-in microphone (with | |
| 8 | very limited capabilities, since it basically only detected two | |
| 9 | states: something blowing into it / nothing blowing into it) for | |
| 10 | some games to react to users "talking" into it | |
| 11 | ||
| 12 | Crazy Climber Pads are not really a kind of separate controllers, | |
| 13 | but just a couple of small sticks to be put on top of d-pads of | |
| 14 | the regular controllers. Users should then control the game by | |
| 15 | using both controllers, turned 90 degrees, as a couple of dual | |
| 16 | sticks like in the arcade control panel. However, we emulate them | |
| 17 | separately so to map the controls to a friendlier default. | |
| 18 | ||
| 19 | The Arcade Stick we emulate is a controller (apparently manufactured | |
| 20 | by Hori, but possibly licensed by Nintendo, since it use the official | |
| 21 | logo and brand) which fits into the expansion port and allows to | |
| 22 | daisy chain a second controller to the first one, to play 4players | |
| 23 | game (an image of such connection is shown e.g. in Nekketsu Koukou | |
| 24 | Dodgeball Bu manual) | |
| 25 | ||
| 26 | Copyright MESS Team. | |
| 27 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 28 | ||
| 29 | **********************************************************************/ | |
| 30 | ||
| 31 | #include "joypad.h" | |
| 32 | ||
| 33 | //************************************************************************** | |
| 34 | // DEVICE DEFINITIONS | |
| 35 | //************************************************************************** | |
| 36 | ||
| 37 | const device_type NES_JOYPAD = &device_creator<nes_joypad_device>; | |
| 38 | const device_type NES_FCPAD_P2 = &device_creator<nes_fcpad2_device>; | |
| 39 | const device_type NES_CCPAD_LEFT = &device_creator<nes_ccpadl_device>; | |
| 40 | const device_type NES_CCPAD_RIGHT = &device_creator<nes_ccpadr_device>; | |
| 41 | const device_type NES_ARCSTICK = &device_creator<nes_arcstick_device>; | |
| 42 | ||
| 43 | ||
| 44 | static INPUT_PORTS_START( nes_joypad ) | |
| 45 | PORT_START("JOYPAD") | |
| 46 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") | |
| 47 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") | |
| 48 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) | |
| 49 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) | |
| 50 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 51 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 52 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 53 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 54 | INPUT_PORTS_END | |
| 55 | ||
| 56 | static INPUT_PORTS_START( nes_fcpad_p2 ) | |
| 57 | PORT_START("JOYPAD") | |
| 58 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") | |
| 59 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") | |
| 60 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Microphone") | |
| 61 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 62 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 63 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 64 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 65 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 66 | INPUT_PORTS_END | |
| 67 | ||
| 68 | static INPUT_PORTS_START( nes_ccpad_left ) | |
| 69 | PORT_START("JOYPAD") | |
| 70 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 71 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 72 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) | |
| 73 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) | |
| 74 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_8WAY | |
| 75 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_8WAY | |
| 76 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_8WAY | |
| 77 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY | |
| 78 | INPUT_PORTS_END | |
| 79 | ||
| 80 | static INPUT_PORTS_START( nes_ccpad_right ) | |
| 81 | PORT_START("JOYPAD") | |
| 82 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 83 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 84 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 85 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 86 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_8WAY | |
| 87 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_8WAY | |
| 88 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_8WAY | |
| 89 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_8WAY | |
| 90 | INPUT_PORTS_END | |
| 91 | ||
| 92 | static INPUT_PORTS_START( nes_arcstick ) | |
| 93 | PORT_START("CONFIG") | |
| 94 | PORT_CONFNAME( 0x01, 0x01, "4 Way / 8 Way Joystick") | |
| 95 | PORT_CONFSETTING( 0x00, "4 Way" ) | |
| 96 | PORT_CONFSETTING( 0x01, "8 Way" ) | |
| 97 | PORT_CONFNAME( 0x02, 0x00, "Player ID") | |
| 98 | PORT_CONFSETTING( 0x00, "Player I" ) | |
| 99 | PORT_CONFSETTING( 0x02, "Player II" ) | |
| 100 | ||
| 101 | PORT_START("JOYPAD") | |
| 102 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") | |
| 103 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") | |
| 104 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) | |
| 105 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) | |
| 106 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01) | |
| 107 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01) | |
| 108 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01) | |
| 109 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x01) | |
| 110 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00) | |
| 111 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00) | |
| 112 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00) | |
| 113 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_CONDITION("CONFIG", 0x01, EQUALS, 0x00) | |
| 114 | INPUT_PORTS_END | |
| 115 | ||
| 116 | //------------------------------------------------- | |
| 117 | // input_ports - device-specific input ports | |
| 118 | //------------------------------------------------- | |
| 119 | ||
| 120 | ioport_constructor nes_joypad_device::device_input_ports() const | |
| 121 | { | |
| 122 | return INPUT_PORTS_NAME( nes_joypad ); | |
| 123 | } | |
| 124 | ||
| 125 | ioport_constructor nes_fcpad2_device::device_input_ports() const | |
| 126 | { | |
| 127 | return INPUT_PORTS_NAME( nes_fcpad_p2 ); | |
| 128 | } | |
| 129 | ||
| 130 | ioport_constructor nes_ccpadl_device::device_input_ports() const | |
| 131 | { | |
| 132 | return INPUT_PORTS_NAME( nes_ccpad_left ); | |
| 133 | } | |
| 134 | ||
| 135 | ioport_constructor nes_ccpadr_device::device_input_ports() const | |
| 136 | { | |
| 137 | return INPUT_PORTS_NAME( nes_ccpad_right ); | |
| 138 | } | |
| 139 | ||
| 140 | ioport_constructor nes_arcstick_device::device_input_ports() const | |
| 141 | { | |
| 142 | return INPUT_PORTS_NAME( nes_arcstick ); | |
| 143 | } | |
| 144 | ||
| 145 | ||
| 146 | ||
| 147 | static SLOT_INTERFACE_START( arcstick_daisy ) | |
| 148 | SLOT_INTERFACE("arcstick", NES_ARCSTICK) | |
| 149 | SLOT_INTERFACE_END | |
| 150 | ||
| 151 | static MACHINE_CONFIG_FRAGMENT( arcstick ) | |
| 152 | // expansion port to allow daisy chaining | |
| 153 | MCFG_FC_EXPANSION_PORT_ADD("subexp", arcstick_daisy, NULL) | |
| 154 | MACHINE_CONFIG_END | |
| 155 | ||
| 156 | ||
| 157 | //------------------------------------------------- | |
| 158 | // machine_config_additions - device-specific | |
| 159 | // machine configurations | |
| 160 | //------------------------------------------------- | |
| 161 | ||
| 162 | machine_config_constructor nes_arcstick_device::device_mconfig_additions() const | |
| 163 | { | |
| 164 | return MACHINE_CONFIG_NAME( arcstick ); | |
| 165 | } | |
| 166 | ||
| 167 | ||
| 168 | ||
| 169 | //************************************************************************** | |
| 170 | // LIVE DEVICE | |
| 171 | //************************************************************************** | |
| 172 | ||
| 173 | //------------------------------------------------- | |
| 174 | // nes_joypad_device - constructor | |
| 175 | //------------------------------------------------- | |
| 176 | ||
| 177 | nes_joypad_device::nes_joypad_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : | |
| 178 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 179 | device_nes_control_port_interface(mconfig, *this), | |
| 180 | m_joypad(*this, "JOYPAD") | |
| 181 | { | |
| 182 | } | |
| 183 | ||
| 184 | nes_joypad_device::nes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 185 | device_t(mconfig, NES_JOYPAD, "Nintendo NES / FC Control Pad", tag, owner, clock, "nes_joypad", __FILE__), | |
| 186 | device_nes_control_port_interface(mconfig, *this), | |
| 187 | m_joypad(*this, "JOYPAD") | |
| 188 | { | |
| 189 | } | |
| 190 | ||
| 191 | nes_fcpad2_device::nes_fcpad2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 192 | nes_joypad_device(mconfig, NES_FCPAD_P2, "Nintendo Family Computer P2 Pad", tag, owner, clock, "nes_fcpad2", __FILE__) | |
| 193 | { | |
| 194 | } | |
| 195 | ||
| 196 | nes_ccpadl_device::nes_ccpadl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 197 | nes_joypad_device(mconfig, NES_CCPAD_LEFT, "Crazy Climber Left Pad", tag, owner, clock, "nes_ccpadl", __FILE__) | |
| 198 | { | |
| 199 | } | |
| 200 | ||
| 201 | nes_ccpadr_device::nes_ccpadr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 202 | nes_joypad_device(mconfig, NES_CCPAD_RIGHT, "Crazy Climber Right Pad", tag, owner, clock, "nes_ccpadr", __FILE__) | |
| 203 | { | |
| 204 | } | |
| 205 | ||
| 206 | nes_arcstick_device::nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 207 | nes_joypad_device(mconfig, NES_ARCSTICK, "Nintendo Family Computer Arcade Stick", tag, owner, clock, "nes_arcstick", __FILE__), | |
| 208 | m_daisychain(*this, "subexp"), | |
| 209 | m_cfg(*this, "CONFIG") | |
| 210 | { | |
| 211 | } | |
| 212 | ||
| 213 | ||
| 214 | //------------------------------------------------- | |
| 215 | // device_start | |
| 216 | //------------------------------------------------- | |
| 217 | ||
| 218 | void nes_joypad_device::device_start() | |
| 219 | { | |
| 220 | save_item(NAME(m_latch)); | |
| 221 | } | |
| 222 | ||
| 223 | ||
| 224 | //------------------------------------------------- | |
| 225 | // device_reset | |
| 226 | //------------------------------------------------- | |
| 227 | ||
| 228 | void nes_joypad_device::device_reset() | |
| 229 | { | |
| 230 | m_latch = 0; | |
| 231 | } | |
| 232 | ||
| 233 | ||
| 234 | //------------------------------------------------- | |
| 235 | // read | |
| 236 | //------------------------------------------------- | |
| 237 | ||
| 238 | UINT8 nes_joypad_device::read_bit0() | |
| 239 | { | |
| 240 | UINT8 ret = m_latch & 1; | |
| 241 | m_latch >>= 1; | |
| 242 | return ret; | |
| 243 | } | |
| 244 | ||
| 245 | UINT8 nes_fcpad2_device::read_exp(offs_t offset) | |
| 246 | { | |
| 247 | UINT8 ret = 0; | |
| 248 | if (!offset) // microphone input | |
| 249 | ret |= m_joypad->read() & 0x04; | |
| 250 | ||
| 251 | return ret; | |
| 252 | } | |
| 253 | ||
| 254 | // NOTE: I haven't found any documentation about what happens when | |
| 255 | // users connect two arcade stick both set as P1 or P2 in config. | |
| 256 | // does the FC only acknowledge the first one, or do they conflict | |
| 257 | // with each other? currently, we only support the following setup: | |
| 258 | // if the first pad is set as P1, the daisy chained pad is checked | |
| 259 | // for P2 only, and vice versa. | |
| 260 | UINT8 nes_arcstick_device::read_exp(offs_t offset) | |
| 261 | { | |
| 262 | UINT8 ret = 0; | |
| 263 | if (offset == 0) //$4016 | |
| 264 | { | |
| 265 | if ((m_cfg->read() & 2) == 0) // we are P1 input | |
| 266 | { | |
| 267 | ret |= (m_latch & 1) << 1; | |
| 268 | m_latch >>= 1; | |
| 269 | } | |
| 270 | else | |
| 271 | ret |= m_daisychain->read_exp(0); | |
| 272 | } | |
| 273 | else //$4017 | |
| 274 | { | |
| 275 | if ((m_cfg->read() & 2) == 2) // we are P2 input | |
| 276 | { | |
| 277 | ret |= (m_latch & 1) << 1; | |
| 278 | m_latch >>= 1; | |
| 279 | } | |
| 280 | else | |
| 281 | ret |= m_daisychain->read_exp(1); | |
| 282 | } | |
| 283 | ||
| 284 | return ret; | |
| 285 | } | |
| 286 | ||
| 287 | //------------------------------------------------- | |
| 288 | // write | |
| 289 | //------------------------------------------------- | |
| 290 | ||
| 291 | void nes_joypad_device::write(UINT8 data) | |
| 292 | { | |
| 293 | if (data & 0x01) | |
| 294 | return; | |
| 295 | ||
| 296 | m_latch = m_joypad->read(); | |
| 297 | } | |
| 298 | ||
| 299 | void nes_fcpad2_device::write(UINT8 data) | |
| 300 | { | |
| 301 | if (data & 0x01) | |
| 302 | return; | |
| 303 | ||
| 304 | // microphone is hooked to expansion bits, not to the controller bit | |
| 305 | m_latch = m_joypad->read() & ~0x04; | |
| 306 | } | |
| 307 | ||
| 308 | void nes_arcstick_device::write(UINT8 data) | |
| 309 | { | |
| 310 | m_daisychain->write(data); | |
| 311 | ||
| 312 | if (data & 0x01) | |
| 313 | return; | |
| 314 | ||
| 315 | m_latch = m_joypad->read(); | |
| 316 | } | |
| 317 |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System Joypads | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_JOYPAD__ | |
| 13 | #define __NES_JOYPAD__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_joypad_device | |
| 24 | ||
| 25 | class nes_joypad_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_joypad_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); | |
| 31 | nes_joypad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ||
| 33 | virtual ioport_constructor device_input_ports() const; | |
| 34 | ||
| 35 | protected: | |
| 36 | // device-level overrides | |
| 37 | virtual void device_start(); | |
| 38 | virtual void device_reset(); | |
| 39 | ||
| 40 | virtual UINT8 read_bit0(); | |
| 41 | virtual void write(UINT8 data); | |
| 42 | ||
| 43 | required_ioport m_joypad; | |
| 44 | UINT32 m_latch; | |
| 45 | }; | |
| 46 | ||
| 47 | // ======================> nes_fcpad2_device | |
| 48 | ||
| 49 | class nes_fcpad2_device : public nes_joypad_device | |
| 50 | { | |
| 51 | public: | |
| 52 | // construction/destruction | |
| 53 | nes_fcpad2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 54 | ||
| 55 | virtual ioport_constructor device_input_ports() const; | |
| 56 | ||
| 57 | protected: | |
| 58 | virtual UINT8 read_exp(offs_t offset); | |
| 59 | virtual void write(UINT8 data); | |
| 60 | }; | |
| 61 | ||
| 62 | // ======================> nes_ccpadl_device | |
| 63 | ||
| 64 | class nes_ccpadl_device : public nes_joypad_device | |
| 65 | { | |
| 66 | public: | |
| 67 | // construction/destruction | |
| 68 | nes_ccpadl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 69 | ||
| 70 | virtual ioport_constructor device_input_ports() const; | |
| 71 | }; | |
| 72 | ||
| 73 | // ======================> nes_ccpadr_device | |
| 74 | ||
| 75 | class nes_ccpadr_device : public nes_joypad_device | |
| 76 | { | |
| 77 | public: | |
| 78 | // construction/destruction | |
| 79 | nes_ccpadr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 80 | ||
| 81 | virtual ioport_constructor device_input_ports() const; | |
| 82 | }; | |
| 83 | ||
| 84 | // ======================> nes_arcstick_device | |
| 85 | ||
| 86 | class nes_arcstick_device : public nes_joypad_device | |
| 87 | { | |
| 88 | public: | |
| 89 | // construction/destruction | |
| 90 | nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 91 | ||
| 92 | virtual ioport_constructor device_input_ports() const; | |
| 93 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 94 | ||
| 95 | protected: | |
| 96 | virtual UINT8 read_bit0() { return 0; } | |
| 97 | virtual UINT8 read_exp(offs_t offset); | |
| 98 | virtual void write(UINT8 data); | |
| 99 | ||
| 100 | required_device<nes_control_port_device> m_daisychain; | |
| 101 | required_ioport m_cfg; | |
| 102 | }; | |
| 103 | ||
| 104 | ||
| 105 | // device type definition | |
| 106 | extern const device_type NES_JOYPAD; | |
| 107 | extern const device_type NES_FCPAD_P2; | |
| 108 | extern const device_type NES_CCPAD_LEFT; | |
| 109 | extern const device_type NES_CCPAD_RIGHT; | |
| 110 | extern const device_type NES_ARCSTICK; | |
| 111 | ||
| 112 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Konami Hyper Shot Controllers | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "konamihs.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_KONAMIHS = &device_creator<nes_konamihs_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( nes_konamihs ) | |
| 20 | PORT_START("P1") | |
| 21 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("PI Run") | |
| 22 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("PI Jump") | |
| 23 | ||
| 24 | PORT_START("P2") | |
| 25 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("PII Run") | |
| 26 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("PII Jump") | |
| 27 | INPUT_PORTS_END | |
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // input_ports - device-specific input ports | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | ioport_constructor nes_konamihs_device::device_input_ports() const | |
| 34 | { | |
| 35 | return INPUT_PORTS_NAME( nes_konamihs ); | |
| 36 | } | |
| 37 | ||
| 38 | //************************************************************************** | |
| 39 | // LIVE DEVICE | |
| 40 | //************************************************************************** | |
| 41 | ||
| 42 | //------------------------------------------------- | |
| 43 | // nes_konamihs_device - constructor | |
| 44 | //------------------------------------------------- | |
| 45 | ||
| 46 | nes_konamihs_device::nes_konamihs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 47 | device_t(mconfig, NES_KONAMIHS, "Konami Hyper Shot Controller", tag, owner, clock, "nes_konamihs", __FILE__), | |
| 48 | device_nes_control_port_interface(mconfig, *this), | |
| 49 | m_ipt_p1(*this, "P1"), | |
| 50 | m_ipt_p2(*this, "P2") | |
| 51 | { | |
| 52 | } | |
| 53 | ||
| 54 | ||
| 55 | //------------------------------------------------- | |
| 56 | // device_start | |
| 57 | //------------------------------------------------- | |
| 58 | ||
| 59 | void nes_konamihs_device::device_start() | |
| 60 | { | |
| 61 | save_item(NAME(m_latch_p1)); | |
| 62 | save_item(NAME(m_latch_p2)); | |
| 63 | } | |
| 64 | ||
| 65 | ||
| 66 | //------------------------------------------------- | |
| 67 | // device_reset | |
| 68 | //------------------------------------------------- | |
| 69 | ||
| 70 | void nes_konamihs_device::device_reset() | |
| 71 | { | |
| 72 | m_latch_p1 = 0; | |
| 73 | m_latch_p2 = 0; | |
| 74 | } | |
| 75 | ||
| 76 | ||
| 77 | //------------------------------------------------- | |
| 78 | // read | |
| 79 | //------------------------------------------------- | |
| 80 | ||
| 81 | UINT8 nes_konamihs_device::read_exp(offs_t offset) | |
| 82 | { | |
| 83 | UINT8 ret = 0; | |
| 84 | if (offset == 1) //$4017 | |
| 85 | { | |
| 86 | ret |= m_latch_p1 << 1; | |
| 87 | ret |= m_latch_p2 << 3; | |
| 88 | } | |
| 89 | return ret; | |
| 90 | } | |
| 91 | ||
| 92 | //------------------------------------------------- | |
| 93 | // write | |
| 94 | //------------------------------------------------- | |
| 95 | ||
| 96 | void nes_konamihs_device::write(UINT8 data) | |
| 97 | { | |
| 98 | if ((data & 0x02) == 0) | |
| 99 | m_latch_p1 = m_ipt_p1->read(); | |
| 100 | if ((data & 0x04) == 0) | |
| 101 | m_latch_p2 = m_ipt_p2->read(); | |
| 102 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Konami Hyper Shot Controllers | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_KONAMIHS__ | |
| 13 | #define __NES_KONAMIHS__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_konamihs_device | |
| 24 | ||
| 25 | class nes_konamihs_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_konamihs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_exp(offs_t offset); | |
| 40 | virtual void write(UINT8 data); | |
| 41 | ||
| 42 | required_ioport m_ipt_p1; | |
| 43 | required_ioport m_ipt_p2; | |
| 44 | UINT32 m_latch_p1, m_latch_p2; | |
| 45 | }; | |
| 46 | ||
| 47 | // device type definition | |
| 48 | extern const device_type NES_KONAMIHS; | |
| 49 | ||
| 50 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Entertainment System - Miracle Piano Keyboard | |
| 4 | ||
| 5 | TODO: basically everything, this is just a skeleton with no | |
| 6 | real MIDI handling at the moment. | |
| 7 | ||
| 8 | Copyright MESS Team. | |
| 9 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 10 | ||
| 11 | **********************************************************************/ | |
| 12 | ||
| 13 | #include "miracle.h" | |
| 14 | #include "bus/midi/midi.h" | |
| 15 | ||
| 16 | #define MIRACLE_MIDI_WAITING 0 | |
| 17 | #define MIRACLE_MIDI_RECEIVE 1 | |
| 18 | #define MIRACLE_MIDI_SEND 2 | |
| 19 | ||
| 20 | //************************************************************************** | |
| 21 | // DEVICE DEFINITIONS | |
| 22 | //************************************************************************** | |
| 23 | ||
| 24 | const device_type NES_MIRACLE = &device_creator<nes_miracle_device>; | |
| 25 | ||
| 26 | ||
| 27 | MACHINE_CONFIG_FRAGMENT( nes_miracle ) | |
| 28 | // MCFG_CPU_ADD("piano_cpu", I8051, XTAL_11_0592MHz) // xtal to be verified | |
| 29 | ||
| 30 | MCFG_MIDI_PORT_ADD("mdin", midiin_slot, "midiin") | |
| 31 | MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") | |
| 32 | MACHINE_CONFIG_END | |
| 33 | ||
| 34 | machine_config_constructor nes_miracle_device::device_mconfig_additions() const | |
| 35 | { | |
| 36 | return MACHINE_CONFIG_NAME( nes_miracle ); | |
| 37 | } | |
| 38 | ||
| 39 | ||
| 40 | //------------------------------------------------- | |
| 41 | // device_timer - handler timer events | |
| 42 | //------------------------------------------------- | |
| 43 | ||
| 44 | void nes_miracle_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
| 45 | { | |
| 46 | if (id == TIMER_STROBE_ON) | |
| 47 | { | |
| 48 | m_strobe_clock++; | |
| 49 | } | |
| 50 | } | |
| 51 | ||
| 52 | //************************************************************************** | |
| 53 | // LIVE DEVICE | |
| 54 | //************************************************************************** | |
| 55 | ||
| 56 | //------------------------------------------------- | |
| 57 | // nes_miracle_device - constructor | |
| 58 | //------------------------------------------------- | |
| 59 | ||
| 60 | nes_miracle_device::nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 61 | device_t(mconfig, NES_MIRACLE, "Miracle Piano Controller", tag, owner, clock, "nes_miracle", __FILE__) | |
| 62 | , device_nes_control_port_interface(mconfig, *this) | |
| 63 | // , m_cpu(*this, "piano_cpu") | |
| 64 | { | |
| 65 | } | |
| 66 | ||
| 67 | ||
| 68 | //------------------------------------------------- | |
| 69 | // device_start | |
| 70 | //------------------------------------------------- | |
| 71 | ||
| 72 | void nes_miracle_device::device_start() | |
| 73 | { | |
| 74 | strobe_timer = timer_alloc(TIMER_STROBE_ON); | |
| 75 | strobe_timer->adjust(attotime::never); | |
| 76 | save_item(NAME(m_strobe_on)); | |
| 77 | save_item(NAME(m_sent_bits)); | |
| 78 | save_item(NAME(m_strobe_clock)); | |
| 79 | save_item(NAME(m_midi_mode)); | |
| 80 | } | |
| 81 | ||
| 82 | ||
| 83 | //------------------------------------------------- | |
| 84 | // device_reset | |
| 85 | //------------------------------------------------- | |
| 86 | ||
| 87 | void nes_miracle_device::device_reset() | |
| 88 | { | |
| 89 | m_strobe_on = 0; | |
| 90 | m_sent_bits = 0; | |
| 91 | m_strobe_clock = 0; | |
| 92 | m_midi_mode = MIRACLE_MIDI_WAITING; | |
| 93 | } | |
| 94 | ||
| 95 | ||
| 96 | //------------------------------------------------- | |
| 97 | // read | |
| 98 | //------------------------------------------------- | |
| 99 | ||
| 100 | // TODO: here, reads from serial midi in bit0, when in MIDI_SEND mode | |
| 101 | ||
| 102 | UINT8 nes_miracle_device::read_bit0() | |
| 103 | { | |
| 104 | UINT8 ret = 0; | |
| 105 | if (m_strobe_clock >= 66) | |
| 106 | { | |
| 107 | // more than 66 clocks since strobe on write means send mode | |
| 108 | m_midi_mode = MIRACLE_MIDI_SEND; | |
| 109 | strobe_timer->reset(); | |
| 110 | m_strobe_on = 0; | |
| 111 | m_strobe_clock = 0; | |
| 112 | // printf("send start\n"); | |
| 113 | } | |
| 114 | ||
| 115 | if (m_midi_mode == MIRACLE_MIDI_SEND) | |
| 116 | { | |
| 117 | //NES reads from Miracle Piano! | |
| 118 | // ret |= ... | |
| 119 | } | |
| 120 | ||
| 121 | return ret; | |
| 122 | } | |
| 123 | ||
| 124 | //------------------------------------------------- | |
| 125 | // write | |
| 126 | //------------------------------------------------- | |
| 127 | ||
| 128 | // TODO: here, writes to serial midi in bit0, when in MIDI_RECEIVE mode | |
| 129 | ||
| 130 | void nes_miracle_device::write(UINT8 data) | |
| 131 | { | |
| 132 | if (data == 1 && !m_strobe_on) | |
| 133 | { | |
| 134 | strobe_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1)); | |
| 135 | m_strobe_on = 1; | |
| 136 | return; | |
| 137 | } | |
| 138 | ||
| 139 | if (m_strobe_on) | |
| 140 | { | |
| 141 | // was timer running? | |
| 142 | if (m_strobe_clock > 0) | |
| 143 | { | |
| 144 | if (m_strobe_clock < 66 && data == 0) | |
| 145 | { | |
| 146 | // less than 66 clocks before new write means receive mode | |
| 147 | m_midi_mode = MIRACLE_MIDI_RECEIVE; | |
| 148 | // printf("receive start\n"); | |
| 149 | strobe_timer->reset(); | |
| 150 | m_strobe_on = 0; | |
| 151 | m_strobe_clock = 0; | |
| 152 | return; | |
| 153 | } | |
| 154 | } | |
| 155 | ||
| 156 | if (m_midi_mode == MIRACLE_MIDI_SEND && data == 0) | |
| 157 | { | |
| 158 | // strobe off after the end of a byte | |
| 159 | m_midi_mode = MIRACLE_MIDI_WAITING; | |
| 160 | // printf("send end\n"); | |
| 161 | } | |
| 162 | } | |
| 163 | ||
| 164 | if (m_midi_mode == MIRACLE_MIDI_RECEIVE) | |
| 165 | { | |
| 166 | //NES writes (data & 1) to Miracle Piano! | |
| 167 | // 1st write is data present flag (1=data present) | |
| 168 | // next 8 writes are actual data bits (with ^1) | |
| 169 | m_sent_bits++; | |
| 170 | // then we go back to waiting | |
| 171 | if (m_sent_bits == 9) | |
| 172 | { | |
| 173 | // printf("receive end\n"); | |
| 174 | m_midi_mode = MIRACLE_MIDI_WAITING; | |
| 175 | m_sent_bits = 0; | |
| 176 | } | |
| 177 | } | |
| 178 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Entertainment System - Miracle Piano Keyboard | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_MIRACLE__ | |
| 13 | #define __NES_MIRACLE__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | //#include "cpu/mcs51/mcs51.h" | |
| 19 | ||
| 20 | //************************************************************************** | |
| 21 | // TYPE DEFINITIONS | |
| 22 | //************************************************************************** | |
| 23 | ||
| 24 | // ======================> nes_miracle_device | |
| 25 | ||
| 26 | class nes_miracle_device : public device_t, | |
| 27 | public device_nes_control_port_interface | |
| 28 | { | |
| 29 | public: | |
| 30 | // construction/destruction | |
| 31 | nes_miracle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ||
| 33 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 34 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 35 | ||
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_start(); | |
| 39 | virtual void device_reset(); | |
| 40 | ||
| 41 | virtual UINT8 read_bit0(); | |
| 42 | virtual void write(UINT8 data); | |
| 43 | ||
| 44 | static const device_timer_id TIMER_STROBE_ON = 0; | |
| 45 | emu_timer *strobe_timer; | |
| 46 | ||
| 47 | //required_device<i8051_device> m_cpu; | |
| 48 | int m_strobe_on, m_midi_mode, m_sent_bits; | |
| 49 | UINT32 m_strobe_clock; | |
| 50 | }; | |
| 51 | ||
| 52 | // device type definition | |
| 53 | extern const device_type NES_MIRACLE; | |
| 54 | ||
| 55 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Mahjong Panel | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "mjpanel.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_MJPANEL = &device_creator<nes_mjpanel_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( nes_mjpanel ) | |
| 20 | PORT_START("MJPANEL.0") | |
| 21 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 22 | ||
| 23 | PORT_START("MJPANEL.1") | |
| 24 | PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 25 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) | |
| 26 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) | |
| 27 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) | |
| 28 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) | |
| 29 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) | |
| 30 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) | |
| 31 | ||
| 32 | PORT_START("MJPANEL.2") | |
| 33 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) | |
| 34 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) | |
| 35 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) | |
| 36 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) | |
| 37 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) | |
| 38 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) | |
| 39 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) | |
| 40 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) | |
| 41 | ||
| 42 | PORT_START("MJPANEL.3") | |
| 43 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 44 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) | |
| 45 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) | |
| 46 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) | |
| 47 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) | |
| 48 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) | |
| 49 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Mahjong Select") | |
| 50 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Mahjong Start") | |
| 51 | INPUT_PORTS_END | |
| 52 | ||
| 53 | ||
| 54 | //------------------------------------------------- | |
| 55 | // input_ports - device-specific input ports | |
| 56 | //------------------------------------------------- | |
| 57 | ||
| 58 | ioport_constructor nes_mjpanel_device::device_input_ports() const | |
| 59 | { | |
| 60 | return INPUT_PORTS_NAME( nes_mjpanel ); | |
| 61 | } | |
| 62 | ||
| 63 | ||
| 64 | ||
| 65 | //************************************************************************** | |
| 66 | // LIVE DEVICE | |
| 67 | //************************************************************************** | |
| 68 | ||
| 69 | //------------------------------------------------- | |
| 70 | // nes_mjpanel_device - constructor | |
| 71 | //------------------------------------------------- | |
| 72 | ||
| 73 | nes_mjpanel_device::nes_mjpanel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 74 | device_t(mconfig, NES_MJPANEL, "Famicom Mahjong Panel", tag, owner, clock, "nes_mjpanel", __FILE__), | |
| 75 | device_nes_control_port_interface(mconfig, *this), | |
| 76 | m_panel(*this, "MJPANEL") | |
| 77 | { | |
| 78 | } | |
| 79 | ||
| 80 | ||
| 81 | //------------------------------------------------- | |
| 82 | // device_start | |
| 83 | //------------------------------------------------- | |
| 84 | ||
| 85 | void nes_mjpanel_device::device_start() | |
| 86 | { | |
| 87 | save_item(NAME(m_latch)); | |
| 88 | } | |
| 89 | ||
| 90 | ||
| 91 | //------------------------------------------------- | |
| 92 | // device_reset | |
| 93 | //------------------------------------------------- | |
| 94 | ||
| 95 | void nes_mjpanel_device::device_reset() | |
| 96 | { | |
| 97 | m_latch = 0; | |
| 98 | } | |
| 99 | ||
| 100 | ||
| 101 | //------------------------------------------------- | |
| 102 | // read | |
| 103 | //------------------------------------------------- | |
| 104 | ||
| 105 | UINT8 nes_mjpanel_device::read_exp(offs_t offset) | |
| 106 | { | |
| 107 | UINT8 ret = 0; | |
| 108 | if (offset) | |
| 109 | { | |
| 110 | ret = (m_latch & 1) << 1; | |
| 111 | m_latch >>= 1; | |
| 112 | } | |
| 113 | else | |
| 114 | logerror("Error: Mahjong panel read from $4016\n"); | |
| 115 | ||
| 116 | return ret; | |
| 117 | } | |
| 118 | ||
| 119 | //------------------------------------------------- | |
| 120 | // write | |
| 121 | //------------------------------------------------- | |
| 122 | ||
| 123 | void nes_mjpanel_device::write(UINT8 data) | |
| 124 | { | |
| 125 | if (data & 0x01) | |
| 126 | return; | |
| 127 | ||
| 128 | if (data & 0xf8) | |
| 129 | logerror("Error: Mahjong panel read with mux data %02x\n", (data & 0xfe)); | |
| 130 | else | |
| 131 | m_latch = m_panel[(data & 0xfe) >> 1]->read(); | |
| 132 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Mahjong Panel | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_MJPANEL__ | |
| 13 | #define __NES_MJPANEL__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_mjpanel_device | |
| 24 | ||
| 25 | class nes_mjpanel_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_mjpanel_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_exp(offs_t offset); | |
| 40 | virtual void write(UINT8 data); | |
| 41 | ||
| 42 | private: | |
| 43 | required_ioport_array<4> m_panel; | |
| 44 | UINT32 m_latch; | |
| 45 | }; | |
| 46 | ||
| 47 | ||
| 48 | // device type definition | |
| 49 | extern const device_type NES_MJPANEL; | |
| 50 | ||
| 51 | ||
| 52 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Pachinko Controller | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "pachinko.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_PACHINKO = &device_creator<nes_pachinko_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( nes_pachinko ) | |
| 20 | PORT_START("JOYPAD") | |
| 21 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") | |
| 22 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("B") | |
| 23 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) | |
| 24 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) | |
| 25 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY | |
| 26 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY | |
| 27 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY | |
| 28 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY | |
| 29 | ||
| 30 | PORT_START("TRIGGER") | |
| 31 | PORT_BIT( 0xff, 0, IPT_PEDAL ) PORT_MINMAX(0, 0x63) PORT_SENSITIVITY(25) PORT_KEYDELTA(20) | |
| 32 | INPUT_PORTS_END | |
| 33 | ||
| 34 | //------------------------------------------------- | |
| 35 | // input_ports - device-specific input ports | |
| 36 | //------------------------------------------------- | |
| 37 | ||
| 38 | ioport_constructor nes_pachinko_device::device_input_ports() const | |
| 39 | { | |
| 40 | return INPUT_PORTS_NAME( nes_pachinko ); | |
| 41 | } | |
| 42 | ||
| 43 | //************************************************************************** | |
| 44 | // LIVE DEVICE | |
| 45 | //************************************************************************** | |
| 46 | ||
| 47 | //------------------------------------------------- | |
| 48 | // nes_pachinko_device - constructor | |
| 49 | //------------------------------------------------- | |
| 50 | ||
| 51 | nes_pachinko_device::nes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 52 | device_t(mconfig, NES_PACHINKO, "Famicom Pachinko Controller", tag, owner, clock, "nes_pachinko", __FILE__), | |
| 53 | device_nes_control_port_interface(mconfig, *this), | |
| 54 | m_joypad(*this, "JOYPAD"), | |
| 55 | m_trigger(*this, "TRIGGER") | |
| 56 | { | |
| 57 | } | |
| 58 | ||
| 59 | ||
| 60 | //------------------------------------------------- | |
| 61 | // device_start | |
| 62 | //------------------------------------------------- | |
| 63 | ||
| 64 | void nes_pachinko_device::device_start() | |
| 65 | { | |
| 66 | save_item(NAME(m_latch)); | |
| 67 | } | |
| 68 | ||
| 69 | ||
| 70 | //------------------------------------------------- | |
| 71 | // device_reset | |
| 72 | //------------------------------------------------- | |
| 73 | ||
| 74 | void nes_pachinko_device::device_reset() | |
| 75 | { | |
| 76 | m_latch = 0; | |
| 77 | } | |
| 78 | ||
| 79 | ||
| 80 | //------------------------------------------------- | |
| 81 | // read | |
| 82 | //------------------------------------------------- | |
| 83 | ||
| 84 | UINT8 nes_pachinko_device::read_exp(offs_t offset) | |
| 85 | { | |
| 86 | UINT8 ret = 0; | |
| 87 | // this controller behaves like a standard P3 joypad, with longer stream of inputs | |
| 88 | if (offset == 0) //$4016 | |
| 89 | { | |
| 90 | ret |= (m_latch & 1) << 1; | |
| 91 | m_latch >>= 1; | |
| 92 | } | |
| 93 | return ret; | |
| 94 | } | |
| 95 | ||
| 96 | //------------------------------------------------- | |
| 97 | // write | |
| 98 | //------------------------------------------------- | |
| 99 | ||
| 100 | void nes_pachinko_device::write(UINT8 data) | |
| 101 | { | |
| 102 | if (data & 0x01) | |
| 103 | return; | |
| 104 | ||
| 105 | m_latch = m_joypad->read(); | |
| 106 | m_latch |= ((m_trigger->read() ^ 0xff) & 0xff) << 8; | |
| 107 | m_latch |= 0xff0000; | |
| 108 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Pachinko Controller | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_PACHINKO__ | |
| 13 | #define __NES_PACHINKO__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_pachinko_device | |
| 24 | ||
| 25 | class nes_pachinko_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_pachinko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_exp(offs_t offset); | |
| 40 | virtual void write(UINT8 data); | |
| 41 | ||
| 42 | required_ioport m_joypad; | |
| 43 | required_ioport m_trigger; | |
| 44 | UINT32 m_latch; | |
| 45 | }; | |
| 46 | ||
| 47 | // device type definition | |
| 48 | extern const device_type NES_PACHINKO; | |
| 49 | ||
| 50 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Yonezawa / PartyRoom 21 Party Tap Controller | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "partytap.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_PARTYTAP = &device_creator<nes_partytap_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( nes_partytap ) | |
| 20 | PORT_START("INPUTS") | |
| 21 | PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 22 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P1 Button") PORT_CODE(KEYCODE_Z) | |
| 23 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P2 Button") PORT_CODE(KEYCODE_X) | |
| 24 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P3 Button") PORT_CODE(KEYCODE_C) | |
| 25 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P4 Button") PORT_CODE(KEYCODE_V) | |
| 26 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P5 Button") PORT_CODE(KEYCODE_B) | |
| 27 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("P6 Button") PORT_CODE(KEYCODE_N) | |
| 28 | INPUT_PORTS_END | |
| 29 | ||
| 30 | //------------------------------------------------- | |
| 31 | // input_ports - device-specific input ports | |
| 32 | //------------------------------------------------- | |
| 33 | ||
| 34 | ioport_constructor nes_partytap_device::device_input_ports() const | |
| 35 | { | |
| 36 | return INPUT_PORTS_NAME( nes_partytap ); | |
| 37 | } | |
| 38 | ||
| 39 | //************************************************************************** | |
| 40 | // LIVE DEVICE | |
| 41 | //************************************************************************** | |
| 42 | ||
| 43 | //------------------------------------------------- | |
| 44 | // nes_partytap_device - constructor | |
| 45 | //------------------------------------------------- | |
| 46 | ||
| 47 | nes_partytap_device::nes_partytap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 48 | device_t(mconfig, NES_PARTYTAP, "Yonezawa Party Tap Controller", tag, owner, clock, "nes_partytap", __FILE__), | |
| 49 | device_nes_control_port_interface(mconfig, *this), | |
| 50 | m_inputs(*this, "INPUTS") | |
| 51 | { | |
| 52 | } | |
| 53 | ||
| 54 | ||
| 55 | //------------------------------------------------- | |
| 56 | // device_start | |
| 57 | //------------------------------------------------- | |
| 58 | ||
| 59 | void nes_partytap_device::device_start() | |
| 60 | { | |
| 61 | save_item(NAME(m_latch)); | |
| 62 | save_item(NAME(m_mode)); | |
| 63 | } | |
| 64 | ||
| 65 | ||
| 66 | //------------------------------------------------- | |
| 67 | // device_reset | |
| 68 | //------------------------------------------------- | |
| 69 | ||
| 70 | void nes_partytap_device::device_reset() | |
| 71 | { | |
| 72 | m_mode = 0xe0; | |
| 73 | m_latch = 0; | |
| 74 | } | |
| 75 | ||
| 76 | ||
| 77 | //------------------------------------------------- | |
| 78 | // read | |
| 79 | //------------------------------------------------- | |
| 80 | ||
| 81 | UINT8 nes_partytap_device::read_exp(offs_t offset) | |
| 82 | { | |
| 83 | UINT8 ret = 0; | |
| 84 | if (offset == 1) //$4017 | |
| 85 | { | |
| 86 | ret |= m_latch & 0x1c; | |
| 87 | m_latch >>= 3; | |
| 88 | // append mode bits | |
| 89 | m_latch |= m_mode; | |
| 90 | } | |
| 91 | return ret; | |
| 92 | } | |
| 93 | ||
| 94 | //------------------------------------------------- | |
| 95 | // write | |
| 96 | //------------------------------------------------- | |
| 97 | ||
| 98 | void nes_partytap_device::write(UINT8 data) | |
| 99 | { | |
| 100 | // inputs are read in two chunks of 3 bits, before the second one is read bit2 is written here | |
| 101 | // probably a mechanism for the game to detect which group of inputs is being read | |
| 102 | m_mode = BIT(data, 2) ? 0xa0 : 0xe0; | |
| 103 | ||
| 104 | if (data & 0x01) | |
| 105 | return; | |
| 106 | ||
| 107 | m_latch = m_inputs->read(); | |
| 108 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Yonezawa / PartyRoom 21 Party Tap Controller | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_PARTYTAP__ | |
| 13 | #define __NES_PARTYTAP__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_partytap_device | |
| 24 | ||
| 25 | class nes_partytap_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_partytap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_exp(offs_t offset); | |
| 40 | virtual void write(UINT8 data); | |
| 41 | ||
| 42 | required_ioport m_inputs; | |
| 43 | UINT8 m_mode; | |
| 44 | UINT32 m_latch; | |
| 45 | }; | |
| 46 | ||
| 47 | // device type definition | |
| 48 | extern const device_type NES_PARTYTAP; | |
| 49 | ||
| 50 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Entertainment System - Bandai Power Pad | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "powerpad.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_POWERPAD = &device_creator<nes_powerpad_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( nes_powerpad ) | |
| 20 | PORT_START("LAYOUT") | |
| 21 | PORT_CONFNAME( 0x01, 0x00, "Power Pad Button Layout") | |
| 22 | PORT_CONFSETTING( 0x00, "Side A" ) | |
| 23 | PORT_CONFSETTING( 0x01, "Side B" ) | |
| 24 | ||
| 25 | // difference between the two sides is that we mirror the key mapping to match the real pad layout! | |
| 26 | PORT_START("POWERPAD1") | |
| 27 | // side A layout | |
| 28 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Top1") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 29 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 30 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid1") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 31 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 32 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid2") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 33 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Low1") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 34 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Low2") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 35 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid3") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 36 | // side B layout | |
| 37 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 38 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 39 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 40 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 41 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 42 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 43 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 44 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 45 | ||
| 46 | PORT_START("POWERPAD2") | |
| 47 | // side A layout | |
| 48 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 49 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Top2") PORT_CODE(KEYCODE_T) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 50 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 51 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid4") PORT_CODE(KEYCODE_F) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 52 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x00) | |
| 53 | // side B layout | |
| 54 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 55 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 56 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 57 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 58 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("LAYOUT", 0x01, EQUALS, 0x01) | |
| 59 | INPUT_PORTS_END | |
| 60 | ||
| 61 | ||
| 62 | //------------------------------------------------- | |
| 63 | // input_ports - device-specific input ports | |
| 64 | //------------------------------------------------- | |
| 65 | ||
| 66 | ioport_constructor nes_powerpad_device::device_input_ports() const | |
| 67 | { | |
| 68 | return INPUT_PORTS_NAME( nes_powerpad ); | |
| 69 | } | |
| 70 | ||
| 71 | ||
| 72 | ||
| 73 | //************************************************************************** | |
| 74 | // LIVE DEVICE | |
| 75 | //************************************************************************** | |
| 76 | ||
| 77 | //------------------------------------------------- | |
| 78 | // nes_powerpad_device - constructor | |
| 79 | //------------------------------------------------- | |
| 80 | ||
| 81 | nes_powerpad_device::nes_powerpad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 82 | device_t(mconfig, NES_POWERPAD, "Bandai Power Pad", tag, owner, clock, "nes_powerpad", __FILE__), | |
| 83 | device_nes_control_port_interface(mconfig, *this), | |
| 84 | m_ipt1(*this, "POWERPAD1"), | |
| 85 | m_ipt2(*this, "POWERPAD2") | |
| 86 | { | |
| 87 | } | |
| 88 | ||
| 89 | ||
| 90 | //------------------------------------------------- | |
| 91 | // device_start | |
| 92 | //------------------------------------------------- | |
| 93 | ||
| 94 | void nes_powerpad_device::device_start() | |
| 95 | { | |
| 96 | save_item(NAME(m_latch)); | |
| 97 | } | |
| 98 | ||
| 99 | ||
| 100 | //------------------------------------------------- | |
| 101 | // device_reset | |
| 102 | //------------------------------------------------- | |
| 103 | ||
| 104 | void nes_powerpad_device::device_reset() | |
| 105 | { | |
| 106 | m_latch[0] = 0; | |
| 107 | m_latch[1] = 0; | |
| 108 | } | |
| 109 | ||
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // read | |
| 113 | //------------------------------------------------- | |
| 114 | ||
| 115 | UINT8 nes_powerpad_device::read_bit34() | |
| 116 | { | |
| 117 | UINT8 ret = 0; | |
| 118 | ret |= (m_latch[0] & 0x01) << 3; | |
| 119 | ret |= (m_latch[1] & 0x01) << 4; | |
| 120 | m_latch[0] >>= 1; | |
| 121 | m_latch[1] >>= 1; | |
| 122 | return ret; | |
| 123 | } | |
| 124 | ||
| 125 | //------------------------------------------------- | |
| 126 | // write | |
| 127 | //------------------------------------------------- | |
| 128 | ||
| 129 | void nes_powerpad_device::write(UINT8 data) | |
| 130 | { | |
| 131 | if (data & 0x01) | |
| 132 | return; | |
| 133 | ||
| 134 | m_latch[0] = m_ipt1->read(); | |
| 135 | m_latch[1] = m_ipt2->read() | 0xf0; | |
| 136 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Entertainment System - Bandai Power Pad | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_POWERPAD__ | |
| 13 | #define __NES_POWERPAD__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_powerpad_device | |
| 24 | ||
| 25 | class nes_powerpad_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_powerpad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_bit34(); | |
| 40 | virtual void write(UINT8 data); | |
| 41 | ||
| 42 | private: | |
| 43 | required_ioport m_ipt1; | |
| 44 | required_ioport m_ipt2; | |
| 45 | UINT32 m_latch[2]; | |
| 46 | }; | |
| 47 | ||
| 48 | ||
| 49 | // device type definition | |
| 50 | extern const device_type NES_POWERPAD; | |
| 51 | ||
| 52 | ||
| 53 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Subor Keyboard (used by some Famiclones) | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "suborkey.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_SUBORKEYBOARD = &device_creator<nes_suborkey_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( fc_suborkey ) | |
| 20 | PORT_START("SUBOR.0") | |
| 21 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') | |
| 22 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') | |
| 23 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') | |
| 24 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') | |
| 25 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) | |
| 26 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') | |
| 27 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') | |
| 28 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') | |
| 29 | ||
| 30 | PORT_START("SUBOR.1") | |
| 31 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') | |
| 32 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') | |
| 33 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') | |
| 34 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) | |
| 35 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) | |
| 36 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') | |
| 37 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') | |
| 38 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') | |
| 39 | ||
| 40 | PORT_START("SUBOR.2") | |
| 41 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) | |
| 42 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) | |
| 43 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("NEXT") | |
| 44 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) | |
| 45 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) | |
| 46 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PRIOR") | |
| 47 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) | |
| 48 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) | |
| 49 | ||
| 50 | PORT_START("SUBOR.3") | |
| 51 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') | |
| 52 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') | |
| 53 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') | |
| 54 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') | |
| 55 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) | |
| 56 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') | |
| 57 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') | |
| 58 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') | |
| 59 | ||
| 60 | PORT_START("SUBOR.4") | |
| 61 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') | |
| 62 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) | |
| 63 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) | |
| 64 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) | |
| 65 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) | |
| 66 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') | |
| 67 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') | |
| 68 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) | |
| 69 | ||
| 70 | PORT_START("SUBOR.5") | |
| 71 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') | |
| 72 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) | |
| 73 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') | |
| 74 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') | |
| 75 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) | |
| 76 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') | |
| 77 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') | |
| 78 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) | |
| 79 | ||
| 80 | PORT_START("SUBOR.6") | |
| 81 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') | |
| 82 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') | |
| 83 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') | |
| 84 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') | |
| 85 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) | |
| 86 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') | |
| 87 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') | |
| 88 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') | |
| 89 | ||
| 90 | PORT_START("SUBOR.7") | |
| 91 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') | |
| 92 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') | |
| 93 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') | |
| 94 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') | |
| 95 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) | |
| 96 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') | |
| 97 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') | |
| 98 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) | |
| 99 | ||
| 100 | PORT_START("SUBOR.8") | |
| 101 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') | |
| 102 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') | |
| 103 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') | |
| 104 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') | |
| 105 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) | |
| 106 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') | |
| 107 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') | |
| 108 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') | |
| 109 | ||
| 110 | PORT_START("SUBOR.9") | |
| 111 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 112 | ||
| 113 | PORT_START("SUBOR.10") | |
| 114 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LMENU") | |
| 115 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) | |
| 116 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) | |
| 117 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) | |
| 118 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) | |
| 119 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) | |
| 120 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) | |
| 121 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) | |
| 122 | ||
| 123 | PORT_START("SUBOR.11") | |
| 124 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD)PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) | |
| 125 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) | |
| 126 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) | |
| 127 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) | |
| 128 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) | |
| 129 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) | |
| 130 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD)PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD)) | |
| 131 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) | |
| 132 | ||
| 133 | PORT_START("SUBOR.12") | |
| 134 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') | |
| 135 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) | |
| 136 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PAUSE") | |
| 137 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("SPACE2") | |
| 138 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) | |
| 139 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) | |
| 140 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) | |
| 141 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) | |
| 142 | INPUT_PORTS_END | |
| 143 | ||
| 144 | ||
| 145 | //------------------------------------------------- | |
| 146 | // input_ports - device-specific input ports | |
| 147 | //------------------------------------------------- | |
| 148 | ||
| 149 | ioport_constructor nes_suborkey_device::device_input_ports() const | |
| 150 | { | |
| 151 | return INPUT_PORTS_NAME( fc_suborkey ); | |
| 152 | } | |
| 153 | ||
| 154 | ||
| 155 | ||
| 156 | //************************************************************************** | |
| 157 | // LIVE DEVICE | |
| 158 | //************************************************************************** | |
| 159 | ||
| 160 | //------------------------------------------------- | |
| 161 | // nes_suborkey_device - constructor | |
| 162 | //------------------------------------------------- | |
| 163 | ||
| 164 | nes_suborkey_device::nes_suborkey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 165 | device_t(mconfig, NES_SUBORKEYBOARD, "FC Subor Keyboard", tag, owner, clock, "nes_suborkey", __FILE__), | |
| 166 | device_nes_control_port_interface(mconfig, *this), | |
| 167 | m_kbd(*this, "SUBOR") | |
| 168 | { | |
| 169 | } | |
| 170 | ||
| 171 | ||
| 172 | //------------------------------------------------- | |
| 173 | // device_start | |
| 174 | //------------------------------------------------- | |
| 175 | ||
| 176 | void nes_suborkey_device::device_start() | |
| 177 | { | |
| 178 | save_item(NAME(m_fck_scan)); | |
| 179 | save_item(NAME(m_fck_mode)); | |
| 180 | } | |
| 181 | ||
| 182 | ||
| 183 | //------------------------------------------------- | |
| 184 | // device_reset | |
| 185 | //------------------------------------------------- | |
| 186 | ||
| 187 | void nes_suborkey_device::device_reset() | |
| 188 | { | |
| 189 | m_fck_scan = 0; | |
| 190 | m_fck_mode = 0; | |
| 191 | } | |
| 192 | ||
| 193 | ||
| 194 | //------------------------------------------------- | |
| 195 | // read | |
| 196 | //------------------------------------------------- | |
| 197 | ||
| 198 | UINT8 nes_suborkey_device::read_exp(offs_t offset) | |
| 199 | { | |
| 200 | UINT8 ret = 0; | |
| 201 | if (offset == 1) //$4017 | |
| 202 | { | |
| 203 | // Subor Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4 | |
| 204 | if (m_fck_scan < 13) | |
| 205 | ret |= ~(((m_kbd[m_fck_scan]->read() >> (m_fck_mode * 4)) & 0x0f) << 1) & 0x1e; | |
| 206 | else | |
| 207 | ret |= 0x1e; | |
| 208 | } | |
| 209 | ||
| 210 | return ret; | |
| 211 | } | |
| 212 | ||
| 213 | //------------------------------------------------- | |
| 214 | // write | |
| 215 | //------------------------------------------------- | |
| 216 | ||
| 217 | void nes_suborkey_device::write(UINT8 data) | |
| 218 | { | |
| 219 | if (BIT(data, 2)) // keyboard active | |
| 220 | { | |
| 221 | UINT8 out = BIT(data, 1); // scan | |
| 222 | if (m_fck_mode && !out && ++m_fck_scan > 12) | |
| 223 | m_fck_scan = 0; | |
| 224 | ||
| 225 | m_fck_mode = out; // access lower or upper 4 bits | |
| 226 | ||
| 227 | if (BIT(data, 0)) // reset | |
| 228 | m_fck_scan = 0; | |
| 229 | } | |
| 230 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer Subor Keyboard (used by some Famiclones) | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_SUBORKEY__ | |
| 13 | #define __NES_SUBORKEY__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_suborkey_device | |
| 24 | ||
| 25 | class nes_suborkey_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_suborkey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_exp(offs_t offset); | |
| 40 | virtual void write(UINT8 data); | |
| 41 | ||
| 42 | private: | |
| 43 | required_ioport_array<13> m_kbd; | |
| 44 | UINT8 m_fck_scan, m_fck_mode; | |
| 45 | }; | |
| 46 | ||
| 47 | ||
| 48 | // device type definition | |
| 49 | extern const device_type NES_SUBORKEYBOARD; | |
| 50 | ||
| 51 | ||
| 52 | #endif |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System Zapper Lightgun | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #include "zapper.h" | |
| 11 | ||
| 12 | //************************************************************************** | |
| 13 | // DEVICE DEFINITIONS | |
| 14 | //************************************************************************** | |
| 15 | ||
| 16 | const device_type NES_ZAPPER = &device_creator<nes_zapper_device>; | |
| 17 | ||
| 18 | ||
| 19 | static INPUT_PORTS_START( nes_zapper ) | |
| 20 | PORT_START("ZAPPER_X") | |
| 21 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255) | |
| 22 | PORT_START("ZAPPER_Y") | |
| 23 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255) | |
| 24 | PORT_START("ZAPPER_T") | |
| 25 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger") | |
| 26 | INPUT_PORTS_END | |
| 27 | ||
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // input_ports - device-specific input ports | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | ioport_constructor nes_zapper_device::device_input_ports() const | |
| 34 | { | |
| 35 | return INPUT_PORTS_NAME( nes_zapper ); | |
| 36 | } | |
| 37 | ||
| 38 | ||
| 39 | ||
| 40 | //************************************************************************** | |
| 41 | // LIVE DEVICE | |
| 42 | //************************************************************************** | |
| 43 | ||
| 44 | //------------------------------------------------- | |
| 45 | // nes_zapper_device - constructor | |
| 46 | //------------------------------------------------- | |
| 47 | ||
| 48 | nes_zapper_device::nes_zapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 49 | device_t(mconfig, NES_ZAPPER, "Nintendo Zapper Lightgun", tag, owner, clock, "nes_zapper", __FILE__), | |
| 50 | device_nes_control_port_interface(mconfig, *this), | |
| 51 | m_lightx(*this, "ZAPPER_X"), | |
| 52 | m_lighty(*this, "ZAPPER_Y"), | |
| 53 | m_trigger(*this, "ZAPPER_T") | |
| 54 | { | |
| 55 | } | |
| 56 | ||
| 57 | ||
| 58 | //------------------------------------------------- | |
| 59 | // device_start | |
| 60 | //------------------------------------------------- | |
| 61 | ||
| 62 | void nes_zapper_device::device_start() | |
| 63 | { | |
| 64 | } | |
| 65 | ||
| 66 | ||
| 67 | //------------------------------------------------- | |
| 68 | // device_reset | |
| 69 | //------------------------------------------------- | |
| 70 | ||
| 71 | void nes_zapper_device::device_reset() | |
| 72 | { | |
| 73 | } | |
| 74 | ||
| 75 | ||
| 76 | //------------------------------------------------- | |
| 77 | // read | |
| 78 | //------------------------------------------------- | |
| 79 | ||
| 80 | UINT8 nes_zapper_device::read_bit34() | |
| 81 | { | |
| 82 | UINT8 ret = m_trigger->read(); | |
| 83 | if (!m_port->m_brightpixel_cb.isnull() && | |
| 84 | m_port->m_brightpixel_cb(m_lightx->read(), m_lighty->read())) | |
| 85 | ret &= ~0x08; // sprite hit | |
| 86 | else | |
| 87 | ret |= 0x08; // no sprite hit | |
| 88 | return ret; | |
| 89 | } | |
| 90 | ||
| 91 | UINT8 nes_zapper_device::read_exp(offs_t offset) | |
| 92 | { | |
| 93 | UINT8 ret = 0; | |
| 94 | if (offset == 1) // $4017 | |
| 95 | ret |= nes_zapper_device::read_bit34(); | |
| 96 | return ret; | |
| 97 | } |
| r0 | r243152 | |
|---|---|---|
| 1 | /********************************************************************** | |
| 2 | ||
| 3 | Nintendo Family Computer & Entertainment System Zapper Lightgun | |
| 4 | ||
| 5 | Copyright MESS Team. | |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. | |
| 7 | ||
| 8 | **********************************************************************/ | |
| 9 | ||
| 10 | #pragma once | |
| 11 | ||
| 12 | #ifndef __NES_ZAPPER__ | |
| 13 | #define __NES_ZAPPER__ | |
| 14 | ||
| 15 | ||
| 16 | #include "emu.h" | |
| 17 | #include "ctrl.h" | |
| 18 | ||
| 19 | //************************************************************************** | |
| 20 | // TYPE DEFINITIONS | |
| 21 | //************************************************************************** | |
| 22 | ||
| 23 | // ======================> nes_zapper_device | |
| 24 | ||
| 25 | class nes_zapper_device : public device_t, | |
| 26 | public device_nes_control_port_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | nes_zapper_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ||
| 32 | virtual ioport_constructor device_input_ports() const; | |
| 33 | ||
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | virtual UINT8 read_bit34(); | |
| 40 | virtual UINT8 read_exp(offs_t offset); | |
| 41 | ||
| 42 | private: | |
| 43 | required_ioport m_lightx; | |
| 44 | required_ioport m_lighty; | |
| 45 | required_ioport m_trigger; | |
| 46 | }; | |
| 47 | ||
| 48 | ||
| 49 | // device type definition | |
| 50 | extern const device_type NES_ZAPPER; | |
| 51 | ||
| 52 | ||
| 53 | #endif |
| r243151 | r243152 | |
|---|---|---|
| 1935 | 1935 | |
| 1936 | 1936 | ROM_START( discof ) |
| 1937 | 1937 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 1938 | ROM_LOAD( "w5-f", 0xa000, 0x1000, CRC(9d53c71c) SHA1(53c410cfa4fbbfd08e1c3cf7aeba1c9627171a71) ) | |
| 1939 | ROM_LOAD( "w4-f", 0xb000, 0x1000, CRC(c1f8d747) SHA1(33f5fe73d1851ef4da670075d1aec1550e0417ce) ) | |
| 1940 | ROM_LOAD( "w3-f", 0xc000, 0x1000, CRC(9aadd252) SHA1(c6da7ef46333d525e676c59f03ccc908108b41ba) ) | |
| 1941 | ROM_LOAD( "w2-f", 0xd000, 0x1000, CRC(f131a5bb) SHA1(84b7dea112dce12e5cb235a13f6dc4edcfb18c06) ) | |
| 1942 | ROM_LOAD( "w1-f", 0xe000, 0x1000, CRC(c8ec57c5) SHA1(904a9ed0a7f1230c611bf473b9bc52e63eb56dbe) ) | |
| 1943 | ROM_LOAD( "w0-f", 0xf000, 0x1000, CRC(b3787a92) SHA1(7f40621dc739c1108a5df43142ab04709a380219) ) | |
| 1938 | ROM_LOAD( "w5-f.1a", 0xa000, 0x1000, CRC(9d53c71c) SHA1(53c410cfa4fbbfd08e1c3cf7aeba1c9627171a71) ) | |
| 1939 | ROM_LOAD( "w4-f.2a", 0xb000, 0x1000, CRC(c1f8d747) SHA1(33f5fe73d1851ef4da670075d1aec1550e0417ce) ) | |
| 1940 | ROM_LOAD( "w3-f.4a", 0xc000, 0x1000, CRC(9aadd252) SHA1(c6da7ef46333d525e676c59f03ccc908108b41ba) ) | |
| 1941 | ROM_LOAD( "w2-f.6a", 0xd000, 0x1000, CRC(f131a5bb) SHA1(84b7dea112dce12e5cb235a13f6dc4edcfb18c06) ) | |
| 1942 | ROM_LOAD( "w1-f.9a", 0xe000, 0x1000, CRC(a6ce9a19) SHA1(e8f380e17a21fb33504d6efe9d01d0f903fa25e1) ) | |
| 1943 | // ROM_LOAD( "w1-f", 0xe000, 0x1000, CRC(c8ec57c5) SHA1(904a9ed0a7f1230c611bf473b9bc52e63eb56dbe) ) // 0x7d3 is 0x10 instead of 0x00, 1 bit different, looks out of place, bad? | |
| 1944 | ROM_LOAD( "w0-f.9a", 0xf000, 0x1000, CRC(b3787a92) SHA1(7f40621dc739c1108a5df43142ab04709a380219) ) | |
| 1944 | 1945 | |
| 1945 | 1946 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 1946 | ROM_LOAD( " | |
| 1947 | ROM_LOAD( "w6-.1b", 0xf000, 0x1000, CRC(d81e781e) SHA1(bde510bfed06a13bd56bf7ddbf220e7cf82f79b6) ) | |
| 1947 | 1948 | |
| 1948 | ROM_REGION( 0x0020, "proms", 0 ) | |
| 1949 | ROM_REGION( 0x0020, "proms", 0 ) // board uses 2 proms, not 1 | |
| 1949 | 1950 | ROM_LOAD( "disco.clr", 0x0000, 0x0020, CRC(a393f913) SHA1(42dce159283427064b3f5ce3a6e2189744ecd943) ) |
| 1950 | 1951 | ROM_END |
| 1951 | 1952 |
| r243151 | r243152 | |
|---|---|---|
| 9262 | 9262 | ROM_LOAD( "s92_19.12c", 0x20000, 0x20000, CRC(beade53f) SHA1(277c397dc12752719ec6b47d2224750bd1c07f79) ) |
| 9263 | 9263 | ROM_END |
| 9264 | 9264 | |
| 9265 | ||
| 9265 | 9266 | /* B-Board 89625B-1 */ |
| 9266 | 9267 | ROM_START( cworld2j ) |
| 9267 | 9268 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| r243151 | r243152 | |
| 9316 | 9317 | ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) |
| 9317 | 9318 | ROM_END |
| 9318 | 9319 | |
| 9320 | /* B-Board 90629B-3 - all roms have 90629B on the labels, no battery, possibly unofficial / desuicided with reproduction stickers */ | |
| 9321 | ROM_START( cworld2ja ) | |
| 9322 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ | |
| 9323 | ROM_LOAD16_WORD_SWAP("q5 - 34_90629b.8f", 0x00000, 0x80000, CRC(de54487f) SHA1(75b228a6c702c82d4d9a2a992933b5c3c420f6c2) ) | |
| 9324 | ROM_LOAD16_WORD_SWAP("q5 - 33_90629b.6f", 0x80000, 0x80000, CRC(93248458) SHA1(9dcdc6838f52efc9a0a6333fd0d734946db12dbd) ) | |
| 9325 | ||
| 9326 | ROM_REGION( 0x200000, "gfx", 0 ) | |
| 9327 | ROMX_LOAD( "q5 - 06_90629b.8a", 0x000000, 0x80000, CRC(09d0e7ce) SHA1(ea502b975986222acce82ce8396348af72e1df72) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9328 | ROMX_LOAD( "q5 - 08_90629b.10a", 0x000002, 0x80000, CRC(22e4ce9a) SHA1(9e49aec8e1d6d15a68da63e69765b82fd53a9562) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9329 | ROMX_LOAD( "q5 - 05_90629b.7a", 0x000004, 0x80000, CRC(f7b3aed6) SHA1(bdfb4d5988307b07ad878ac9129954d14da8769b) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9330 | ROMX_LOAD( "q5 - 07_90629b.9a", 0x000006, 0x80000, CRC(520c6c88) SHA1(19ba8ca3d75aae71cdf471e6307e86a5df8a2851) , ROM_GROUPWORD | ROM_SKIP(6) ) | |
| 9331 | ||
| 9332 | ROM_REGION( 0x18000, "audiocpu", 0 ) /* 64k for the audio CPU (+banks) */ | |
| 9333 | ROM_LOAD( "q5 - 09_90629b.12a", 0x00000, 0x08000, CRC(e14dc524) SHA1(0020a9002572002458fbfe45e8a959cb90de3f03) ) | |
| 9334 | ROM_CONTINUE( 0x10000, 0x08000 ) | |
| 9335 | ||
| 9336 | ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ | |
| 9337 | ROM_LOAD( "q5 - 18_90629b.11c", 0x00000, 0x20000, CRC(d10c1b68) SHA1(2423241f3340d8ab1b6bf9514ca8c3bba1273873) ) | |
| 9338 | ROM_LOAD( "q5 - 19_90629b.12c", 0x20000, 0x20000, CRC(7d17e496) SHA1(a274b94ec4f042dddc239ecb9ac2e1e2375f5eb2) ) | |
| 9339 | ||
| 9340 | ROM_REGION( 0x0200, "aboardplds", 0 ) | |
| 9341 | ROM_LOAD( "buf1", 0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) ) | |
| 9342 | ROM_LOAD( "ioa1", 0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) ) | |
| 9343 | ROM_LOAD( "prg1", 0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) ) | |
| 9344 | ROM_LOAD( "rom1", 0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) ) | |
| 9345 | ROM_LOAD( "sou1", 0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) ) | |
| 9346 | ||
| 9347 | ROM_REGION( 0x0200, "bboardplds", 0 ) | |
| 9348 | ROM_LOAD( "q522b.1a", 0x0000, 0x0117, NO_DUMP ) | |
| 9349 | ROM_LOAD( "lwio.12e", 0x0000, 0x0117, CRC(ad52b90c) SHA1(f0fd6aeea515ee449320fe15684e6b3ab7f97bf4) ) /* seen the same pcb with IOB1.12E */ | |
| 9350 | ||
| 9351 | ROM_REGION( 0x0200, "cboardplds", 0 ) | |
| 9352 | ROM_LOAD( "ioc1.ic1", 0x0000, 0x0117, CRC(0d182081) SHA1(475b3d417785da4bc512cce2b274bb00d4cc6792) ) | |
| 9353 | ROM_END | |
| 9354 | ||
| 9319 | 9355 | /* B-Board 89624B-3 */ |
| 9320 | 9356 | ROM_START( varth ) |
| 9321 | 9357 | ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ |
| r243151 | r243152 | |
| 11681 | 11717 | GAME( 1992, sf2koryu, sf2ce, cps1_12MHz, sf2hack, cps_state, sf2hack, ROT0, "bootleg", "Street Fighter II': Champion Edition (Xiang Long, Chinese bootleg)", GAME_SUPPORTS_SAVE ) // 811102 !!! - based on World version |
| 11682 | 11718 | GAME( 1992, sf2dongb, sf2ce, cps1_12MHz, sf2, cps_state, sf2dongb, ROT0, "bootleg", "Street Fighter II': Champion Edition (Dongfang Bubai protection, bootleg)", GAME_SUPPORTS_SAVE ) // 920313 - based on World version |
| 11683 | 11719 | GAME( 1992, cworld2j, 0, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611)", GAME_SUPPORTS_SAVE ) |
| 11720 | GAME( 1992, cworld2ja, cworld2j, cps1_12MHz, cworld2j, cps_state, cps1, ROT0, "Capcom", "Adventure Quiz Capcom World 2 (Japan 920611, B-Board 90629B-3, no battery)", GAME_SUPPORTS_SAVE ) | |
| 11684 | 11721 | GAME( 1992, varth, 0, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920714)", GAME_SUPPORTS_SAVE ) // "ETC" // 12MHz verified |
| 11685 | 11722 | GAME( 1992, varthr1, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom", "Varth: Operation Thunderstorm (World 920612)", GAME_SUPPORTS_SAVE ) // "ETC" |
| 11686 | 11723 | GAME( 1992, varthu, varth, cps1_12MHz, varth, cps_state, cps1, ROT270, "Capcom (Romstar license)", "Varth: Operation Thunderstorm (USA 920612)", GAME_SUPPORTS_SAVE ) |
| r243151 | r243152 | |
|---|---|---|
| 381 | 381 | |
| 382 | 382 | #include "emu.h" |
| 383 | 383 | #include "cpu/sh4/sh4.h" |
| 384 | #include "machine/naomicrypt.h" | |
| 385 | 384 | |
| 386 | 385 | #define CPU_CLOCK (200000000) |
| 387 | 386 | /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */ |
| r243151 | r243152 | |
| 740 | 739 | |
| 741 | 740 | // 317-0283-COM Actel A54SX32 |
| 742 | 741 | // ID 0x4252 |
| 743 | | |
| 742 | ROM_PARAMETER( ":rom_board:key", "56dedf33" ) | |
| 744 | 743 | ROM_END |
| 745 | 744 | |
| 746 | 745 | GAME( 2000, hikaru, 0, hikaru, hikaru, driver_device, 0, ROT0, "Sega", "Hikaru Bios", GAME_NO_SOUND|GAME_NOT_WORKING|GAME_IS_BIOS_ROOT ) |
| r243151 | r243152 | |
|---|---|---|
| 1509 | 1509 | #include "machine/jvs13551.h" |
| 1510 | 1510 | #include "includes/dc.h" |
| 1511 | 1511 | #include "includes/naomi.h" |
| 1512 | #include "machine/naomicrypt.h" | |
| 1513 | 1512 | |
| 1514 | 1513 | #define CPU_CLOCK (200000000) |
| 1515 | 1514 | |
| r243151 | r243152 | |
| 2654 | 2653 | */ |
| 2655 | 2654 | |
| 2656 | 2655 | static MACHINE_CONFIG_DERIVED( naomim1, naomi_base ) |
| 2657 | MCFG_NAOMI_M1_BOARD_ADD("rom_board", " | |
| 2656 | MCFG_NAOMI_M1_BOARD_ADD("rom_board", "naomibd_eeprom", ":boardid", WRITE8(dc_state, g1_irq)) | |
| 2658 | 2657 | MACHINE_CONFIG_END |
| 2659 | 2658 | |
| 2660 | 2659 | /* |
| r243151 | r243152 | |
| 4075 | 4074 | |
| 4076 | 4075 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 4077 | 4076 | |
| 4078 | _NAOMI_M1_KEYFILE( "gram2000-key.bin", CRC(179314d9) SHA1(3dbbc04e9ff62800d08c4a239af3a83252a28dc0) ) | |
| 4077 | // 840-0039 2000 | |
| 4078 | ROM_PARAMETER( ":rom_board:key", "3f5c807f" ) | |
| 4079 | 4079 | ROM_END |
| 4080 | 4080 | |
| 4081 | 4081 | ROM_START( tduno ) |
| r243151 | r243152 | |
| 4116 | 4116 | |
| 4117 | 4117 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 4118 | 4118 | |
| 4119 | _NAOMI_M1_KEYFILE("tduno2.key", CRC(8e0f0f3b) SHA1(914d3db8746c806d559539cc0851169161d32c04) ) | |
| 4119 | // 840-0022 2000 | |
| 4120 | ROM_PARAMETER( ":rom_board:key", "2f6f0f8d" ) | |
| 4120 | 4121 | ROM_END |
| 4121 | 4122 | |
| 4122 | 4123 | ROM_START( mtkob2 ) |
| r243151 | r243152 | |
| 4134 | 4135 | |
| 4135 | 4136 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 4136 | 4137 | |
| 4137 | _NAOMI_M1_KEYFILE("mtkob2-key.bin", CRC(db088208) SHA1(14d65ad2555183a445abcd93907c85df4032b41d) ) | |
| 4138 | // 840-0150 2003 | |
| 4139 | ROM_PARAMETER( ":rom_board:key", "3892fb3a" ) | |
| 4138 | 4140 | ROM_END |
| 4139 | 4141 | |
| 4140 | 4142 | ROM_START( mushi2k5 ) |
| r243151 | r243152 | |
| 4498 | 4500 | |
| 4499 | 4501 | ROM_COPY( "rom_board", 0x1200000, 0x400000, 0x400000 ) |
| 4500 | 4502 | |
| 4501 | _NAOMI_M1_KEYFILE( "mvsc2-key.bin", CRC(76f095b4) SHA1(773fd67e1eb471a989b3ee6e969a3d33bf61e779) ) | |
| 4503 | // 841-0007-02 2000 | |
| 4504 | ROM_PARAMETER( ":rom_board:key", "7c6e8bc1" ) | |
| 4502 | 4505 | ROM_END |
| 4503 | 4506 | |
| 4504 | 4507 | /* toy fighter - 1999 sega */ |
| r243151 | r243152 | |
| 5102 | 5105 | |
| 5103 | 5106 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5104 | 5107 | |
| 5105 | _NAOMI_M1_KEYFILE("qmegamis-key.bin", CRC(b08650c0) SHA1(9e6b0fac6fb05209da9e01bb1a5437949d218078) ) | |
| 5108 | // 840-0030 2000 | |
| 5109 | ROM_PARAMETER( ":rom_board:key", "96489bcd" ) | |
| 5106 | 5110 | ROM_END |
| 5107 | 5111 | |
| 5108 | 5112 | /* |
| r243151 | r243152 | |
| 5233 | 5237 | |
| 5234 | 5238 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5235 | 5239 | |
| 5236 | _NAOMI_M1_KEYFILE( "shootopl-key.bin", CRC(45547e02) SHA1(4f79f478ff1eea14bc939a67ff570143cb56a4bf) ) | |
| 5240 | // 840-0098 2002 | |
| 5241 | ROM_PARAMETER( ":rom_board:key", "a77cf3a0" ) | |
| 5237 | 5242 | ROM_END |
| 5238 | 5243 | |
| 5239 | 5244 | // Shootout Pool Prize |
| r243151 | r243152 | |
| 5250 | 5255 | |
| 5251 | 5256 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5252 | 5257 | |
| 5253 | _NAOMI_M1_KEYFILE( "shootpl-key.bin", CRC(03c30b17) SHA1(e8e8659aa27b3d1cac2268850d3973d9afeaeba9) ) | |
| 5258 | // 840-0128 2002 | |
| 5259 | ROM_PARAMETER( ":rom_board:key", "cde98d9d" ) | |
| 5254 | 5260 | ROM_END |
| 5255 | 5261 | |
| 5256 | 5262 | // Shootout Pool Prize Ver. B |
| r243151 | r243152 | |
| 5267 | 5273 | |
| 5268 | 5274 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 5269 | 5275 | |
| 5270 | _NAOMI_M1_KEYFILE( "shootpl-key.bin", CRC(03c30b17) SHA1(e8e8659aa27b3d1cac2268850d3973d9afeaeba9) ) | |
| 5276 | // 840-0128 2002 | |
| 5277 | ROM_PARAMETER( ":rom_board:key", "cde98d9d" ) | |
| 5271 | 5278 | ROM_END |
| 5272 | 5279 | |
| 5273 | 5280 | /* Oinori-daimyoujin Matsuri (medal) */ |
| r243151 | r243152 | |
| 6249 | 6256 | |
| 6250 | 6257 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 6251 | 6258 | |
| 6252 | _NAOMI_M1_KEYFILE("vtenis2c-key.bin", CRC(b8c5b510) SHA1(f36d037a62a576e71211093e075f0ffa7e312c2d) ) | |
| 6259 | // 840-0084 2001 | |
| 6260 | ROM_PARAMETER( ":rom_board:key", "43472d2d" ) | |
| 6253 | 6261 | ROM_END |
| 6254 | 6262 | |
| 6255 | 6263 | ROM_START( kick4csh ) |
| r243151 | r243152 | |
| 6278 | 6286 | |
| 6279 | 6287 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 6280 | 6288 | |
| 6281 | _NAOMI_M1_KEYFILE( "kick4csh-key.bin", CRC(889d2ea1) SHA1(daf7acf41b6bc607d443a93221a3e4554b99547f) ) | |
| 6289 | // 840-0140 2004 | |
| 6290 | ROM_PARAMETER( ":rom_board:key", "c9570882" ) | |
| 6282 | 6291 | ROM_END |
| 6283 | 6292 | |
| 6284 | 6293 | ROM_START( wrungp ) |
| r243151 | r243152 | |
| 6587 | 6596 | ROM_COPY( "rom_board", 0x01000000, 0x400000, 0xc00000 ) |
| 6588 | 6597 | |
| 6589 | 6598 | // M1 board, but it doesn't appear the protection is used |
| 6590 | | |
| 6599 | ROM_PARAMETER( ":rom_board:key", "0" ) | |
| 6591 | 6600 | |
| 6592 | 6601 | // this dump can't be used as main_eeprom, because that's exactly 0x80 bytes |
| 6593 | 6602 | ROM_REGION(0x84, "some_eeprom", 0) |
| r243151 | r243152 | |
| 7949 | 7958 | |
| 7950 | 7959 | ROM_COPY( "rom_board", 0x1000000, 0x400000, 0xc00000 ) |
| 7951 | 7960 | |
| 7952 | _NAOMI_M1_KEYFILE( "vf4evoct-key.bin", CRC(11111111) SHA1(1111111111111111111111111111111111111111) ) | |
| 7961 | // 840-0106 2002 | |
| 7962 | ROM_PARAMETER( ":rom_board:key", "cdb05b1e" ) | |
| 7953 | 7963 | ROM_END |
| 7954 | 7964 | |
| 7955 | 7965 | ROM_START( hopper ) |
| r243151 | r243152 | |
|---|---|---|
| 28 | 28 | public: |
| 29 | 29 | silvmil_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | 30 | : driver_device(mconfig, type, tag), |
| 31 | m_maincpu(*this, "maincpu"), | |
| 32 | m_gfxdecode(*this, "gfxdecode"), | |
| 33 | m_sprgen(*this, "spritegen"), | |
| 31 | 34 | m_bg_videoram(*this, "bg_videoram"), |
| 32 | 35 | m_fg_videoram(*this, "fg_videoram"), |
| 33 | m_spriteram(*this, "spriteram"), | |
| 34 | m_sprgen(*this, "spritegen"), | |
| 35 | m_maincpu(*this, "maincpu"), | |
| 36 | m_gfxdecode(*this, "gfxdecode") { } | |
| 36 | m_spriteram(*this, "spriteram") { } | |
| 37 | 37 | |
| 38 | ||
| 39 | /* devices */ | |
| 40 | required_device<cpu_device> m_maincpu; | |
| 41 | required_device<gfxdecode_device> m_gfxdecode; | |
| 42 | required_device<decospr_device> m_sprgen; | |
| 43 | ||
| 38 | 44 | /* memory pointers */ |
| 39 | 45 | required_shared_ptr<UINT16> m_bg_videoram; |
| 40 | 46 | required_shared_ptr<UINT16> m_fg_videoram; |
| 41 | 47 | required_shared_ptr<UINT16> m_spriteram; |
| 42 | optional_device<decospr_device> m_sprgen; | |
| 43 | 48 | |
| 44 | 49 | /* video-related */ |
| 45 | 50 | tilemap_t *m_bg_layer; |
| r243151 | r243152 | |
| 114 | 119 | virtual void video_start(); |
| 115 | 120 | UINT32 screen_update_silvmil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 116 | 121 | void tumblepb_gfx1_rearrange(); |
| 117 | required_device<cpu_device> m_maincpu; | |
| 118 | required_device<gfxdecode_device> m_gfxdecode; | |
| 119 | 122 | }; |
| 120 | 123 | |
| 121 | 124 | |
| r243151 | r243152 | |
| 280 | 283 | |
| 281 | 284 | void silvmil_state::machine_start() |
| 282 | 285 | { |
| 286 | save_item(NAME(m_silvmil_tilebank)); | |
| 287 | save_item(NAME(m_whichbank)); | |
| 283 | 288 | } |
| 284 | 289 | |
| 285 | 290 | void silvmil_state::machine_reset() |
| r243151 | r243152 | |
| 427 | 432 | tumblepb_gfx1_rearrange(); |
| 428 | 433 | } |
| 429 | 434 | |
| 430 | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", | |
| 435 | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE ) |
| r243151 | r243152 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | // Doa |
| 55 | 55 | int m_protstate; |
| 56 | int m_protpos; | |
| 57 | 56 | int m_prot_a; |
| 58 | 57 | UINT8 m_protram[256]; |
| 59 | 58 | }; |
| r243151 | r243152 | |
|---|---|---|
| 2 | 2 | #define _NAOMIBD_H_ |
| 3 | 3 | |
| 4 | 4 | #include "machine/naomig1.h" |
| 5 | #include "machine/naomicrypt.h" | |
| 6 | 5 | |
| 7 | 6 | #define MCFG_NAOMI_BOARD_ADD(_tag, type, _eeprom_tag, _actel_tag, _irq_cb) \ |
| 8 | 7 | MCFG_NAOMI_G1_ADD(_tag, type, _irq_cb) \ |
| r243151 | r243152 | |
|---|---|---|
| 1 | ||
| 2 | /* Sega 'M1' type encryption ( using an Actel A54SX32 ) | |
| 3 | ||
| 4 | see naomim1.c for Naomi hokup details | |
| 5 | ||
| 6 | The keys here are totally arbitrary and have nothing to do with the real keys. | |
| 7 | ||
| 8 | used by | |
| 9 | Naomi | |
| 10 | Hikaru | |
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | */ | |
| 15 | ||
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | #include "naomicrypt.h" | |
| 19 | ||
| 20 | struct game_keys | |
| 21 | { | |
| 22 | const char *name; /* game driver name */ | |
| 23 | const UINT32 key; | |
| 24 | ||
| 25 | }; | |
| 26 | ||
| 27 | static const struct game_keys keys_table[] = | |
| 28 | { | |
| 29 | // name key gameid # year | |
| 30 | // M1 | |
| 31 | { "tduno2", 0x2f6f0f8d }, // 840-0022 2000 | |
| 32 | { "qmegamis", 0x96489bcd }, // 840-0030 2000 | |
| 33 | { "gram2000", 0x3f5c807f }, // 840-0039 2000 | |
| 34 | { "vtenis2c", 0x43472d2d }, // 840-0084 2001 | |
| 35 | { "shootopl", 0xa77cf3a0 }, // 840-0098 2002 | |
| 36 | { "vf4evoct", 0xcdb05b1e }, // 840-0106 2002 | |
| 37 | { "shootpl", 0xcde98d9d }, // 840-0128 2002 | |
| 38 | { "shootplm", 0xcde98d9d }, // 840-0136 2002 | |
| 39 | { "kick4csh", 0xc9570882 }, // 840-0140 2004 | |
| 40 | { "mtkob2", 0x3892fb3a }, // 840-0150 2003 | |
| 41 | { "mvsc2", 0x7c6e8bc1 }, // 841-0007-02 2000 | |
| 42 | // sgnascar (Hikaru) | |
| 43 | { NULL, 0 } // end of table | |
| 44 | }; | |
| 45 | ||
| 46 | ||
| 47 | UINT32 get_naomi_key(running_machine &machine) | |
| 48 | { | |
| 49 | const char *gamename = machine.system().name; | |
| 50 | const struct game_keys *k = &keys_table[0]; | |
| 51 | ||
| 52 | while (k->name) | |
| 53 | { | |
| 54 | if (strcmp(k->name, gamename) == 0) | |
| 55 | { | |
| 56 | // we have a proper key so return it | |
| 57 | return k->key; | |
| 58 | } | |
| 59 | ++k; | |
| 60 | } | |
| 61 | ||
| 62 | printf("get_naomi_key : KEY NOT FOUND\n"); | |
| 63 | ||
| 64 | return 0; | |
| 65 | } |
| r243151 | r243152 | |
|---|---|---|
| 1 | /* naomicrypt.h */ | |
| 2 | ||
| 3 | // use internal M1 key tables, or external files (0 = external files) | |
| 4 | #define USE_NAOMICRYPT 0 | |
| 5 | ||
| 6 | UINT32 get_naomi_key(running_machine &machine); | |
| 7 | ||
| 8 | #define _NAOMI_M1_KEYFILE(name,hash) \ | |
| 9 | ROM_REGION( 4, "rom_key", 0 ) \ | |
| 10 | ROM_LOAD( name, 0, 4, hash ) | |
| 11 | ||
| 12 | ||
| 13 | #define _NAOMI_M1_KEYFILE_UNUSED \ | |
| 14 | ROM_REGION( 4, "rom_key", ROMREGION_ERASE00 ) \ | |
| 15 |
| r243151 | r243152 | |
|---|---|---|
| 13 | 13 | naomi_m1_board::naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 14 | 14 | : naomi_board(mconfig, NAOMI_M1_BOARD, "Sega NAOMI M1 Board", tag, owner, clock, "naomi_m1_board", __FILE__) |
| 15 | 15 | { |
| 16 | key_tag = 0; | |
| 17 | 16 | } |
| 18 | 17 | |
| 19 | void naomi_m1_board::static_set_tags(device_t &device, const char *_key_tag) | |
| 20 | { | |
| 21 | naomi_m1_board &dev = downcast<naomi_m1_board &>(device); | |
| 22 | dev.key_tag = _key_tag; | |
| 23 | } | |
| 24 | ||
| 25 | 18 | READ16_MEMBER(naomi_m1_board::actel_id_r) |
| 26 | 19 | { |
| 27 | 20 | if (rombdid_tag && memregion(rombdid_tag) != NULL) |
| r243151 | r243152 | |
| 37 | 30 | { |
| 38 | 31 | naomi_board::device_start(); |
| 39 | 32 | |
| 40 | #if USE_NAOMICRYPT | |
| 41 | key = get_naomi_key(machine()); | |
| 42 | #else | |
| 43 | const UINT8 *key_data = memregion(key_tag)->base(); | |
| 44 | key = (key_data[0] << 24) | (key_data[1] << 16) | (key_data[2] << 8) | key_data[3]; | |
| 45 | #endif | |
| 33 | astring skey = parameter("key"); | |
| 34 | if(skey) | |
| 35 | key = strtoll(skey.cstr(), 0, 16); | |
| 36 | else | |
| 37 | { | |
| 38 | logerror("%s: Warning: key not provided\n", tag()); | |
| 39 | key = 0; | |
| 40 | } | |
| 41 | ||
| 46 | 42 | buffer = auto_alloc_array(machine(), UINT8, BUFFER_SIZE); |
| 47 | 43 | |
| 48 | 44 | save_pointer(NAME(buffer), BUFFER_SIZE); |
| r243151 | r243152 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | #include "naomibd.h" |
| 5 | 5 | |
| 6 | #define MCFG_NAOMI_M1_BOARD_ADD(_tag, _key_tag, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 7 | MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_M1_BOARD, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 8 | naomi_m1_board::static_set_tags(*device, _key_tag); | |
| 6 | #define MCFG_NAOMI_M1_BOARD_ADD(_tag, _eeprom_tag, _actel_tag, _irq_cb) \ | |
| 7 | MCFG_NAOMI_BOARD_ADD(_tag, NAOMI_M1_BOARD, _eeprom_tag, _actel_tag, _irq_cb) | |
| 9 | 8 | |
| 10 | 9 | class naomi_m1_board : public naomi_board |
| 11 | 10 | { |
| 12 | 11 | public: |
| 13 | 12 | naomi_m1_board(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 14 | 13 | |
| 15 | static void static_set_tags(device_t &device, const char *_key_tag); | |
| 16 | ||
| 17 | 14 | virtual DECLARE_ADDRESS_MAP(submap, 16); |
| 18 | 15 | |
| 19 | 16 | DECLARE_READ16_MEMBER(actel_id_r); |
| r243151 | r243152 | |
| 28 | 25 | |
| 29 | 26 | private: |
| 30 | 27 | enum { BUFFER_SIZE = 32768 }; |
| 31 | ||
| 32 | const char *key_tag; | |
| 33 | 28 | UINT32 key; |
| 34 | 29 | |
| 35 | 30 | UINT8 *buffer; |
| r243151 | r243152 | |
|---|---|---|
| 3231 | 3231 | sf2mdtb // bootleg |
| 3232 | 3232 | sf2b // bootleg |
| 3233 | 3233 | cworld2j // 11/06/1992 (c) 1992 (Japan) |
| 3234 | cworld2ja // 11/06/1992 (c) 1992 (Japan) | |
| 3234 | 3235 | varth // 14/07/1992 (c) 1992 (World) |
| 3235 | 3236 | varthr1 // 12/06/1992 (c) 1992 (World) |
| 3236 | 3237 | varthu // 12/06/1992 (c) 1992 (USA) |
| r243151 | r243152 | |
|---|---|---|
| 1721 | 1721 | $(DRIVERS)/monacogp.o \ |
| 1722 | 1722 | $(DRIVERS)/naomi.o $(MACHINE)/dc.o $(VIDEO)/powervr2.o $(MACHINE)/naomi.o \ |
| 1723 | 1723 | $(MACHINE)/naomig1.o $(MACHINE)/naomibd.o $(MACHINE)/naomirom.o $(MACHINE)/naomigd.o \ |
| 1724 | $(MACHINE)/naomi | |
| 1724 | $(MACHINE)/naomim1.o $(MACHINE)/naomim2.o $(MACHINE)/naomim4.o \ | |
| 1725 | 1725 | $(MACHINE)/315-5881_crypt.o \ |
| 1726 | 1726 | $(MACHINE)/awboard.o \ |
| 1727 | 1727 | $(MACHINE)/mie.o $(MACHINE)/maple-dc.o $(MACHINE)/mapledev.o $(MACHINE)/dc-ctrl.o $(MACHINE)/jvs13551.o \ |
| r243151 | r243152 | |
|---|---|---|
| 1531 | 1531 | {"varthu", CPS_B_04, mapper_VA63B }, /* CPSB test has been patched out (60=0008) register is also written to, possibly leftover from development */ |
| 1532 | 1532 | {"varthj", CPS_B_21_BT5, mapper_VA22B }, /* CPSB test has been patched out (72=0001) register is also written to, possibly leftover from development */ |
| 1533 | 1533 | {"cworld2j", CPS_B_21_BT6, mapper_Q522B, 0x36, 0, 0x34 }, /* (ports 36, 34 probably leftover input code from another game) */ |
| 1534 | {"cworld2ja", CPS_B_21_DEF, mapper_Q522B }, // patched set, no battery, could be desuicided | |
| 1534 | 1535 | {"wof", CPS_B_21_QS1, mapper_TK263B }, |
| 1535 | 1536 | {"wofr1", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? |
| 1536 | 1537 | {"wofa", CPS_B_21_DEF, mapper_TK263B }, // patched set coming from a desuicided board? |
| r0 | r243152 | |
|---|---|---|
| 1 | // license:MAME|GPL2+ | |
| 2 | // copyright-holders:Felipe Sanches | |
| 3 | /*************************************************************************** | |
| 4 | This driver covers only the Operator Panel of the BancTec 91690 Document Processor equipment | |
| 5 | ||
| 6 | Author: Felipe Sanches <juca@members.fsf.org> | |
| 7 | ||
| 8 | Maintainence Manual: <https://garoa.net.br/w/images/PAINEL_BANCTEC_91690.PDF> | |
| 9 | */ | |
| 10 | ||
| 11 | #include "emu.h" | |
| 12 | #include "cpu/mcs51/mcs51.h" | |
| 13 | #include "cpu/m6805/m6805.h" | |
| 14 | #include "includes/banctec.h" | |
| 15 | #include "video/mc6845.h" | |
| 16 | ||
| 17 | static ADDRESS_MAP_START( banctec_mem , AS_PROGRAM, 8, banctec_state ) | |
| 18 | AM_RANGE(0x0000, 0x07ff) AM_ROM | |
| 19 | AM_RANGE(0x0800, 0xffff) AM_RAM /* Probably wrong. Must be verified on pcb! */ | |
| 20 | ADDRESS_MAP_END | |
| 21 | ||
| 22 | static ADDRESS_MAP_START( banctec_mcu_mem , AS_PROGRAM, 8, banctec_state ) | |
| 23 | AM_RANGE(0x0000, 0x1fff) AM_ROM | |
| 24 | AM_RANGE(0x2000, 0x7fff) AM_RAM /* Probably wrong. Must be verified on pcb! */ | |
| 25 | AM_RANGE(0x8000, 0xffff) AM_RAM AM_SHARE("videoram") /* Probably wrong. Must be verified on pcb! */ | |
| 26 | ADDRESS_MAP_END | |
| 27 | ||
| 28 | void banctec_state::machine_reset() | |
| 29 | { | |
| 30 | } | |
| 31 | ||
| 32 | ||
| 33 | /**************************** | |
| 34 | * Video/Character functions * | |
| 35 | ****************************/ | |
| 36 | ||
| 37 | TILE_GET_INFO_MEMBER(banctec_state::get_bg_tile_info) | |
| 38 | { | |
| 39 | UINT8 *videoram = m_videoram; | |
| 40 | int code = videoram[tile_index]; | |
| 41 | int color = 1; | |
| 42 | ||
| 43 | SET_TILE_INFO_MEMBER(0, code, color, 0); | |
| 44 | } | |
| 45 | ||
| 46 | void banctec_state::video_start() | |
| 47 | { | |
| 48 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(banctec_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); | |
| 49 | } | |
| 50 | ||
| 51 | UINT32 banctec_state::screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 52 | { | |
| 53 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); | |
| 54 | ||
| 55 | return 0; | |
| 56 | } | |
| 57 | ||
| 58 | /* ROCKWELL 6545 - Transparent Memory Addressing */ | |
| 59 | ||
| 60 | MC6845_ON_UPDATE_ADDR_CHANGED(banctec_state::crtc_addr) | |
| 61 | { | |
| 62 | /* What is this function meant to do ? */ | |
| 63 | } | |
| 64 | ||
| 65 | /****************************** | |
| 66 | * Graphics Decode Information * | |
| 67 | ******************************/ | |
| 68 | ||
| 69 | const gfx_layout banctec_gfx_layout = | |
| 70 | { | |
| 71 | 8, 8, /* 8x8 characters */ | |
| 72 | 256, /* 256 characters */ | |
| 73 | 1, /* 1 bits per pixel */ | |
| 74 | {0}, /* no bitplanes; 1 bit per pixel */ | |
| 75 | {0, 1, 2, 3, 4, 5, 6, 7}, | |
| 76 | {0 * 256*8, 1 * 256*8, 2 * 256*8, 3 * 256*8, 4 * 256*8, 5 * 256*8, 6 * 256*8, 7 * 256*8}, | |
| 77 | 8 /* size of one char */ | |
| 78 | }; | |
| 79 | ||
| 80 | static GFXDECODE_START( banctec ) | |
| 81 | GFXDECODE_ENTRY( "gfx", 0x00000, banctec_gfx_layout, 0, 2 ) | |
| 82 | GFXDECODE_END | |
| 83 | ||
| 84 | static MACHINE_CONFIG_START( banctec, banctec_state ) | |
| 85 | /* basic machine hardware */ | |
| 86 | ||
| 87 | MCFG_CPU_ADD("maincpu", I80C31, XTAL_11_0592MHz) | |
| 88 | MCFG_CPU_PROGRAM_MAP(banctec_mem) | |
| 89 | ||
| 90 | MCFG_CPU_ADD("mcu", M6805, 4000000) /* Actual MCU is a Motorola 6803 and the clock frequency is still unknown */ | |
| 91 | MCFG_CPU_PROGRAM_MAP(banctec_mcu_mem) | |
| 92 | ||
| 93 | // The video signal is generated by a R6545EAP character generator chip | |
| 94 | // The U20 EPROM holds the image data for the character set. | |
| 95 | ||
| 96 | // video hardware | |
| 97 | MCFG_SCREEN_ADD("screen", RASTER) | |
| 98 | MCFG_SCREEN_REFRESH_RATE(60) | |
| 99 | MCFG_SCREEN_SIZE((52+1)*8, (31+1)*8) | |
| 100 | MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 25*8-1) | |
| 101 | MCFG_SCREEN_UPDATE_DRIVER(banctec_state, screen_update_banctec) | |
| 102 | MCFG_SCREEN_PALETTE("palette") | |
| 103 | ||
| 104 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", banctec) | |
| 105 | MCFG_PALETTE_ADD("palette", 2) | |
| 106 | // MCFG_PALETTE_INIT_OWNER(banctec_state, banctec) | |
| 107 | ||
| 108 | MCFG_MC6845_ADD("crtc", R6545_1, "screen", XTAL_20MHz) /* (?) */ | |
| 109 | MCFG_MC6845_SHOW_BORDER_AREA(false) | |
| 110 | MCFG_MC6845_CHAR_WIDTH(8) | |
| 111 | MCFG_MC6845_ADDR_CHANGED_CB(banctec_state, crtc_addr) | |
| 112 | ||
| 113 | MACHINE_CONFIG_END | |
| 114 | ||
| 115 | ROM_START(banctec) | |
| 116 | ROM_REGION(0x800,"maincpu",0) | |
| 117 | ROM_LOAD("banctec_eseries_panel_opnl.u20", 0x000, 0x800, CRC(c2ab9c06) SHA1(a296589034f656790ad5ffbce028dd846a40cf03)) | |
| 118 | ||
| 119 | ROM_REGION(0x2000,"mcu",0) | |
| 120 | ROM_LOAD("banctec_eseries_panel.u8", 0x0000, 0x2000, CRC(f3335e0a) SHA1(5ca45fdcb7ef45a65c28c79abfa9ebb7a8a06619)) | |
| 121 | ||
| 122 | ROM_REGION(0x1000,"gfx",0) | |
| 123 | ROM_LOAD("banctec_eseries_panel.u20", 0x0000, 0x1000, CRC(5b6ecec9) SHA1(35aff8f965bce77205e3a43d71e39097585091a7)) | |
| 124 | ROM_END | |
| 125 | ||
| 126 | /*************************************************************************** | |
| 127 | ||
| 128 | Game driver(s) | |
| 129 | ||
| 130 | ***************************************************************************/ | |
| 131 | ||
| 132 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT MONITOR COMPANY FULLNAME */ | |
| 133 | CONS( 1989, banctec, 0, 0, banctec, 0, driver_device, 0, "DALE Electronics", "BancTec ESeries Panel", GAME_NOT_WORKING | GAME_NO_SOUND) |
| r243151 | r243152 | |
|---|---|---|
| 48 | 48 | // 0x8000-0xffff -> HIGH HANDLER defined on a pcb base |
| 49 | 49 | ADDRESS_MAP_END |
| 50 | 50 | |
| 51 | ||
| 52 | static INPUT_PORTS_START( nes_pads12 ) | |
| 53 | PORT_START("PAD1") | |
| 54 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 55 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 56 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 57 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 58 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 59 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 60 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 61 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 62 | ||
| 63 | PORT_START("PAD2") | |
| 64 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 65 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 66 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 67 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 68 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 69 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 70 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 71 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 72 | INPUT_PORTS_END | |
| 73 | ||
| 74 | static INPUT_PORTS_START( nes_pads34 ) | |
| 75 | PORT_START("PAD3") | |
| 76 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 A") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 77 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 B") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 78 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 79 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 80 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 81 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 82 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 83 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 84 | ||
| 85 | PORT_START("PAD4") | |
| 86 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 A") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 87 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 B") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 88 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 89 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 90 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 91 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 92 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 93 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 94 | INPUT_PORTS_END | |
| 95 | ||
| 96 | ||
| 97 | static INPUT_PORTS_START( nes_powerpad ) | |
| 98 | // difference between the two sides is that we mirror the key mapping to match the real pad layout! | |
| 99 | PORT_START("POWERPAD1") | |
| 100 | // side A layout | |
| 101 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Top1") PORT_CODE(KEYCODE_Y) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 102 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 103 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid1") PORT_CODE(KEYCODE_J) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 104 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 105 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid2") PORT_CODE(KEYCODE_H) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 106 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Low1") PORT_CODE(KEYCODE_N) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 107 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Low2") PORT_CODE(KEYCODE_B) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 108 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid3") PORT_CODE(KEYCODE_G) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 109 | // side B layout | |
| 110 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 111 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 112 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 113 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 114 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 115 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 116 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 117 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 118 | PORT_START("POWERPAD2") | |
| 119 | // side A layout | |
| 120 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 121 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Top2") PORT_CODE(KEYCODE_T) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 122 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 123 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad Mid4") PORT_CODE(KEYCODE_F) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 124 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0050) | |
| 125 | // side B layout | |
| 126 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 127 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 128 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 129 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("PowerPad 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 130 | PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0060) | |
| 131 | INPUT_PORTS_END | |
| 132 | ||
| 133 | static INPUT_PORTS_START( nes_zapper1 ) | |
| 134 | PORT_START("ZAPPER1_X") | |
| 135 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 136 | PORT_START("ZAPPER1_Y") | |
| 137 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 138 | PORT_START("ZAPPER1_T") | |
| 139 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P1 Lightgun Trigger") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 140 | INPUT_PORTS_END | |
| 141 | ||
| 142 | static INPUT_PORTS_START( nes_zapper2 ) | |
| 143 | PORT_START("ZAPPER2_X") | |
| 144 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 145 | PORT_START("ZAPPER2_Y") | |
| 146 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255 ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 147 | PORT_START("ZAPPER2_T") | |
| 148 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("P2 Lightgun Trigger") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 149 | INPUT_PORTS_END | |
| 150 | ||
| 151 | static INPUT_PORTS_START( nes_paddle ) | |
| 152 | PORT_START("PADDLE") | |
| 153 | PORT_BIT( 0xff, 0x7f, IPT_PADDLE) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CENTERDELTA(0) PORT_MINMAX(0x62,0xf2) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0040) | |
| 154 | PORT_START("PADDLE_BUTTON") | |
| 155 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Paddle button") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0040) | |
| 156 | INPUT_PORTS_END | |
| 157 | ||
| 158 | 51 | static INPUT_PORTS_START( nes ) |
| 159 | PORT_INCLUDE( nes_pads12 ) | |
| 160 | PORT_INCLUDE( nes_pads34 ) | |
| 161 | PORT_INCLUDE( nes_powerpad ) | |
| 162 | PORT_INCLUDE( nes_zapper1 ) | |
| 163 | PORT_INCLUDE( nes_zapper2 ) | |
| 164 | PORT_INCLUDE( nes_paddle ) | |
| 165 | ||
| 166 | PORT_START("CTRLSEL") | |
| 167 | PORT_CONFNAME( 0x000f, 0x0001, "P1 Controller") | |
| 168 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 169 | PORT_CONFSETTING( 0x0001, "Gamepad" ) | |
| 170 | PORT_CONFSETTING( 0x0002, "Zapper" ) | |
| 171 | PORT_CONFNAME( 0x00f0, 0x0010, "P2 Controller") | |
| 172 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 173 | PORT_CONFSETTING( 0x0010, "Gamepad" ) | |
| 174 | PORT_CONFSETTING( 0x0020, "Zapper" ) | |
| 175 | PORT_CONFSETTING( 0x0040, "Arkanoid paddle" ) | |
| 176 | PORT_CONFSETTING( 0x0050, "Power Pad (Side A layout)" ) | |
| 177 | PORT_CONFSETTING( 0x0060, "Power Pad (Side B layout)" ) | |
| 178 | PORT_CONFNAME( 0x0f00, 0x0000, "P3 Controller") | |
| 179 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 180 | PORT_CONFSETTING( 0x0100, "Gamepad" ) | |
| 181 | PORT_CONFNAME( 0xf000, 0x0000, "P4 Controller") | |
| 182 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 183 | PORT_CONFSETTING( 0x1000, "Gamepad" ) | |
| 184 | ||
| 52 | // input devices go through slot options | |
| 185 | 53 | PORT_START("CONFIG") |
| 186 | 54 | PORT_CONFNAME( 0x01, 0x00, "Draw Top/Bottom 8 Lines") |
| 187 | 55 | PORT_CONFSETTING( 0x01, DEF_STR(No) ) |
| r243151 | r243152 | |
| 191 | 59 | PORT_CONFSETTING( 0x00, DEF_STR(Yes) ) |
| 192 | 60 | INPUT_PORTS_END |
| 193 | 61 | |
| 194 | ||
| 195 | static INPUT_PORTS_START( fc_pads12 ) | |
| 196 | PORT_START("PAD1") | |
| 197 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 A") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 198 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 B") PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 199 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 200 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 201 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 202 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 203 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 204 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0001) | |
| 205 | ||
| 206 | PORT_START("PAD2") | |
| 207 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 208 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 209 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 210 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 211 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 212 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 213 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 214 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0010) | |
| 215 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 A") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 216 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 B") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 217 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("Microphone") PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 218 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 219 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 220 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 221 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 222 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x00f0) | |
| 223 | INPUT_PORTS_END | |
| 224 | ||
| 225 | static INPUT_PORTS_START( fc_pads34 ) | |
| 226 | PORT_START("PAD3") | |
| 227 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P3 A") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 228 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P3 B") PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 229 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 230 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 231 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 232 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 233 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 234 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_CONDITION("CTRLSEL", 0x0f00, EQUALS, 0x0100) | |
| 235 | ||
| 236 | PORT_START("PAD4") | |
| 237 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P4 A") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 238 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P4 B") PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 239 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 240 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 241 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 242 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 243 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 244 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_CONDITION("CTRLSEL", 0xf000, EQUALS, 0x1000) | |
| 245 | INPUT_PORTS_END | |
| 246 | ||
| 247 | static INPUT_PORTS_START( fc_lightgun ) | |
| 248 | PORT_START("ZAPPER2_X") | |
| 249 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(70) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x01) | |
| 250 | PORT_START("ZAPPER2_Y") | |
| 251 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(30) PORT_MINMAX(0,255) PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x01) | |
| 252 | PORT_START("ZAPPER2_T") | |
| 253 | PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Lightgun Trigger") PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x01) | |
| 254 | INPUT_PORTS_END | |
| 255 | ||
| 256 | static INPUT_PORTS_START( fc_paddle ) | |
| 257 | PORT_START("PADDLE") | |
| 258 | PORT_BIT( 0xff, 0x7f, IPT_PADDLE) PORT_SENSITIVITY(25) PORT_KEYDELTA(25) PORT_CENTERDELTA(0) PORT_MINMAX(0x62,0xf2) PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x04) | |
| 259 | PORT_START("PADDLE_BUTTON") | |
| 260 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Paddle button") PORT_PLAYER(2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x04) | |
| 261 | INPUT_PORTS_END | |
| 262 | ||
| 263 | static INPUT_PORTS_START( fc_cclimb ) | |
| 264 | PORT_START("CC_LEFT") | |
| 265 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 266 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 267 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 268 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 269 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 270 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 271 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 272 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_RIGHT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x000f, EQUALS, 0x0002) | |
| 273 | ||
| 274 | PORT_START("CC_RIGHT") | |
| 275 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 276 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 277 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 278 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 279 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_UP ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 280 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_DOWN ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 281 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_LEFT ) PORT_PLAYER(1) PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 282 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKRIGHT_RIGHT ) PORT_PLAYER(1)PORT_CONDITION("CTRLSEL", 0x00f0, EQUALS, 0x0020) | |
| 283 | INPUT_PORTS_END | |
| 284 | ||
| 285 | static INPUT_PORTS_START( fc_keyboard ) | |
| 286 | PORT_START("FCKEY0") | |
| 287 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 288 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 289 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 290 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 291 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Kana") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 292 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RSHIFT) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 293 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\\') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 294 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Stop") PORT_CODE(KEYCODE_BACKSPACE) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 295 | ||
| 296 | PORT_START("FCKEY1") | |
| 297 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 298 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 299 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 300 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 301 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('_') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 302 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CHAR('/') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 303 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 304 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 305 | ||
| 306 | PORT_START("FCKEY2") | |
| 307 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 308 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 309 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 310 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 311 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 312 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 313 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 314 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 315 | ||
| 316 | PORT_START("FCKEY3") | |
| 317 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 318 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 319 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 320 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 321 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 322 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 323 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 324 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 325 | ||
| 326 | PORT_START("FCKEY4") | |
| 327 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 328 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 329 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 330 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 331 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 332 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 333 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 334 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 335 | ||
| 336 | PORT_START("FCKEY5") | |
| 337 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 338 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 339 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 340 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 341 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 342 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 343 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 344 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 345 | ||
| 346 | PORT_START("FCKEY6") | |
| 347 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 348 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 349 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 350 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 351 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 352 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 353 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 354 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 355 | ||
| 356 | PORT_START("FCKEY7") | |
| 357 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 358 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 359 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 360 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 361 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 362 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Grph") PORT_CODE(KEYCODE_LALT) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 363 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 364 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 365 | ||
| 366 | PORT_START("FCKEY8") | |
| 367 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Clr") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 368 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 369 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 370 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 371 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 372 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 373 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Del") PORT_CODE(KEYCODE_DEL) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 374 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ins") PORT_CODE(KEYCODE_INSERT) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x02) | |
| 375 | ||
| 376 | INPUT_PORTS_END | |
| 377 | ||
| 378 | static INPUT_PORTS_START( subor_keyboard ) | |
| 379 | PORT_START("SUBKEY0") | |
| 380 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 381 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 382 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 383 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 384 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 385 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 386 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 387 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 388 | ||
| 389 | PORT_START("SUBKEY1") | |
| 390 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 391 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 392 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 393 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 394 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 395 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 396 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 397 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 398 | ||
| 399 | PORT_START("SUBKEY2") | |
| 400 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 401 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 402 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("NEXT") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 403 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 404 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 405 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PRIOR") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 406 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 407 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 408 | ||
| 409 | PORT_START("SUBKEY3") | |
| 410 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 411 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 412 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 413 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 414 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 415 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 416 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 417 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 418 | ||
| 419 | PORT_START("SUBKEY4") | |
| 420 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 421 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 422 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 423 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 424 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 425 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 426 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 427 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 428 | ||
| 429 | PORT_START("SUBKEY5") | |
| 430 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 431 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 432 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 433 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 434 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 435 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 436 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 437 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 438 | ||
| 439 | PORT_START("SUBKEY6") | |
| 440 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 441 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 442 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 443 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 444 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 445 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 446 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 447 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 448 | ||
| 449 | PORT_START("SUBKEY7") | |
| 450 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 451 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 452 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 453 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 454 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 455 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 456 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 457 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 458 | ||
| 459 | PORT_START("SUBKEY8") | |
| 460 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 461 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 462 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 463 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 464 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 465 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 466 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 467 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 468 | ||
| 469 | PORT_START("SUBKEY9") | |
| 470 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 471 | ||
| 472 | PORT_START("SUBKEY10") | |
| 473 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LMENU") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 474 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 475 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 476 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 477 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 478 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 479 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 480 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 481 | ||
| 482 | PORT_START("SUBKEY11") | |
| 483 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS_PAD)PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 484 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 485 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 486 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 487 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 488 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 489 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH_PAD)PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 490 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(UCHAR_MAMEKEY(NUMLOCK)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 491 | ||
| 492 | PORT_START("SUBKEY12") | |
| 493 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 494 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 495 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PAUSE") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 496 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("SPACE2") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 497 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 498 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 499 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 500 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x03) | |
| 501 | ||
| 502 | INPUT_PORTS_END | |
| 503 | ||
| 504 | static INPUT_PORTS_START( mahjong_panel ) | |
| 505 | PORT_START("MAH0") | |
| 506 | PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 507 | ||
| 508 | PORT_START("MAH1") | |
| 509 | PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 510 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_N ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 511 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_M ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 512 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_L ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 513 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_K ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 514 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_J ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 515 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_I ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 516 | ||
| 517 | PORT_START("MAH2") | |
| 518 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_MAHJONG_H ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 519 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_G ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 520 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_F ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 521 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_E ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 522 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_D ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 523 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_C ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 524 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_MAHJONG_B ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 525 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_MAHJONG_A ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 526 | ||
| 527 | PORT_START("MAH3") | |
| 528 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 529 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_MAHJONG_RON ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 530 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_MAHJONG_REACH ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 531 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_MAHJONG_CHI ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 532 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_MAHJONG_PON ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 533 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_MAHJONG_KAN ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 534 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_NAME("P1 Mahjong Select") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 535 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("P1 Mahjong Start") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x07) | |
| 536 | INPUT_PORTS_END | |
| 537 | ||
| 538 | // these are read differently than the powerpad inputs, but we share the tags, to reduce | |
| 539 | static INPUT_PORTS_START( fc_ftrainer ) | |
| 540 | // difference between the two sides is that we mirror the key mapping to match the real pad layout! | |
| 541 | PORT_START("FT_COL0") | |
| 542 | // side A layout | |
| 543 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 544 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid1") PORT_CODE(KEYCODE_J) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 545 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 546 | // side B layout | |
| 547 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 12") PORT_CODE(KEYCODE_M) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 548 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 8") PORT_CODE(KEYCODE_J) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 549 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 4") PORT_CODE(KEYCODE_U) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 550 | ||
| 551 | PORT_START("FT_COL1") | |
| 552 | // side A layout | |
| 553 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low1") PORT_CODE(KEYCODE_N) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 554 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid2") PORT_CODE(KEYCODE_H) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 555 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top1") PORT_CODE(KEYCODE_Y) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 556 | // side B layout | |
| 557 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 11") PORT_CODE(KEYCODE_N) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 558 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 7") PORT_CODE(KEYCODE_H) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 559 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 3") PORT_CODE(KEYCODE_Y) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 560 | ||
| 561 | PORT_START("FT_COL2") | |
| 562 | // side A layout | |
| 563 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Low2") PORT_CODE(KEYCODE_B) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 564 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid3") PORT_CODE(KEYCODE_G) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 565 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Top2") PORT_CODE(KEYCODE_T) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 566 | // side B layout | |
| 567 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 10") PORT_CODE(KEYCODE_B) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 568 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 6") PORT_CODE(KEYCODE_G) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 569 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 2") PORT_CODE(KEYCODE_T) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 570 | ||
| 571 | PORT_START("FT_COL3") | |
| 572 | // side A layout | |
| 573 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 574 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer Mid4") PORT_CODE(KEYCODE_F) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 575 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x05) | |
| 576 | // side B layout | |
| 577 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 9") PORT_CODE(KEYCODE_V) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 578 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 5") PORT_CODE(KEYCODE_F) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 579 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Family Trainer 1") PORT_CODE(KEYCODE_R) PORT_CONDITION("EXP", 0x0f, EQUALS, 0x06) | |
| 580 | INPUT_PORTS_END | |
| 581 | ||
| 582 | ||
| 583 | ||
| 584 | 62 | static INPUT_PORTS_START( famicom ) |
| 585 | PORT_INCLUDE( fc_pads12 ) | |
| 586 | PORT_INCLUDE( fc_pads34 ) | |
| 587 | PORT_INCLUDE( fc_lightgun ) | |
| 588 | // FIXME: was it possible to attache two paddles in a Famicom (as the Arkanoid 2 box suggests)?!? investigate... | |
| 589 | PORT_INCLUDE( fc_paddle ) | |
| 590 | // Crazy Climber is not really a separate controller, but a couple of small sticks to be | |
| 591 | // put on top of d-pads of the regular controllers. Users should then control the game | |
| 592 | // by using both controllers, turned 90 degrees, as a couple of dual sticks as in the arcade | |
| 593 | PORT_INCLUDE( fc_cclimb ) | |
| 594 | PORT_INCLUDE( fc_keyboard ) | |
| 595 | PORT_INCLUDE( subor_keyboard ) | |
| 596 | PORT_INCLUDE( mahjong_panel ) | |
| 597 | PORT_INCLUDE( fc_ftrainer ) | |
| 598 | ||
| 599 | PORT_START("CTRLSEL") | |
| 600 | PORT_CONFNAME( 0x000f, 0x0001, "P1 Controller") | |
| 601 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 602 | PORT_CONFSETTING( 0x0001, "Gamepad" ) | |
| 603 | PORT_CONFSETTING( 0x0002, "Crazy Climber pad (Left)" ) | |
| 604 | PORT_CONFNAME( 0x00f0, 0x0010, "P2 Controller") | |
| 605 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 606 | PORT_CONFSETTING( 0x0010, "Gamepad" ) | |
| 607 | PORT_CONFSETTING( 0x0020, "Crazy Climber pad (Right)" ) | |
| 608 | PORT_CONFSETTING( 0x00f0, "Gamepad (Older Version)" ) | |
| 609 | PORT_CONFNAME( 0x0f00, 0x0000, "P3 Controller") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x08) | |
| 610 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 611 | PORT_CONFSETTING( 0x0100, "Gamepad" ) | |
| 612 | PORT_CONFNAME( 0xf000, 0x0000, "P4 Controller") PORT_CONDITION("EXP", 0x0f, EQUALS, 0x08) | |
| 613 | PORT_CONFSETTING( 0x0000, "Unconnected" ) | |
| 614 | PORT_CONFSETTING( 0x1000, "Gamepad" ) | |
| 615 | ||
| 616 | PORT_START("EXP") | |
| 617 | PORT_CONFNAME( 0x0f, 0x00, "Expansion Port") | |
| 618 | PORT_CONFSETTING( 0x00, "(Empty)" ) | |
| 619 | PORT_CONFSETTING( 0x01, "Light Gun" ) | |
| 620 | PORT_CONFSETTING( 0x02, "FC Keyboard" ) | |
| 621 | PORT_CONFSETTING( 0x03, "Subor Keyboard" ) | |
| 622 | PORT_CONFSETTING( 0x04, "Arkanoid paddle" ) | |
| 623 | PORT_CONFSETTING( 0x05, "Family Trainer (Side A)" ) | |
| 624 | PORT_CONFSETTING( 0x06, "Family Trainer (Side B)" ) | |
| 625 | PORT_CONFSETTING( 0x07, "Mahjong Panel" ) | |
| 626 | PORT_CONFSETTING( 0x08, "Hori Twin Adapter" ) | |
| 627 | ||
| 63 | // input devices go through slot options | |
| 628 | 64 | PORT_START("CONFIG") |
| 629 | 65 | PORT_CONFNAME( 0x01, 0x00, "Draw Top/Bottom 8 Lines") |
| 630 | 66 | PORT_CONFSETTING( 0x01, DEF_STR(No) ) |
| r243151 | r243152 | |
| 634 | 70 | PORT_CONFSETTING( 0x00, DEF_STR(Yes) ) |
| 635 | 71 | |
| 636 | 72 | PORT_START("FLIPDISK") /* fake key */ |
| 637 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_ | |
| 73 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Change Disk Side") PORT_CODE(KEYCODE_SPACE) | |
| 638 | 74 | INPUT_PORTS_END |
| 639 | 75 | |
| 640 | 76 | |
| r243151 | r243152 | |
| 674 | 110 | MCFG_NES_APU_CPU("maincpu") |
| 675 | 111 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90) |
| 676 | 112 | |
| 113 | MCFG_NES_CONTROL_PORT_ADD("ctrl1", nes_control_port1_devices, "joypad") | |
| 114 | MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) | |
| 115 | MCFG_NES_CONTROL_PORT_ADD("ctrl2", nes_control_port2_devices, "joypad") | |
| 116 | MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) | |
| 117 | ||
| 677 | 118 | MCFG_NES_CARTRIDGE_ADD("nes_slot", nes_cart, NULL) |
| 678 | 119 | MCFG_SOFTWARE_LIST_ADD("cart_list", "nes") |
| 679 | 120 | MCFG_SOFTWARE_LIST_ADD("ade_list", "nes_ade") // Camerica/Codemasters Aladdin Deck Enhancer mini-carts |
| r243151 | r243152 | |
| 729 | 170 | MACHINE_CONFIG_END |
| 730 | 171 | |
| 731 | 172 | static MACHINE_CONFIG_DERIVED( famicom, nes ) |
| 732 | MCFG_CASSETTE_ADD( "tape" ) | |
| 733 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) | |
| 734 | MCFG_CASSETTE_INTERFACE("fc_cass") | |
| 173 | MCFG_DEVICE_REMOVE("ctrl1") | |
| 174 | MCFG_DEVICE_REMOVE("ctrl2") | |
| 175 | MCFG_NES_CONTROL_PORT_ADD("ctrl1", fc_control_port1_devices, "joypad") | |
| 176 | MCFG_NES_CONTROL_PORT_ADD("ctrl2", fc_control_port2_devices, "joypad") | |
| 177 | MCFG_FC_EXPANSION_PORT_ADD("exp", fc_expansion_devices, NULL) | |
| 178 | MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel) | |
| 735 | 179 | |
| 736 | 180 | MCFG_SOFTWARE_LIST_ADD("flop_list", "famicom_flop") |
| 737 | 181 | MCFG_SOFTWARE_LIST_ADD("cass_list", "famicom_cass") |
| r243151 | r243152 | |
| 769 | 213 | MACHINE_START_MEMBER( nes_state, fds ) |
| 770 | 214 | { |
| 771 | 215 | m_ciram = auto_alloc_array(machine(), UINT8, 0x800); |
| 772 | setup_ioports(); | |
| 773 | 216 | setup_disk(m_disk); |
| 774 | state_register(); | |
| 217 | ||
| 218 | // register saves | |
| 219 | save_item(NAME(m_last_frame_flip)); | |
| 220 | save_pointer(NAME(m_ciram), 0x800); | |
| 775 | 221 | } |
| 776 | 222 | |
| 777 | 223 | MACHINE_RESET_MEMBER( nes_state, fds ) |
| r243151 | r243152 | |
| 781 | 227 | |
| 782 | 228 | // the rest is the same as for nes/famicom/dendy |
| 783 | 229 | m_maincpu->reset(); |
| 784 | ||
| 785 | memset(m_pad_latch, 0, sizeof(m_pad_latch)); | |
| 786 | memset(m_zapper_latch, 0, sizeof(m_zapper_latch)); | |
| 787 | m_paddle_latch = 0; | |
| 788 | m_paddle_btn_latch = 0; | |
| 789 | 230 | } |
| 790 | 231 | |
| 791 | 232 | static MACHINE_CONFIG_DERIVED( fds, famicom ) |
| 792 | 233 | MCFG_MACHINE_START_OVERRIDE( nes_state, fds ) |
| 793 | 234 | MCFG_MACHINE_RESET_OVERRIDE( nes_state, fds ) |
| 794 | MCFG_DEVICE_REMOVE("tape") | |
| 795 | 235 | |
| 796 | 236 | MCFG_DEVICE_REMOVE("nes_slot") |
| 797 | 237 | MCFG_DEVICE_ADD("disk", NES_DISKSYS, 0) |
| r243151 | r243152 | |
| 827 | 267 | |
| 828 | 268 | // the rest is the same as for nes/famicom/dendy |
| 829 | 269 | m_maincpu->reset(); |
| 830 | ||
| 831 | memset(m_pad_latch, 0, sizeof(m_pad_latch)); | |
| 832 | memset(m_zapper_latch, 0, sizeof(m_zapper_latch)); | |
| 833 | m_paddle_latch = 0; | |
| 834 | m_paddle_btn_latch = 0; | |
| 835 | 270 | } |
| 836 | 271 | |
| 837 | 272 | static MACHINE_CONFIG_DERIVED( famitwin, famicom ) |
| r0 | r243152 | |
|---|---|---|
| 1 | /***************************************************************************** | |
| 2 | * | |
| 3 | * includes/banctec.h | |
| 4 | * | |
| 5 | ****************************************************************************/ | |
| 6 | ||
| 7 | #ifndef BANCTEC_H_ | |
| 8 | #define BANCTEC_H_ | |
| 9 | ||
| 10 | #include "video/mc6845.h" | |
| 11 | ||
| 12 | class banctec_state : public driver_device | |
| 13 | { | |
| 14 | public: | |
| 15 | banctec_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 16 | : driver_device(mconfig, type, tag), | |
| 17 | m_maincpu(*this, "maincpu"), | |
| 18 | m_gfxdecode(*this, "gfxdecode"), | |
| 19 | m_videoram(*this, "videoram") { } | |
| 20 | ||
| 21 | DECLARE_READ8_MEMBER(banctec_read); | |
| 22 | DECLARE_WRITE8_MEMBER(banctec_write); | |
| 23 | TILE_GET_INFO_MEMBER(get_bg_tile_info); | |
| 24 | MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr); | |
| 25 | virtual void machine_reset(); | |
| 26 | virtual void video_start(); | |
| 27 | UINT32 screen_update_banctec(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 28 | ||
| 29 | required_device<cpu_device> m_maincpu; | |
| 30 | required_device<gfxdecode_device> m_gfxdecode; | |
| 31 | required_shared_ptr<UINT8> m_videoram; | |
| 32 | ||
| 33 | tilemap_t *m_bg_tilemap; | |
| 34 | }; | |
| 35 | ||
| 36 | #endif /* BANCTEC_H_ */ |
| r243151 | r243152 | |
|---|---|---|
| 13 | 13 | #include "video/ppu2c0x.h" |
| 14 | 14 | #include "bus/nes/nes_slot.h" |
| 15 | 15 | #include "bus/nes/nes_carts.h" |
| 16 | #include "bus/nes_ctrl/ctrl.h" | |
| 16 | 17 | #include "sound/nes_apu.h" |
| 17 | #include "imagedev/cassette.h" | |
| 18 | 18 | |
| 19 | 19 | /*************************************************************************** |
| 20 | 20 | CONSTANTS |
| r243151 | r243152 | |
| 30 | 30 | TYPE DEFINITIONS |
| 31 | 31 | ***************************************************************************/ |
| 32 | 32 | |
| 33 | struct nes_input | |
| 34 | { | |
| 35 | UINT32 shift; | |
| 36 | UINT32 i0, i1, i2; | |
| 37 | }; | |
| 38 | ||
| 39 | 33 | /*PPU fast banking constants and structures */ |
| 40 | 34 | |
| 41 | 35 | #define CHRROM 0 |
| r243151 | r243152 | |
| 57 | 51 | class nes_state : public driver_device |
| 58 | 52 | { |
| 59 | 53 | public: |
| 60 | enum | |
| 61 | { | |
| 62 | TIMER_ZAPPER_TICK, | |
| 63 | TIMER_LIGHTGUN_TICK | |
| 64 | }; | |
| 65 | ||
| 66 | 54 | nes_state(const machine_config &mconfig, device_type type, const char *tag) |
| 67 | 55 | : driver_device(mconfig, type, tag), |
| 68 | 56 | m_maincpu(*this, "maincpu"), |
| 69 | 57 | m_ppu(*this, "ppu"), |
| 70 | 58 | m_sound(*this, "nessound"), |
| 59 | m_ctrl1(*this, "ctrl1"), | |
| 60 | m_ctrl2(*this, "ctrl2"), | |
| 61 | m_exp(*this, "exp"), | |
| 71 | 62 | m_cartslot(*this, "nes_slot"), |
| 72 | m_disk(*this, "disk"), | |
| 73 | m_cassette(*this, "tape") | |
| 63 | m_disk(*this, "disk") | |
| 74 | 64 | { } |
| 75 | 65 | |
| 76 | 66 | /* video-related */ |
| 77 | 67 | int m_last_frame_flip; |
| 78 | 68 | |
| 79 | 69 | /* misc */ |
| 80 | ioport_port *m_io_ctrlsel; | |
| 81 | ioport_port *m_io_fckey[9]; | |
| 82 | ioport_port *m_io_subkey[13]; | |
| 83 | ioport_port *m_io_pad[4]; | |
| 84 | ioport_port *m_io_powerpad[2]; | |
| 85 | ioport_port *m_io_mahjong[4]; | |
| 86 | ioport_port *m_io_ftrainer[4]; | |
| 87 | ioport_port *m_io_cc_left; | |
| 88 | ioport_port *m_io_cc_right; | |
| 89 | ioport_port *m_io_zapper1_t; | |
| 90 | ioport_port *m_io_zapper1_x; | |
| 91 | ioport_port *m_io_zapper1_y; | |
| 92 | ioport_port *m_io_zapper2_t; | |
| 93 | ioport_port *m_io_zapper2_x; | |
| 94 | ioport_port *m_io_zapper2_y; | |
| 95 | ioport_port *m_io_paddle; | |
| 96 | ioport_port *m_io_paddle_btn; | |
| 97 | ioport_port *m_io_exp; | |
| 98 | 70 | ioport_port *m_io_disksel; |
| 99 | 71 | |
| 100 | 72 | UINT8 *m_vram; |
| r243151 | r243152 | |
| 103 | 75 | required_device<cpu_device> m_maincpu; |
| 104 | 76 | required_device<ppu2c0x_device> m_ppu; |
| 105 | 77 | required_device<nesapu_device> m_sound; |
| 78 | required_device<nes_control_port_device> m_ctrl1; | |
| 79 | required_device<nes_control_port_device> m_ctrl2; | |
| 80 | optional_device<nes_control_port_device> m_exp; | |
| 106 | 81 | optional_device<nes_cart_slot_device> m_cartslot; |
| 107 | 82 | optional_device<nes_disksys_device> m_disk; |
| 108 | optional_device<cassette_image_device> m_cassette; | |
| 109 | 83 | |
| 110 | 84 | int nes_ppu_vidaccess(int address, int data); |
| 111 | 85 | void ppu_nmi(int *ppu_regs); |
| r243151 | r243152 | |
| 113 | 87 | DECLARE_READ8_MEMBER(nes_in0_r); |
| 114 | 88 | DECLARE_READ8_MEMBER(nes_in1_r); |
| 115 | 89 | DECLARE_WRITE8_MEMBER(nes_in0_w); |
| 116 | DECLARE_WRITE8_MEMBER(nes_in1_w); | |
| 117 | 90 | DECLARE_READ8_MEMBER(fc_in0_r); |
| 118 | 91 | DECLARE_READ8_MEMBER(fc_in1_r); |
| 119 | 92 | DECLARE_WRITE8_MEMBER(fc_in0_w); |
| r243151 | r243152 | |
| 127 | 100 | DECLARE_READ8_MEMBER(psg_4015_r); |
| 128 | 101 | DECLARE_WRITE8_MEMBER(psg_4015_w); |
| 129 | 102 | DECLARE_WRITE8_MEMBER(psg_4017_w); |
| 130 | void state_register(); | |
| 131 | void setup_ioports(); | |
| 103 | NESCTRL_BRIGHTPIXEL_CB(bright_pixel); | |
| 132 | 104 | |
| 133 | 105 | DECLARE_DRIVER_INIT(famicom); |
| 134 | 106 | |
| r243151 | r243152 | |
| 139 | 111 | DECLARE_MACHINE_RESET(famitwin); |
| 140 | 112 | void setup_disk(nes_disksys_device *slot); |
| 141 | 113 | |
| 142 | // input related | |
| 143 | UINT32 m_pad_latch[4]; | |
| 144 | UINT8 m_zapper_latch[2][3]; | |
| 145 | UINT8 m_paddle_latch, m_paddle_btn_latch; | |
| 146 | UINT8 m_mjpanel_latch; | |
| 147 | UINT8 m_fck_scan, m_fck_mode; | |
| 148 | UINT8 m_mic_obstruct; | |
| 149 | UINT8 m_powerpad_latch[2]; | |
| 150 | UINT8 m_ftrainer_scan; | |
| 151 | ||
| 152 | protected: | |
| 153 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); | |
| 154 | ||
| 155 | 114 | private: |
| 156 | 115 | memory_bank *m_prg_bank_mem[5]; |
| 157 | 116 | }; |
| r243151 | r243152 | |
|---|---|---|
| 7 | 7 | ****************************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include "crsshair.h" | |
| 11 | 10 | #include "cpu/m6502/m6502.h" |
| 12 | 11 | #include "includes/nes.h" |
| 13 | #include "imagedev/flopdrv.h" | |
| 14 | 12 | |
| 15 | 13 | /*************************************************************************** |
| 16 | CONSTANTS | |
| 17 | ***************************************************************************/ | |
| 18 | ||
| 19 | /* Set to dump info about the inputs to the errorlog */ | |
| 20 | #define LOG_JOY 0 | |
| 21 | ||
| 22 | /* Set to generate prg & chr files when the cart is loaded */ | |
| 23 | #define SPLIT_PRG 0 | |
| 24 | #define SPLIT_CHR 0 | |
| 25 | ||
| 26 | /*************************************************************************** | |
| 27 | 14 | FUNCTIONS |
| 28 | 15 | ***************************************************************************/ |
| 29 | 16 | |
| r243151 | r243152 | |
| 44 | 31 | m_cartslot->pcb_reset(); |
| 45 | 32 | |
| 46 | 33 | m_maincpu->reset(); |
| 47 | ||
| 48 | memset(m_pad_latch, 0, sizeof(m_pad_latch)); | |
| 49 | memset(m_zapper_latch, 0, sizeof(m_zapper_latch)); | |
| 50 | m_paddle_latch = 0; | |
| 51 | m_paddle_btn_latch = 0; | |
| 52 | 34 | } |
| 53 | 35 | |
| 54 | 36 | //------------------------------------------------- |
| 55 | 37 | // machine_start |
| 56 | 38 | //------------------------------------------------- |
| 57 | 39 | |
| 58 | void nes_state::state_register() | |
| 59 | { | |
| 60 | save_item(NAME(m_last_frame_flip)); | |
| 61 | ||
| 62 | save_pointer(NAME(m_ciram), 0x800); | |
| 63 | ||
| 64 | save_item(NAME(m_pad_latch)); | |
| 65 | save_item(NAME(m_zapper_latch)); | |
| 66 | save_item(NAME(m_paddle_latch)); | |
| 67 | save_item(NAME(m_paddle_btn_latch)); | |
| 68 | save_item(NAME(m_mjpanel_latch)); | |
| 69 | save_item(NAME(m_fck_scan)); | |
| 70 | save_item(NAME(m_fck_mode)); | |
| 71 | save_item(NAME(m_mic_obstruct)); | |
| 72 | save_item(NAME(m_powerpad_latch)); | |
| 73 | save_item(NAME(m_ftrainer_scan)); | |
| 74 | } | |
| 75 | ||
| 76 | void nes_state::setup_ioports() | |
| 77 | { | |
| 78 | for (int i = 0; i < 9; i++) | |
| 79 | { | |
| 80 | char str[7]; | |
| 81 | sprintf(str, "FCKEY%i", i); | |
| 82 | m_io_fckey[i] = ioport(str); | |
| 83 | } | |
| 84 | for (int i = 0; i < 13; i++) | |
| 85 | { | |
| 86 | char str[9]; | |
| 87 | sprintf(str, "SUBKEY%i", i); | |
| 88 | m_io_subkey[i] = ioport(str); | |
| 89 | } | |
| 90 | for (int i = 0; i < 4; i++) | |
| 91 | { | |
| 92 | char str[8]; | |
| 93 | sprintf(str, "PAD%i", i + 1); | |
| 94 | m_io_pad[i] = ioport(str); | |
| 95 | sprintf(str, "MAH%i", i); | |
| 96 | m_io_mahjong[i] = ioport(str); | |
| 97 | sprintf(str, "FT_COL%i", i); | |
| 98 | m_io_ftrainer[i] = ioport(str); | |
| 99 | } | |
| 100 | ||
| 101 | m_io_ctrlsel = ioport("CTRLSEL"); | |
| 102 | m_io_exp = ioport("EXP"); | |
| 103 | m_io_paddle = ioport("PADDLE"); | |
| 104 | m_io_paddle_btn = ioport("PADDLE_BUTTON"); | |
| 105 | m_io_cc_left = ioport("CC_LEFT"); | |
| 106 | m_io_cc_right = ioport("CC_RIGHT"); | |
| 107 | m_io_zapper1_t = ioport("ZAPPER1_T"); | |
| 108 | m_io_zapper1_x = ioport("ZAPPER1_X"); | |
| 109 | m_io_zapper1_y = ioport("ZAPPER1_Y"); | |
| 110 | m_io_zapper2_t = ioport("ZAPPER2_T"); | |
| 111 | m_io_zapper2_x = ioport("ZAPPER2_X"); | |
| 112 | m_io_zapper2_y = ioport("ZAPPER2_Y"); | |
| 113 | m_io_powerpad[0] = ioport("POWERPAD1"); | |
| 114 | m_io_powerpad[1] = ioport("POWERPAD2"); | |
| 115 | m_io_disksel = ioport("FLIPDISK"); | |
| 116 | } | |
| 117 | ||
| 118 | 40 | void nes_state::machine_start() |
| 119 | 41 | { |
| 120 | 42 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| r243151 | r243152 | |
| 126 | 48 | m_ciram = auto_alloc_array(machine(), UINT8, 0x800); |
| 127 | 49 | // other pointers got set in the loading routine, because they 'belong' to the cart itself |
| 128 | 50 | |
| 129 | se | |
| 51 | m_io_disksel = ioport("FLIPDISK"); | |
| 130 | 52 | |
| 131 | 53 | if (m_cartslot && m_cartslot->m_cart) |
| 132 | 54 | { |
| r243151 | r243152 | |
| 178 | 100 | m_cartslot->m_cart->pcb_reg_postload(machine()); |
| 179 | 101 | } |
| 180 | 102 | |
| 181 | state_register(); | |
| 103 | // register saves | |
| 104 | save_item(NAME(m_last_frame_flip)); | |
| 105 | save_pointer(NAME(m_ciram), 0x800); | |
| 182 | 106 | } |
| 183 | 107 | |
| 184 | 108 | |
| r243151 | r243152 | |
| 188 | 112 | |
| 189 | 113 | READ8_MEMBER(nes_state::nes_in0_r) |
| 190 | 114 | { |
| 191 | int cfg = m_io_ctrlsel->read(); | |
| 192 | ||
| 193 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 194 | // in the unused upper 3 bits, so typically a read from $4016 leaves 0x40 there. | |
| 195 | 115 | UINT8 ret = 0x40; |
| 196 | ret |= (m_pad_latch[0] & 0x01); | |
| 197 | ||
| 198 | // shift | |
| 199 | m_pad_latch[0] >>= 1; | |
| 200 | ||
| 201 | // zapper | |
| 202 | if ((cfg & 0x000f) == 0x0002) | |
| 203 | { | |
| 204 | int x = m_zapper_latch[0][1]; // x-position | |
| 205 | int y = m_zapper_latch[0][2]; // y-position | |
| 206 | UINT32 pix, color_base; | |
| 207 | ||
| 208 | // get the pixel at the gun position | |
| 209 | pix = m_ppu->get_pixel(x, y); | |
| 210 | ||
| 211 | // get the color base from the ppu | |
| 212 | color_base = m_ppu->get_colorbase(); | |
| 213 | ||
| 214 | // check if the cursor is over a bright pixel | |
| 215 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 216 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 217 | ret &= ~0x08; // sprite hit | |
| 218 | else | |
| 219 | ret |= 0x08; // no sprite hit | |
| 220 | ||
| 221 | // light gun trigger | |
| 222 | ret |= (m_zapper_latch[0][0] << 4); | |
| 223 | } | |
| 224 | ||
| 225 | if (LOG_JOY) | |
| 226 | logerror("joy 0 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 227 | ||
| 116 | ret |= m_ctrl1->read_bit0(); | |
| 117 | ret |= m_ctrl1->read_bit34(); | |
| 228 | 118 | return ret; |
| 229 | 119 | } |
| 230 | 120 | |
| 231 | 121 | READ8_MEMBER(nes_state::nes_in1_r) |
| 232 | 122 | { |
| 233 | int cfg = m_io_ctrlsel->read(); | |
| 234 | ||
| 235 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 236 | // in the unused upper 3 bits, so typically a read from $4017 leaves 0x40 there. | |
| 237 | 123 | UINT8 ret = 0x40; |
| 238 | ret |= (m_pad_latch[1] & 0x01); | |
| 239 | ||
| 240 | // shift | |
| 241 | m_pad_latch[1] >>= 1; | |
| 242 | ||
| 243 | // zapper | |
| 244 | if ((cfg & 0x00f0) == 0x0020) | |
| 245 | { | |
| 246 | int x = m_zapper_latch[1][1]; // x-position | |
| 247 | int y = m_zapper_latch[1][2]; // y-position | |
| 248 | UINT32 pix, color_base; | |
| 249 | ||
| 250 | // get the pixel at the gun position | |
| 251 | pix = m_ppu->get_pixel(x, y); | |
| 252 | ||
| 253 | // get the color base from the ppu | |
| 254 | color_base = m_ppu->get_colorbase(); | |
| 255 | ||
| 256 | // check if the cursor is over a bright pixel | |
| 257 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 258 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 259 | ret &= ~0x08; // sprite hit | |
| 260 | else | |
| 261 | ret |= 0x08; // no sprite hit | |
| 262 | ||
| 263 | // light gun trigger | |
| 264 | ret |= (m_zapper_latch[1][0] << 4); | |
| 265 | } | |
| 266 | ||
| 267 | // arkanoid paddle | |
| 268 | if ((cfg & 0x00f0) == 0x0040) | |
| 269 | { | |
| 270 | ret |= (m_paddle_btn_latch << 3); // button | |
| 271 | ret |= ((m_paddle_latch & 0x80) >> 3); // paddle data | |
| 272 | m_paddle_latch <<= 1; | |
| 273 | m_paddle_latch &= 0xff; | |
| 274 | } | |
| 275 | ||
| 276 | // powerpad | |
| 277 | if ((cfg & 0x00f0) == 0x0050 || (cfg & 0x00f0) == 0x0060) | |
| 278 | { | |
| 279 | ret |= ((m_powerpad_latch[0] & 0x01) << 3); | |
| 280 | ret |= ((m_powerpad_latch[1] & 0x01) << 4); | |
| 281 | m_powerpad_latch[0] >>= 1; | |
| 282 | m_powerpad_latch[1] >>= 1; | |
| 283 | } | |
| 284 | ||
| 285 | if (LOG_JOY) | |
| 286 | logerror("joy 1 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 287 | ||
| 124 | ret |= m_ctrl2->read_bit0(); | |
| 125 | ret |= m_ctrl2->read_bit34(); | |
| 288 | 126 | return ret; |
| 289 | 127 | } |
| 290 | 128 | |
| 291 | 129 | WRITE8_MEMBER(nes_state::nes_in0_w) |
| 292 | 130 | { |
| 293 | int cfg = m_io_ctrlsel->read(); | |
| 294 | ||
| 295 | if (LOG_JOY) | |
| 296 | logerror("joy write, val: %02x, pc: %04x\n", data, space.device().safe_pc()); | |
| 297 | ||
| 298 | // Check if lightgun has been chosen as input: if so, enable crosshair | |
| 299 | timer_set(attotime::zero, TIMER_ZAPPER_TICK); | |
| 300 | ||
| 301 | if (data & 0x01) | |
| 302 | return; | |
| 303 | ||
| 304 | // Toggling bit 0 high then low resets controllers | |
| 305 | m_pad_latch[0] = 0; | |
| 306 | m_pad_latch[1] = 0; | |
| 307 | m_zapper_latch[0][0] = 0; | |
| 308 | m_zapper_latch[0][1] = 0; | |
| 309 | m_zapper_latch[0][2] = 0; | |
| 310 | m_zapper_latch[1][0] = 0; | |
| 311 | m_zapper_latch[1][1] = 0; | |
| 312 | m_zapper_latch[1][2] = 0; | |
| 313 | m_paddle_btn_latch = 0; | |
| 314 | m_paddle_latch = 0; | |
| 315 | m_powerpad_latch[0] = 0; | |
| 316 | m_powerpad_latch[1] = 0; | |
| 317 | ||
| 318 | // P1 inputs | |
| 319 | switch (cfg & 0x000f) | |
| 320 | { | |
| 321 | case 0x01: // pad 1 | |
| 322 | m_pad_latch[0] = m_io_pad[0]->read(); | |
| 323 | break; | |
| 324 | ||
| 325 | case 0x02: // zapper (secondary) | |
| 326 | m_zapper_latch[0][0] = m_io_zapper1_t->read(); | |
| 327 | m_zapper_latch[0][1] = m_io_zapper1_x->read(); | |
| 328 | m_zapper_latch[0][2] = m_io_zapper1_y->read(); | |
| 329 | break; | |
| 330 | } | |
| 331 | ||
| 332 | // P2 inputs | |
| 333 | switch ((cfg & 0x00f0) >> 4) | |
| 334 | { | |
| 335 | case 0x01: // pad 2 | |
| 336 | m_pad_latch[1] = m_io_pad[1]->read(); | |
| 337 | break; | |
| 338 | ||
| 339 | case 0x02: // zapper (primary) - most games expect pad in port1 & zapper in port2 | |
| 340 | m_zapper_latch[1][0] = m_io_zapper2_t->read(); | |
| 341 | m_zapper_latch[1][1] = m_io_zapper2_x->read(); | |
| 342 | m_zapper_latch[1][2] = m_io_zapper2_y->read(); | |
| 343 | break; | |
| 344 | ||
| 345 | case 0x04: // arkanoid paddle | |
| 346 | m_paddle_btn_latch = m_io_paddle_btn->read(); | |
| 347 | m_paddle_latch = (UINT8) (m_io_paddle->read() ^ 0xff); | |
| 348 | break; | |
| 349 | ||
| 350 | case 0x05: // power pad | |
| 351 | case 0x06: // power pad | |
| 352 | m_powerpad_latch[0] = m_io_powerpad[0]->read(); | |
| 353 | m_powerpad_latch[1] = m_io_powerpad[1]->read() | 0xf0; | |
| 354 | break; | |
| 355 | } | |
| 356 | ||
| 357 | // P3 & P4 inputs in NES Four Score are read serially with P1 & P2 | |
| 358 | // P3 inputs | |
| 359 | if ((cfg & 0x0f00)) | |
| 360 | m_pad_latch[0] |= ((m_io_pad[2]->read() << 8) | (0x08 << 16)); // pad 3 + signature | |
| 361 | ||
| 362 | // P4 inputs | |
| 363 | if ((cfg & 0xf000)) | |
| 364 | m_pad_latch[1] |= ((m_io_pad[3]->read() << 8) | (0x04 << 16)); // pad 4 + signature | |
| 131 | m_ctrl1->write(data); | |
| 132 | m_ctrl2->write(data); | |
| 365 | 133 | } |
| 366 | 134 | |
| 367 | 135 | |
| 368 | WRITE8_MEMBER(nes_state::nes_in1_w) | |
| 369 | { | |
| 370 | } | |
| 371 | ||
| 372 | ||
| 373 | 136 | READ8_MEMBER(nes_state::fc_in0_r) |
| 374 | 137 | { |
| 375 | int cfg = m_io_ctrlsel->read(); | |
| 376 | int exp = m_io_exp->read(); | |
| 377 | ||
| 378 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 379 | // in the unused upper 3 bits, so typically a read from $4016 leaves 0x40 there. | |
| 380 | 138 | UINT8 ret = 0x40; |
| 381 | ret |= (m_pad_latch[0] & 0x01); | |
| 139 | // bit 0 to controller port | |
| 140 | ret |= m_ctrl1->read_bit0(); | |
| 382 | 141 | |
| 383 | // shift | |
| 384 | m_pad_latch[0] >>= 1; | |
| 142 | // expansion port bits (in the original FC, P2 controller was hooked to these lines | |
| 143 | // too, so in principle some homebrew hardware modification could use the same | |
| 144 | // connection with P1 controller too) | |
| 145 | ret |= m_ctrl1->read_exp(0); | |
| 146 | ret |= m_ctrl2->read_exp(0); | |
| 385 | 147 | |
| 386 | // microphone bit | |
| 387 | if ((cfg & 0x00f0) == 0x00f0) | |
| 388 | ret |= m_mic_obstruct; //bit2! | |
| 389 | ||
| 390 | // EXP input | |
| 391 | switch (exp & 0x0f) | |
| 392 | { | |
| 393 | case 0x02: // FC Keyboard: tape input | |
| 394 | if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY) | |
| 395 | { | |
| 396 | double level = m_cassette->input(); | |
| 397 | if (level < 0) | |
| 398 | ret |= 0x00; | |
| 399 | else | |
| 400 | ret |= 0x02; | |
| 401 | } | |
| 402 | break; | |
| 403 | ||
| 404 | case 0x04: // Arkanoid paddle | |
| 405 | ret |= (m_paddle_btn_latch << 1); // button | |
| 406 | break; | |
| 407 | ||
| 408 | case 0x07: // Mahjong Panel | |
| 409 | ret |= ((m_mjpanel_latch & 0x01) << 1); | |
| 410 | m_mjpanel_latch >>= 1; | |
| 411 | break; | |
| 412 | ||
| 413 | case 0x08: // 'multitap' p3 | |
| 414 | ret |= ((m_pad_latch[2] & 0x01) << 1); | |
| 415 | m_pad_latch[2] >>= 1; | |
| 416 | break; | |
| 417 | } | |
| 418 | ||
| 419 | if (LOG_JOY) | |
| 420 | logerror("joy 0 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 421 | ||
| 148 | // at the same time, we might have a standard joypad connected to the expansion port which | |
| 149 | // shall be read as P3 (this is needed here to avoid implementing the expansion port as a | |
| 150 | // different device compared to the standard control port... it might be changed later) | |
| 151 | ret |= (m_exp->read_bit0() << 1); | |
| 152 | // finally, read the expansion port as expected | |
| 153 | ret |= m_exp->read_exp(0); | |
| 422 | 154 | return ret; |
| 423 | 155 | } |
| 424 | 156 | |
| 425 | 157 | READ8_MEMBER(nes_state::fc_in1_r) |
| 426 | 158 | { |
| 427 | int exp = m_io_exp->read(); | |
| 428 | ||
| 429 | // Some games expect bit 6 to be set because the last entry on the data bus shows up | |
| 430 | // in the unused upper 3 bits, so typically a read from $4017 leaves 0x40 there. | |
| 431 | 159 | UINT8 ret = 0x40; |
| 432 | ret |= (m_pad_latch[1] & 0x01); | |
| 160 | // bit 0 to controller port | |
| 161 | ret |= m_ctrl2->read_bit0(); | |
| 433 | 162 | |
| 434 | // shift | |
| 435 | m_pad_latch[1] >>= 1; | |
| 163 | // expansion port bits (in the original FC, P2 controller was hooked to these lines | |
| 164 | // too, so in principle some homebrew hardware modification could use the same | |
| 165 | // connection with P1 controller too) | |
| 166 | ret |= m_ctrl1->read_exp(1); | |
| 167 | ret |= m_ctrl2->read_exp(1); | |
| 436 | 168 | |
| 437 | ||
| 438 | // EXP input | |
| 439 | switch (exp & 0x0f) | |
| 440 | { | |
| 441 | case 0x01: // Lightgun | |
| 442 | { | |
| 443 | int x = m_zapper_latch[0][1]; // x-position | |
| 444 | int y = m_zapper_latch[0][2]; // y-position | |
| 445 | UINT32 pix, color_base; | |
| 446 | ||
| 447 | // get the pixel at the gun position | |
| 448 | pix = m_ppu->get_pixel(x, y); | |
| 449 | ||
| 450 | // get the color base from the ppu | |
| 451 | color_base = m_ppu->get_colorbase(); | |
| 452 | ||
| 453 | // check if the cursor is over a bright pixel | |
| 454 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 455 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 456 | ret &= ~0x08; // sprite hit | |
| 457 | else | |
| 458 | ret |= 0x08; // no sprite hit | |
| 459 | ||
| 460 | // light gun trigger | |
| 461 | ret |= (m_zapper_latch[0][0] << 4); | |
| 462 | } | |
| 463 | break; | |
| 464 | ||
| 465 | case 0x02: // FC Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4 | |
| 466 | if (m_fck_scan < 9) | |
| 467 | ret |= ~(((m_io_fckey[m_fck_scan]->read() >> (m_fck_mode * 4)) & 0x0f) << 1) & 0x1e; | |
| 468 | else | |
| 469 | ret |= 0x1e; | |
| 470 | break; | |
| 471 | ||
| 472 | case 0x03: // Subor Keyboard: rows of the keyboard matrix are read 4-bits at time and returned as bit1->bit4 | |
| 473 | if (m_fck_scan < 12) | |
| 474 | ret |= ~(((m_io_subkey[m_fck_scan]->read() >> (m_fck_mode * 4)) & 0x0f) << 1) & 0x1e; | |
| 475 | else | |
| 476 | ret |= 0x1e; | |
| 477 | break; | |
| 478 | ||
| 479 | case 0x04: // Arkanoid paddle | |
| 480 | ret |= ((m_paddle_latch & 0x80) >> 6); // paddle data | |
| 481 | m_paddle_latch <<= 1; | |
| 482 | m_paddle_latch &= 0xff; | |
| 483 | break; | |
| 484 | ||
| 485 | case 0x05: // family trainer | |
| 486 | case 0x06: // family trainer | |
| 487 | if (!BIT(m_ftrainer_scan, 0)) | |
| 488 | { | |
| 489 | // read low line: buttons 9,10,11,12 | |
| 490 | for (int i = 0; i < 4; i++) | |
| 491 | ret |= ((m_io_ftrainer[i]->read() & 0x01) << (1 + i)); | |
| 492 | } | |
| 493 | else if (!BIT(m_ftrainer_scan, 1)) | |
| 494 | { | |
| 495 | // read mid line: buttons 5,6,7,8 | |
| 496 | for (int i = 0; i < 4; i++) | |
| 497 | ret |= ((m_io_ftrainer[i]->read() & 0x02) << (1 + i)); | |
| 498 | } | |
| 499 | else if (!BIT(m_ftrainer_scan, 2)) | |
| 500 | { | |
| 501 | // read high line: buttons 1,2,3,4 | |
| 502 | for (int i = 0; i < 4; i++) | |
| 503 | ret |= ((m_io_ftrainer[i]->read() & 0x04) << (1 + i)); | |
| 504 | } | |
| 505 | break; | |
| 506 | ||
| 507 | case 0x07: // Mahjong Panel | |
| 508 | ret |= ((m_mjpanel_latch & 0x01) << 1); | |
| 509 | m_mjpanel_latch >>= 1; | |
| 510 | break; | |
| 511 | ||
| 512 | case 0x08: // 'multitap' p4 | |
| 513 | ret |= ((m_pad_latch[3] & 0x01) << 1); | |
| 514 | m_pad_latch[3] >>= 1; | |
| 515 | break; | |
| 516 | } | |
| 517 | ||
| 518 | if (LOG_JOY) | |
| 519 | logerror("joy 1 read, val: %02x, pc: %04x\n", ret, space.device().safe_pc()); | |
| 520 | ||
| 169 | // finally, read the expansion port as expected (standard pad cannot be hooked as P4, so | |
| 170 | // no read_bit0 here) | |
| 171 | ret |= m_exp->read_exp(1); | |
| 521 | 172 | return ret; |
| 522 | 173 | } |
| 523 | 174 | |
| 524 | 175 | WRITE8_MEMBER(nes_state::fc_in0_w) |
| 525 | 176 | { |
| 526 | int cfg = m_io_ctrlsel->read(); | |
| 527 | int exp = m_io_exp->read(); | |
| 528 | ||
| 529 | if (LOG_JOY) | |
| 530 | logerror("joy write, val: %02x, pc: %04x\n", data, space.device().safe_pc()); | |
| 531 | ||
| 532 | // Check if lightgun has been chosen as input: if so, enable crosshair | |
| 533 | timer_set(attotime::zero, TIMER_LIGHTGUN_TICK); | |
| 534 | ||
| 535 | // keyboards | |
| 536 | if ((exp & 0x0f) == 0x02 || (exp & 0x0f) == 0x03) | |
| 537 | { | |
| 538 | // tape output (not fully tested) | |
| 539 | if ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_RECORD) | |
| 540 | m_cassette->output(((data & 0x07) == 0x07) ? +1.0 : -1.0); | |
| 541 | ||
| 542 | if (BIT(data, 2)) // keyboard active | |
| 543 | { | |
| 544 | int lines = ((exp & 0x0f) == 0x02) ? 9 : 12; | |
| 545 | UINT8 out = BIT(data, 1); // scan | |
| 546 | ||
| 547 | if (m_fck_mode && !out && ++m_fck_scan > lines) | |
| 548 | m_fck_scan = 0; | |
| 549 | ||
| 550 | m_fck_mode = out; // access lower or upper 4 bits | |
| 551 | ||
| 552 | if (BIT(data, 0)) // reset | |
| 553 | m_fck_scan = 0; | |
| 554 | } | |
| 555 | } | |
| 556 | ||
| 557 | // family trainer | |
| 558 | if ((exp & 0x0f) == 0x05 || (exp & 0x0f) == 0x06) | |
| 559 | { | |
| 560 | // select raw to scan | |
| 561 | m_ftrainer_scan = data & 0x07; | |
| 562 | } | |
| 563 | ||
| 564 | if (data & 0x01) | |
| 565 | return; | |
| 566 | ||
| 567 | // Toggling bit 0 high then low resets controllers | |
| 568 | m_pad_latch[0] = 0; | |
| 569 | m_pad_latch[1] = 0; | |
| 570 | m_pad_latch[2] = 0; | |
| 571 | m_pad_latch[3] = 0; | |
| 572 | m_zapper_latch[0][0] = 0; | |
| 573 | m_zapper_latch[0][1] = 0; | |
| 574 | m_zapper_latch[0][2] = 0; | |
| 575 | m_paddle_btn_latch = 0; | |
| 576 | m_paddle_latch = 0; | |
| 577 | m_mjpanel_latch = 0; | |
| 578 | m_mic_obstruct = 0; | |
| 579 | ||
| 580 | // P1 inputs | |
| 581 | switch (cfg & 0x000f) | |
| 582 | { | |
| 583 | case 0x01: // pad 1 | |
| 584 | m_pad_latch[0] = m_io_pad[0]->read(); | |
| 585 | break; | |
| 586 | ||
| 587 | case 0x02: // crazy climber (left stick) | |
| 588 | m_pad_latch[0] = m_io_cc_left->read(); | |
| 589 | break; | |
| 590 | } | |
| 591 | ||
| 592 | // P2 inputs | |
| 593 | switch ((cfg & 0x00f0) >> 4) | |
| 594 | { | |
| 595 | case 0x01: // pad 2 | |
| 596 | m_pad_latch[1] = m_io_pad[1]->read(); | |
| 597 | break; | |
| 598 | ||
| 599 | case 0x02: // crazy climber (right stick) | |
| 600 | m_pad_latch[1] = m_io_cc_right->read(); | |
| 601 | break; | |
| 602 | ||
| 603 | case 0x0f: // pad 2 old style with microphone instead of START/SELECT keys | |
| 604 | // we only emulate obstruction of mic (when you blow or talk into it) | |
| 605 | m_mic_obstruct = m_io_pad[1]->read() & 0x04; | |
| 606 | m_pad_latch[1] = (m_io_pad[1]->read() & ~0x04); | |
| 607 | break; | |
| 608 | } | |
| 609 | ||
| 610 | // P3 & P4 inputs in Famicom (e.g. through Hori Twin Adapter or Hori 4 Players Adapter) | |
| 611 | // are read in parallel with P1 & P2 (just using diff bits) | |
| 612 | // P3 inputs | |
| 613 | if ((exp & 0x0f) == 8 && (cfg & 0x0f00) == 0x0100) | |
| 614 | m_pad_latch[2] = m_io_pad[2]->read(); // pad 3 | |
| 615 | ||
| 616 | // P4 inputs | |
| 617 | if ((exp & 0x0f) == 8 && (cfg & 0xf000) == 0x1000) | |
| 618 | m_pad_latch[3] = m_io_pad[3]->read(); // pad 4 | |
| 619 | ||
| 620 | ||
| 621 | // EXP input | |
| 622 | switch (exp & 0x0f) | |
| 623 | { | |
| 624 | case 0x01: // Lightgun | |
| 625 | m_zapper_latch[0][0] = m_io_zapper2_t->read(); | |
| 626 | m_zapper_latch[0][1] = m_io_zapper2_x->read(); | |
| 627 | m_zapper_latch[0][2] = m_io_zapper2_y->read(); | |
| 628 | break; | |
| 629 | ||
| 630 | case 0x02: // FC Keyboard | |
| 631 | case 0x03: // Subor Keyboard | |
| 632 | // these are scanned differently than other devices: | |
| 633 | // writes to $4016 with bit2 set always update the | |
| 634 | // line counter and writing bit0 set resets the counter | |
| 635 | break; | |
| 636 | ||
| 637 | case 0x04: // Arkanoid paddle | |
| 638 | m_paddle_btn_latch = m_io_paddle_btn->read(); | |
| 639 | m_paddle_latch = (UINT8) (m_io_paddle->read() ^ 0xff); | |
| 640 | break; | |
| 641 | ||
| 642 | case 0x05: // family trainer | |
| 643 | case 0x06: // family trainer | |
| 644 | // these are scanned differently than other devices: | |
| 645 | // bit0-bit2 of writes to $4016 select the row to read | |
| 646 | // from from the mat input "columns" | |
| 647 | break; | |
| 648 | ||
| 649 | ||
| 650 | case 0x07: // Mahjong Panel | |
| 651 | if (data & 0xf8) | |
| 652 | logerror("Error: Mahjong panel read with mux data %02x\n", (data & 0xfe)); | |
| 653 | else | |
| 654 | m_mjpanel_latch = m_io_mahjong[(data & 0xfe) >> 1]->read(); | |
| 655 | break; | |
| 656 | } | |
| 657 | ||
| 177 | m_ctrl1->write(data); | |
| 178 | m_ctrl2->write(data); | |
| 179 | m_exp->write(data); | |
| 658 | 180 | } |
| 659 | 181 | |
| 660 | 182 | |
| 661 | void nes_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
| 662 | { | |
| 663 | switch (id) | |
| 664 | { | |
| 665 | case TIMER_ZAPPER_TICK: | |
| 666 | if ((m_io_ctrlsel->read() & 0x000f) == 0x0002) | |
| 667 | { | |
| 668 | /* enable lightpen crosshair */ | |
| 669 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_ALL); | |
| 670 | } | |
| 671 | else | |
| 672 | { | |
| 673 | /* disable lightpen crosshair */ | |
| 674 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_NONE); | |
| 675 | } | |
| 676 | ||
| 677 | if ((m_io_ctrlsel->read() & 0x00f0) == 0x0020) | |
| 678 | { | |
| 679 | /* enable lightpen crosshair */ | |
| 680 | crosshair_set_screen(machine(), 1, CROSSHAIR_SCREEN_ALL); | |
| 681 | } | |
| 682 | else | |
| 683 | { | |
| 684 | /* disable lightpen crosshair */ | |
| 685 | crosshair_set_screen(machine(), 1, CROSSHAIR_SCREEN_NONE); | |
| 686 | } | |
| 687 | break; | |
| 688 | case TIMER_LIGHTGUN_TICK: | |
| 689 | if ((m_io_exp->read() & 0x0f) == 0x01) | |
| 690 | { | |
| 691 | /* enable lightpen crosshair */ | |
| 692 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_ALL); | |
| 693 | } | |
| 694 | else | |
| 695 | { | |
| 696 | /* disable lightpen crosshair */ | |
| 697 | crosshair_set_screen(machine(), 0, CROSSHAIR_SCREEN_NONE); | |
| 698 | } | |
| 699 | break; | |
| 700 | default: | |
| 701 | assert_always(FALSE, "Unknown id in nes_state::device_timer"); | |
| 702 | } | |
| 703 | } | |
| 704 | ||
| 705 | ||
| 706 | 183 | DRIVER_INIT_MEMBER(nes_state,famicom) |
| 707 | 184 | { |
| 708 | 185 | // setup alt input handlers for additional FC input devices |
| r243151 | r243152 | |
| 711 | 188 | space.install_write_handler(0x4016, 0x4016, write8_delegate(FUNC(nes_state::fc_in0_w), this)); |
| 712 | 189 | space.install_read_handler(0x4017, 0x4017, read8_delegate(FUNC(nes_state::fc_in1_r), this)); |
| 713 | 190 | } |
| 191 | ||
| 192 | NESCTRL_BRIGHTPIXEL_CB(nes_state::bright_pixel) | |
| 193 | { | |
| 194 | // get the pixel at the gun position | |
| 195 | UINT32 pix = m_ppu->get_pixel(x, y); | |
| 196 | ||
| 197 | // get the color base from the ppu | |
| 198 | UINT32 color_base = m_ppu->get_colorbase(); | |
| 199 | ||
| 200 | // check if the cursor is over a bright pixel | |
| 201 | if ((pix == color_base + 0x20) || (pix == color_base + 0x30) || | |
| 202 | (pix == color_base + 0x33) || (pix == color_base + 0x34)) | |
| 203 | return true; | |
| 204 | else | |
| 205 | return false; | |
| 206 | } |
| r243151 | r243152 | |
|---|---|---|
| 54 | 54 | jaguar // Atari Jaguar |
| 55 | 55 | jaguarcd // Atari Jaguar CD |
| 56 | 56 | |
| 57 | //BancTec | |
| 58 | banctec // BancTec ESeries panel | |
| 59 | ||
| 57 | 60 | // Nintendo |
| 58 | 61 | nes // Nintendo Entertainment System |
| 59 | 62 | nespal // Nintendo Entertainment System PAL |
| r243151 | r243152 | |
|---|---|---|
| 614 | 614 | BUSES += MSX_SLOT |
| 615 | 615 | BUSES += NEOGEO |
| 616 | 616 | BUSES += NES |
| 617 | BUSES += NES_CTRL | |
| 617 | 618 | BUSES += NUBUS |
| 618 | 619 | BUSES += O2 |
| 619 | 620 | BUSES += ORICEXT |
| r243151 | r243152 | |
| 678 | 679 | $(MESSOBJ)/att.a \ |
| 679 | 680 | $(MESSOBJ)/bally.a \ |
| 680 | 681 | $(MESSOBJ)/bandai.a \ |
| 682 | $(MESSOBJ)/banctec.a \ | |
| 681 | 683 | $(MESSOBJ)/be.a \ |
| 682 | 684 | $(MESSOBJ)/bnpo.a \ |
| 683 | 685 | $(MESSOBJ)/bondwell.a \ |
| r243151 | r243152 | |
| 1041 | 1043 | $(MESSOBJ)/bally.a: \ |
| 1042 | 1044 | $(MESS_DRIVERS)/astrocde.o \ |
| 1043 | 1045 | |
| 1046 | $(MESSOBJ)/banctec.a: \ | |
| 1047 | $(MESS_DRIVERS)/banctec.o \ | |
| 1048 | ||
| 1044 | 1049 | $(MESSOBJ)/bandai.a: \ |
| 1045 | 1050 | $(MESS_DRIVERS)/sv8000.o \ |
| 1046 | 1051 | $(MESS_DRIVERS)/rx78.o \ |
| https://github.com/mamedev/mame/commit/20ac212400087f70418a2e070c00d05d319e66f3 |
| Previous | 199869 Revisions | Next |