Fixed joystick ports

This commit is contained in:
Angelo Salese 2012-12-19 00:55:24 +00:00
parent 0af0e5f218
commit b6b70d54a2
6 changed files with 58 additions and 57 deletions

View File

@ -3560,20 +3560,6 @@ INTERRUPT_GEN_MEMBER(pc9801_state::pc9801_vrtc_irq)
// pic8259_ir2_w(machine().device("pic8259_master"), 0);
}
#if 0
static const ym2608_interface pc98_ym2608_intf =
{
{
AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
AY8910_DEFAULT_LOADS,
DEVCB_DRIVER_MEMBER(pc9801_state,opn_porta_r),
DEVCB_NULL,//(pc9801_state,opn_portb_r),
DEVCB_NULL,//(pc9801_state,opn_porta_w),
DEVCB_DRIVER_MEMBER(pc9801_state,opn_portb_w),
},
pc9801_sound_irq
};
#endif
FLOPPY_FORMATS_MEMBER( pc9801_state::floppy_formats )
FLOPPY_PC98FDI_FORMAT
@ -3604,6 +3590,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_FRAGMENT( pc9801_cbus )
MCFG_PC9801CBUS_SLOT_ADD("cbus0", pc9801_cbus, "pc9801_26", NULL)
// MCFG_PC9801CBUS_SLOT_ADD("cbus1", pc9801_cbus, NULL, NULL)
// TODO: six max slots
MACHINE_CONFIG_END
@ -3826,9 +3813,6 @@ MACHINE_CONFIG_END
ROM_REGION( 0x100000, "kanji", ROMREGION_ERASEFF ) \
ROM_REGION( 0x80000, "new_chargen", ROMREGION_ERASEFF ) \
#define OPNA_LOAD \
ROM_REGION( 0x100000, "opna", ROMREGION_ERASE00 ) \
/*
F - 8086 5
*/
@ -3881,7 +3865,6 @@ ROM_START( pc9801ux )
ROM_LOAD( "font_ux.rom", 0x000000, 0x046800, BAD_DUMP CRC(19a76eeb) SHA1(96a006e8515157a624599c2b53a581ae0dd560fd) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -3900,7 +3883,6 @@ ROM_START( pc9801rx )
ROM_LOAD( "font_rx.rom", 0x000000, 0x046800, CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -3932,7 +3914,6 @@ ROM_START( pc9801rs )
ROM_LOAD( "font_rs.rom", 0x00000, 0x46800, BAD_DUMP CRC(da370e7a) SHA1(584d0c7fde8c7eac1f76dc5e242102261a878c5e) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -3953,7 +3934,6 @@ ROM_START( pc9801vm )
ROM_LOAD( "font_vm.rom", 0x000000, 0x046800, BAD_DUMP CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -3977,7 +3957,6 @@ ROM_START( pc9821 )
ROM_LOAD( "font.rom", 0x00000, 0x46800, BAD_DUMP CRC(a61c0649) SHA1(554b87377d176830d21bd03964dc71f8e98676b1) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -3999,7 +3978,6 @@ ROM_START( pc9821as )
ROM_LOAD( "font_as.rom", 0x000000, 0x046800, BAD_DUMP CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff) )
KANJI_ROMS
OPNA_LOAD
ROM_END
@ -4022,7 +4000,6 @@ ROM_START( pc9821ne )
ROM_LOAD( "font_ne.rom", 0x00000, 0x46800, BAD_DUMP CRC(fb213757) SHA1(61525826d62fb6e99377b23812faefa291d78c2e) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -4044,7 +4021,6 @@ ROM_START( pc486mu )
ROM_LOAD( "font_486mu.rom", 0x0000, 0x46800, CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff))
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -4066,7 +4042,6 @@ ROM_START( pc9821ce2 )
ROM_LOAD( "font_ce2.rom", 0x000000, 0x046800, CRC(d1c2702a) SHA1(e7781e9d35b6511d12631641d029ad2ba3f7daef) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -4088,7 +4063,6 @@ ROM_START( pc9821xs )
ROM_LOAD( "font_xs.rom", 0x000000, 0x046800, BAD_DUMP CRC(c9a77d8f) SHA1(deb8563712eb2a634a157289838b95098ba0c7f2) )
KANJI_ROMS
OPNA_LOAD
ROM_END
@ -4111,7 +4085,6 @@ ROM_START( pc9821v13 )
ROM_LOAD( "font_a.rom", 0x00000, 0x46800, BAD_DUMP CRC(c9a77d8f) SHA1(deb8563712eb2a634a157289838b95098ba0c7f2) )
KANJI_ROMS
OPNA_LOAD
ROM_END
/*
@ -4133,7 +4106,6 @@ ROM_START( pc9821v20 )
ROM_LOAD( "font_v20.rom", 0x000000, 0x046800, BAD_DUMP CRC(6244c4c0) SHA1(9513cac321e89b4edb067b30e9ecb1adae7e7be7) )
KANJI_ROMS
OPNA_LOAD
ROM_END

View File

@ -26,14 +26,9 @@ const device_type PC9801_118 = &device_creator<pc9801_118_device>;
READ8_MEMBER(pc9801_118_device::opn_porta_r)
{
if(m_joy_sel == 0x80)
return ioport("OPNA_PA1")->read();
if(m_joy_sel & 0x80)
return ioport(m_joy_sel & 0x40 ? "OPN3_PA2" : "OPN3_PA1")->read();
if(m_joy_sel == 0xc0)
return ioport("OPNA_PA2")->read();
// 0x81?
// printf("%02x\n",m_joy_sel);
return 0xff;
}
@ -83,7 +78,7 @@ machine_config_constructor pc9801_118_device::device_mconfig_additions() const
//-------------------------------------------------
static INPUT_PORTS_START( pc9801_118 )
PORT_START("OPNA_PA1")
PORT_START("OPN3_PA1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Up")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Down")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Left")
@ -92,7 +87,7 @@ static INPUT_PORTS_START( pc9801_118 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2")
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("OPNA_PA2")
PORT_START("OPN3_PA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Down")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Left")
@ -100,6 +95,11 @@ static INPUT_PORTS_START( pc9801_118 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
// PORT_START("OPN_DSW")
// PORT_CONFNAME( 0x01, 0x01, "PC-9801-118: Port Base" )
// PORT_CONFSETTING( 0x00, "0x088" )
// PORT_CONFSETTING( 0x01, "0x188" )
INPUT_PORTS_END
ioport_constructor pc9801_118_device::device_input_ports() const
@ -107,6 +107,16 @@ ioport_constructor pc9801_118_device::device_input_ports() const
return INPUT_PORTS_NAME( pc9801_118 );
}
// RAM
ROM_START( pc9801_118 )
ROM_REGION( 0x100000, "opn3", ROMREGION_ERASE00 )
ROM_END
const rom_entry *pc9801_118_device::device_rom_region() const
{
return ROM_NAME( pc9801_118 );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
@ -160,7 +170,8 @@ void pc9801_118_device::install_device(offs_t start, offs_t end, offs_t mask, of
void pc9801_118_device::device_start()
{
install_device(0x0188, 0x018f, 0, 0, read8_delegate(FUNC(pc9801_118_device::pc9801_118_r), this), write8_delegate(FUNC(pc9801_118_device::pc9801_118_w), this) );
UINT16 port_base = 0x100;//(ioport("OPN_DSW")->read() & 1) << 8;
install_device(port_base + 0x0088, port_base + 0x008f, 0, 0, read8_delegate(FUNC(pc9801_118_device::pc9801_118_r), this), write8_delegate(FUNC(pc9801_118_device::pc9801_118_w), this) );
install_device(0xa460, 0xa463, 0, 0, read8_delegate(FUNC(pc9801_118_device::pc9801_118_ext_r), this), write8_delegate(FUNC(pc9801_118_device::pc9801_118_ext_w), this) );
}

View File

@ -39,6 +39,7 @@ public:
// required_device<cpu_device> m_maincpu;
required_device<ym2608_device> m_opn3;
virtual const rom_entry *device_rom_region() const;
protected:
// device-level overrides
virtual void device_validity_check(validity_checker &valid) const;

View File

@ -21,16 +21,12 @@
const device_type PC9801_26 = &device_creator<pc9801_26_device>;
READ8_MEMBER(pc9801_26_device::opn_porta_r)
{
if(m_joy_sel == 0x80)
return ioport("OPN_PA1")->read();
if(m_joy_sel & 0x80)
return ioport(m_joy_sel & 0x40 ? "OPN_PA2" : "OPN_PA1")->read();
if(m_joy_sel == 0xc0)
return ioport("OPN_PA2")->read();
// 0x81?
// printf("%02x\n",m_joy_sel);
return 0xff;
}
@ -87,7 +83,8 @@ static INPUT_PORTS_START( pc9801_26 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Right")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2")
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("OPN_PA2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up")
@ -96,7 +93,13 @@ static INPUT_PORTS_START( pc9801_26 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Right")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
// PORT_START("OPN_DSW")
// PORT_CONFNAME( 0x01, 0x01, "PC-9801-26: Port Base" )
// PORT_CONFSETTING( 0x00, "0x088" )
// PORT_CONFSETTING( 0x01, "0x188" )
INPUT_PORTS_END
ioport_constructor pc9801_26_device::device_input_ports() const
@ -157,7 +160,8 @@ void pc9801_26_device::install_device(offs_t start, offs_t end, offs_t mask, off
void pc9801_26_device::device_start()
{
install_device(0x0188, 0x018b, 0, 0, read8_delegate(FUNC(pc9801_26_device::pc9801_26_r), this), write8_delegate(FUNC(pc9801_26_device::pc9801_26_w), this) );
UINT16 port_base = 0x100;//(ioport("OPN_DSW")->read() & 1) << 8;
install_device(port_base + 0x0088, port_base + 0x008b, 0, 0, read8_delegate(FUNC(pc9801_26_device::pc9801_26_r), this), write8_delegate(FUNC(pc9801_26_device::pc9801_26_w), this) );
}

View File

@ -27,14 +27,9 @@ const device_type PC9801_86 = &device_creator<pc9801_86_device>;
READ8_MEMBER(pc9801_86_device::opn_porta_r)
{
if(m_joy_sel == 0x80)
return ioport("OPNA_PA1")->read();
if(m_joy_sel & 0x80)
return ioport(m_joy_sel & 0x40 ? "OPNA_PA2" : "OPNA_PA1")->read();
if(m_joy_sel == 0xc0)
return ioport("OPNA_PA2")->read();
// 0x81?
// printf("%02x\n",m_joy_sel);
return 0xff;
}
@ -78,6 +73,16 @@ machine_config_constructor pc9801_86_device::device_mconfig_additions() const
return MACHINE_CONFIG_NAME( pc9801_86_config );
}
// RAM
ROM_START( pc9801_86 )
ROM_REGION( 0x100000, "opna", ROMREGION_ERASE00 )
ROM_END
const rom_entry *pc9801_86_device::device_rom_region() const
{
return ROM_NAME( pc9801_86 );
}
//-------------------------------------------------
// input_ports - device-specific input ports
@ -101,6 +106,11 @@ static INPUT_PORTS_START( pc9801_86 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
// PORT_START("OPN_DSW")
// PORT_CONFNAME( 0x01, 0x01, "PC-9801-86: Port Base" )
// PORT_CONFSETTING( 0x00, "0x088" )
// PORT_CONFSETTING( 0x01, "0x188" )
INPUT_PORTS_END
ioport_constructor pc9801_86_device::device_input_ports() const
@ -161,8 +171,10 @@ void pc9801_86_device::install_device(offs_t start, offs_t end, offs_t mask, off
void pc9801_86_device::device_start()
{
install_device(0x0188, 0x018f, 0, 0, read8_delegate(FUNC(pc9801_86_device::pc9801_86_r), this), write8_delegate(FUNC(pc9801_86_device::pc9801_86_w), this) );
UINT16 port_base = 0x100;//(ioport("OPN_DSW")->read() & 1) << 8;
install_device(port_base + 0x0088, port_base + 0x008f, 0, 0, read8_delegate(FUNC(pc9801_86_device::pc9801_86_r), this), write8_delegate(FUNC(pc9801_86_device::pc9801_86_w), this) );
// install_device(0xa460, 0xa463, 0, 0, read8_delegate(FUNC(pc9801_86_device::pc9801_86_ext_r), this), write8_delegate(FUNC(pc9801_86_device::pc9801_86_ext_w), this) );
}

View File

@ -38,6 +38,7 @@ public:
// required_device<cpu_device> m_maincpu;
required_device<ym2608_device> m_opna;
virtual const rom_entry *device_rom_region() const;
protected:
// device-level overrides
virtual void device_validity_check(validity_checker &valid) const;