From 5f23ecb3ceb584a9656da8a280e0af641bacfa7d Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 15 Dec 2022 02:19:14 +1100 Subject: More Sega cleanup: * bus/megadrive/jcart.cpp: Turned controller ports into slots - no need to simulate controllers in the cartridge device. * sega/megadriv.cpp: Simplified wired 6-button controller to use a single input port per pad. * megadriv_rad.cpp: Changed to use A/B/C/X/Y/Z button labels like the real systems, added reset buttons to a couple of units that have them. * puckpkmn.cpp: Considering boards without the U6612 exist, assume it uses a Mega Drive II VDP clone with integrated FM sound. --- src/devices/bus/megadrive/jcart.cpp | 112 ++++++++++++++---------------------- src/devices/bus/megadrive/jcart.h | 20 +++---- src/mame/sega/megadriv.cpp | 26 +++++---- src/mame/sega/megadriv.h | 4 +- src/mame/sega/megadriv_acbl.cpp | 48 ++++++---------- src/mame/sega/megadriv_rad.cpp | 71 ++++++++++------------- src/mame/sega/puckpkmn.cpp | 11 ++-- 7 files changed, 123 insertions(+), 169 deletions(-) diff --git a/src/devices/bus/megadrive/jcart.cpp b/src/devices/bus/megadrive/jcart.cpp index d41116d762e..c2869b397a5 100644 --- a/src/devices/bus/megadrive/jcart.cpp +++ b/src/devices/bus/megadrive/jcart.cpp @@ -25,6 +25,8 @@ #include "emu.h" #include "jcart.h" +#include "bus/sms_ctrl/controllers.h" + //------------------------------------------------- // md_rom_device - constructor @@ -38,8 +40,7 @@ DEFINE_DEVICE_TYPE(MD_SEPROM_MM96, md_seprom_mm96_device, "md_seprom_mm9 md_jcart_device::md_jcart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , device_md_cart_interface(mconfig, *this) - , m_jcart3(*this, "JCART3") - , m_jcart4(*this, "JCART4") + , m_ctrl_ports(*this, "control%u", 3U) { } @@ -76,59 +77,52 @@ md_seprom_mm96_device::md_seprom_mm96_device(const machine_config &mconfig, cons // device_add_mconfig - add device configuration //------------------------------------------------- +void md_jcart_device::device_add_mconfig(machine_config &config) +{ + SMS_CONTROL_PORT(config, m_ctrl_ports[0], sms_control_port_devices, SMS_CTRL_OPTION_MD_PAD); + m_ctrl_ports[0]->th_handler().set(FUNC(md_jcart_device::th_in<0>)); + + SMS_CONTROL_PORT(config, m_ctrl_ports[1], sms_control_port_devices, SMS_CTRL_OPTION_MD_PAD); + m_ctrl_ports[1]->th_handler().set(FUNC(md_jcart_device::th_in<1>)); +} + void md_seprom_codemast_device::device_add_mconfig(machine_config &config) { + md_jcart_device::device_add_mconfig(config); + I2C_24C08(config, m_i2cmem); } void md_seprom_mm96_device::device_add_mconfig(machine_config &config) { + md_jcart_device::device_add_mconfig(config); + I2C_24C16(config, m_i2cmem); // 24C16A } -static INPUT_PORTS_START( jcart_ipt ) - - PORT_START("JCART3") /* Joypad 3 on J-Cart (3 button + start) */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("%p Up") - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("%p Down") - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("%p Left") - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("%p Right") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("%p B") - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("%p C") - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("%p A") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) PORT_NAME("%p Start") - - PORT_START("JCART4") /* Joypad 4 on J-Cart (3 button + start) */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("%p Up") - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("%p Down") - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("%p Left") - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("%p Right") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("%p B") - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("%p C") - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("%p A") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) PORT_NAME("%p Start") -INPUT_PORTS_END - -ioport_constructor md_jcart_device::device_input_ports() const +void md_jcart_device::device_resolve_objects() { - return INPUT_PORTS_NAME( jcart_ipt ); + m_th_in[0] = m_th_in[1] = 0x40; + m_th_out = 0x40; } void md_jcart_device::device_start() { - save_item(NAME(m_jcart_io_data)); + save_item(NAME(m_th_in)); + save_item(NAME(m_th_out)); } void md_jcart_device::device_reset() { - m_jcart_io_data[0] = 0; - m_jcart_io_data[1] = 0; + // TODO: does this cause the TH outputs to reset to high? } void md_seprom_codemast_device::device_start() { + md_jcart_device::device_start(); + save_item(NAME(m_i2c_mem)); save_item(NAME(m_i2c_clk)); save_item(NAME(m_jcart_io_data)); @@ -136,6 +130,8 @@ void md_seprom_codemast_device::device_start() void md_seprom_codemast_device::device_reset() { + md_jcart_device::device_reset(); + m_i2c_mem = 0; m_i2c_clk = 0; m_jcart_io_data[0] = 0; @@ -155,20 +151,9 @@ uint16_t md_jcart_device::read(offs_t offset) { if (offset == 0x38fffe/2) { - uint8_t joy[2]; - - if (m_jcart_io_data[0] & 0x40) - { - joy[0] = m_jcart3->read(); - joy[1] = m_jcart4->read(); - return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8); - } - else - { - joy[0] = ((m_jcart3->read() & 0xc0) >> 2) | (m_jcart3->read() & 0x03); - joy[1] = ((m_jcart4->read() & 0xc0) >> 2) | (m_jcart4->read() & 0x03); - return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8); - } + uint16_t const ctrl3 = (m_ctrl_ports[0]->in_r() & 0x3f) | (m_th_in[0] & m_th_out) | 0x80; + uint16_t const ctrl4 = (m_ctrl_ports[1]->in_r() & 0x3f) | (m_th_in[1] & m_th_out) | 0x80; + return ctrl3 | (ctrl4 << 8); } if (offset < 0x400000/2) return m_rom[MD_ADDR(offset)]; @@ -180,11 +165,20 @@ void md_jcart_device::write(offs_t offset, uint16_t data, uint16_t mem_mask) { if (offset == 0x38fffe/2) { - m_jcart_io_data[0] = (data & 1) << 6; - m_jcart_io_data[1] = (data & 1) << 6; + // assume TH only actively driven low + m_th_out = BIT(data, 0) << 6; + m_ctrl_ports[0]->out_w(m_th_out | 0x3f, ~m_th_out & 0x40); + m_ctrl_ports[1]->out_w(m_th_out | 0x3f, ~m_th_out & 0x40); } } +template +DECLARE_WRITE_LINE_MEMBER(md_jcart_device::th_in) +{ + m_th_in[N] = state ? 0x40 : 0x00; +} + + /*------------------------------------------------- J-CART + SEPROM -------------------------------------------------*/ @@ -196,27 +190,10 @@ uint16_t md_seprom_codemast_device::read(offs_t offset) m_i2c_mem = m_i2cmem->read_sda(); return (m_i2c_mem & 1) << 7; } - if (offset == 0x38fffe/2) + else { - uint8_t joy[2]; - - if (m_jcart_io_data[0] & 0x40) - { - joy[0] = m_jcart3->read(); - joy[1] = m_jcart4->read(); - return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8); - } - else - { - joy[0] = ((m_jcart3->read() & 0xc0) >> 2) | (m_jcart3->read() & 0x03); - joy[1] = ((m_jcart4->read() & 0xc0) >> 2) | (m_jcart4->read() & 0x03); - return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8); - } + return md_jcart_device::read(offset); } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else - return 0xffff; } void md_seprom_codemast_device::write(offs_t offset, uint16_t data, uint16_t mem_mask) @@ -228,9 +205,8 @@ void md_seprom_codemast_device::write(offs_t offset, uint16_t data, uint16_t mem m_i2cmem->write_scl(m_i2c_clk); m_i2cmem->write_sda(m_i2c_mem); } - if (offset == 0x38fffe/2) + else { - m_jcart_io_data[0] = (data & 1) << 6; - m_jcart_io_data[1] = (data & 1) << 6; + md_jcart_device::write(offset, data, mem_mask); } } diff --git a/src/devices/bus/megadrive/jcart.h b/src/devices/bus/megadrive/jcart.h index 473c6ec2ce3..52c3e533f08 100644 --- a/src/devices/bus/megadrive/jcart.h +++ b/src/devices/bus/megadrive/jcart.h @@ -4,6 +4,8 @@ #define MAME_BUS_NEGADRIVE_JCART_H #include "md_slot.h" + +#include "bus/sms_ctrl/smsctrl.h" #include "machine/i2cmem.h" @@ -11,8 +13,6 @@ // TYPE DEFINITIONS //************************************************************************** -// ======================> md_jcart_device - class md_jcart_device : public device_t, public device_md_cart_interface { @@ -20,9 +20,6 @@ public: // construction/destruction md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - // device-level overrides - virtual ioport_constructor device_input_ports() const override; - // reading and writing virtual uint16_t read(offs_t offset) override; virtual void write(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; @@ -30,17 +27,19 @@ public: protected: md_jcart_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + virtual void device_add_mconfig(machine_config &config) override; + virtual void device_resolve_objects() override; virtual void device_start() override; virtual void device_reset() override; - required_ioport m_jcart3; - required_ioport m_jcart4; - private: - uint8_t m_jcart_io_data[2]; + template DECLARE_WRITE_LINE_MEMBER(th_in); + + required_device_array m_ctrl_ports; + uint8_t m_th_in[2]; + uint8_t m_th_out; }; -// ======================> md_seprom_codemast_device class md_seprom_codemast_device : public md_jcart_device { @@ -68,7 +67,6 @@ private: uint8_t m_i2c_mem, m_i2c_clk; }; -// ======================> md_seprom_mm96_device (same read/write as codemast, but different I2C type) class md_seprom_mm96_device : public md_seprom_codemast_device { diff --git a/src/mame/sega/megadriv.cpp b/src/mame/sega/megadriv.cpp index 1fed6f2cabc..89c5012ca83 100644 --- a/src/mame/sega/megadriv.cpp +++ b/src/mame/sega/megadriv.cpp @@ -141,25 +141,27 @@ TIMER_CALLBACK_MEMBER(md_ctrl_state::ioport_timeout) */ INPUT_PORTS_START( md_common ) - PORT_START("PAD1") // Joypad 1 (3 button + start) NOT READ DIRECTLY - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) + PORT_START("PAD1") // Joypad 1 (3 button + start) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("%p B") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("%p C") PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("%p A") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(1) + PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNUSED ) // extra buttons on 6-button pad - PORT_START("PAD2") // Joypad 2 (3 button + start) NOT READ DIRECTLY - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_START("PAD2") // Joypad 2 (3 button + start) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("%p B") PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("%p C") PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("%p A") - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START ) PORT_PLAYER(2) + PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNUSED ) // extra buttons on 6-button pad INPUT_PORTS_END @@ -201,7 +203,7 @@ uint8_t md_ctrl_state::ioport_in_6button() return BIT(pad, 6, 2) << 4; case 3: if (m_ioport_th[N]) - return (BIT(pad, 4, 2) << 4) | BIT(m_io_extra[N]->read(), 0, 4); + return (BIT(pad, 4, 2) << 4) | BIT(pad, 8, 4); else return (BIT(pad, 6, 2) << 4) | 0x0f; } @@ -899,7 +901,7 @@ void md_base_state::md2_ntsc(machine_config &config) md_ntsc(config); // Internalized YM3438 in VDP ASIC - YM3438(config.replace(), m_ymsnd, MASTER_CLOCK_NTSC/7); /* 7.67 MHz */ + YM3438(config.replace(), m_ymsnd, MASTER_CLOCK_NTSC/7); // 7.67 MHz m_ymsnd->add_route(0, "lspeaker", 0.50); m_ymsnd->add_route(1, "rspeaker", 0.50); } diff --git a/src/mame/sega/megadriv.h b/src/mame/sega/megadriv.h index e6ef80cb894..df64819ae6d 100644 --- a/src/mame/sega/megadriv.h +++ b/src/mame/sega/megadriv.h @@ -157,8 +157,7 @@ class md_ctrl_state : public md_base_state protected: md_ctrl_state(const machine_config &mconfig, device_type type, const char *tag) : md_base_state(mconfig, type, tag), - m_io_pad(*this, "PAD%u", 1U), - m_io_extra(*this, "EXTRA%u", 1U) + m_io_pad(*this, "PAD%u", 1U) { } @@ -179,7 +178,6 @@ private: TIMER_CALLBACK_MEMBER(ioport_timeout); optional_ioport_array<2> m_io_pad; - optional_ioport_array<2> m_io_extra; emu_timer *m_ioport_idle[2]; diff --git a/src/mame/sega/megadriv_acbl.cpp b/src/mame/sega/megadriv_acbl.cpp index 43903ceda56..2276c563a0f 100644 --- a/src/mame/sega/megadriv_acbl.cpp +++ b/src/mame/sega/megadriv_acbl.cpp @@ -318,24 +318,20 @@ INPUT_PORTS_START( ssf2mdb ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) // no MODE button PORT_MODIFY("PAD2") PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) - - PORT_START("EXTRA1") // Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("EXTRA2") // Extra buttons for Joypad 2 (6 button + start + mode) NOT READ DIRECTLY - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) // no MODE button PORT_START("EXP") // 3rd I/O port PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -392,24 +388,20 @@ INPUT_PORTS_START( mk3mdb ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) // no MODE button PORT_MODIFY("PAD2") PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) - - PORT_START("EXTRA1") // Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("EXTRA2") // Extra buttons for Joypad 2 (6 button + start + mode) NOT READ DIRECTLY - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED ) // no MODE button PORT_START("EXP") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -781,18 +773,14 @@ INPUT_PORTS_START( bk3ssrmb ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNUSED ) // no Z/Y/X/MODE buttons PORT_MODIFY("PAD2") PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) - - PORT_START("EXTRA1") - PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("EXTRA2") - PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_UNUSED ) // no Z/Y/X/MODE buttons PORT_START("EXP") // 3rd I/O port PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) diff --git a/src/mame/sega/megadriv_rad.cpp b/src/mame/sega/megadriv_rad.cpp index 5a589d9e62a..fbf991c7ceb 100644 --- a/src/mame/sega/megadriv_rad.cpp +++ b/src/mame/sega/megadriv_rad.cpp @@ -366,68 +366,57 @@ uint16_t megadriv_radica_state_base::read_a13(offs_t offset) static INPUT_PORTS_START( radica_3button ) PORT_INCLUDE( md_common ) - PORT_MODIFY("PAD1") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) - - PORT_MODIFY("PAD2") - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) + // TODO: how do the MENU buttons on the two controllers work? INPUT_PORTS_END // the 6-in-1 and Sonic Gold units really only have a single wired controller, and no way to connect a 2nd one, despite having some 2 player games! static INPUT_PORTS_START( radica_3button_1player ) - PORT_INCLUDE( radica_3button ) + PORT_INCLUDE( md_common ) PORT_MODIFY("PAD2") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED ) + + // TODO: how does the MENU button on the controller work? INPUT_PORTS_END static INPUT_PORTS_START( radica_6button ) - PORT_INCLUDE( radica_3button ) - - PORT_START("EXTRA1") /* Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("EXTRA2") /* Extra buttons for Joypad 2 (6 button + start + mode) NOT READ DIRECTLY */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_INCLUDE( md_common ) + + PORT_MODIFY("PAD1") // Extra buttons for Joypad 1 (6 button + start + mode) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) PORT_NAME("%p Z") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) PORT_NAME("%p Y") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("%p X") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(1) PORT_NAME("%p Mode") + + PORT_MODIFY("PAD2") // Extra buttons for Joypad 2 (6 button + start + mode) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2) PORT_NAME("%p Z") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) PORT_NAME("%p Y") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("%p X") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SELECT ) PORT_PLAYER(2) PORT_NAME("%p Mode") INPUT_PORTS_END static INPUT_PORTS_START( msi_6button ) - PORT_INCLUDE( radica_3button ) + PORT_INCLUDE( radica_6button ) PORT_MODIFY("PAD2") // no 2nd pad - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("EXTRA1") /* Extra buttons for Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */ - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("EXTRA2") // no 2nd pad - PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START("RESET") // RESET button on controller to the left of START + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_NAME("Reset") INPUT_PORTS_END static INPUT_PORTS_START( dgunl_1player ) - PORT_INCLUDE( radica_3button ) + PORT_INCLUDE( md_common ) PORT_MODIFY("PAD1") - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DEBUG", 0x01, EQUALS, 0x00) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DEBUG", 0x01, EQUALS, 0x01) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_CONDITION("DEBUG", 0x01, EQUALS, 0x00) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("%p C") PORT_CONDITION("DEBUG", 0x01, EQUALS, 0x01) - PORT_MODIFY("PAD2") - PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_MODIFY("PAD2") // no 2nd pad + PORT_BIT( 0x0fff, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("RESET") // RESET button to the left of START + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_NAME("Reset") // the unit only has 2 buttons, A and B, strings are changed to remove references to C, even if behavior in Pac-Mania still exists and differs between them // however, Pac-Man still has a test mode which requires holding A+C on startup diff --git a/src/mame/sega/puckpkmn.cpp b/src/mame/sega/puckpkmn.cpp index 96f906c2700..e2f056624f4 100644 --- a/src/mame/sega/puckpkmn.cpp +++ b/src/mame/sega/puckpkmn.cpp @@ -7,8 +7,8 @@ Seems to be based around genesis hardware, despite containing no original Sega c Supported: -Puckman Pockimon - (c)2000 Genie? (there should be a way to show Sun Mixing copyright, roms are the same - on a version with the SM (c) +Puckman Pockimon - (c)2000 Genie? +(there should be a way to show Sun Mixing copyright, ROMs are the same on a version with the SM (c)) |---------------------------------------| | VOL 4558 4MHz PAL 62256 | @@ -31,7 +31,7 @@ Puckman Pockimon - (c)2000 Genie? (there should be a way to show Sun Mixing copy Notes: Main CPU is 68000-based, but actual CPU chip is not known Master clock 53.693175MHz. CPU likely running at 53.693175/7 or /6 (??) - U6612 (YM2612 clone?) clock 3.579545MHz + U6612 (YM3812 clone?) clock 3.579545MHz U6614B (YM3014B clone?) M6295 clock 1.000MHz (4/4). Sample rate = 1000000/132 VSync 60Hz @@ -43,6 +43,8 @@ Notes: Y-BOX TA891945 (QFP100) TA-06SD 9933 B816453 (QFP128) TV16B 0010 ME251271 (QFP160) + +Some Puckman Pockimon boards have a different layout, lacking the U6612, U6614B and 3.579545MHz crystal. */ #include "emu.h" @@ -410,7 +412,8 @@ void puckpkmn_state::puckpkmn(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - YM2612(config, m_ymsnd, MASTER_CLOCK_NTSC / 7); // TODO: confirm clock + // Internalized YM3438 in VDP ASIC + YM3438(config, m_ymsnd, MASTER_CLOCK_NTSC / 7); // 7.67 MHz m_ymsnd->add_route(0, "lspeaker", 0.50); m_ymsnd->add_route(1, "rspeaker", 0.50); -- cgit v1.2.3