Previous 199869 Revisions Next

r19678 Wednesday 19th December, 2012 at 00:55:24 UTC by Angelo Salese
Fixed joystick ports
[src/mess/drivers]pc9801.c
[src/mess/machine]pc9801_118.c pc9801_118.h pc9801_26.c pc9801_86.c pc9801_86.h

trunk/src/mess/machine/pc9801_86.c
r19677r19678
2727
2828READ8_MEMBER(pc9801_86_device::opn_porta_r)
2929{
30   if(m_joy_sel == 0x80)
31      return ioport("OPNA_PA1")->read();
30   if(m_joy_sel & 0x80)
31      return ioport(m_joy_sel & 0x40 ? "OPNA_PA2" : "OPNA_PA1")->read();
3232
33   if(m_joy_sel == 0xc0)
34      return ioport("OPNA_PA2")->read();
35
36//  0x81?
37//  printf("%02x\n",m_joy_sel);
3833   return 0xff;
3934}
4035
r19677r19678
7873   return MACHINE_CONFIG_NAME( pc9801_86_config );
7974}
8075
76// RAM
77ROM_START( pc9801_86 )
78   ROM_REGION( 0x100000, "opna", ROMREGION_ERASE00 )
79ROM_END
8180
81const rom_entry *pc9801_86_device::device_rom_region() const
82{
83   return ROM_NAME( pc9801_86 );
84}
85
86
8287//-------------------------------------------------
8388//  input_ports - device-specific input ports
8489//-------------------------------------------------
r19677r19678
101106   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
102107   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
103108   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
109
110//   PORT_START("OPN_DSW")
111//   PORT_CONFNAME( 0x01, 0x01, "PC-9801-86: Port Base" )
112//   PORT_CONFSETTING(    0x00, "0x088" )
113//   PORT_CONFSETTING(    0x01, "0x188" )
104114INPUT_PORTS_END
105115
106116ioport_constructor pc9801_86_device::device_input_ports() const
r19677r19678
161171
162172void pc9801_86_device::device_start()
163173{
164   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) );
174   UINT16 port_base = 0x100;//(ioport("OPN_DSW")->read() & 1) << 8;
175   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) );
165176//   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) );
177
166178}
167179
168180
trunk/src/mess/machine/pc9801_86.h
r19677r19678
3838
3939//   required_device<cpu_device>  m_maincpu;
4040   required_device<ym2608_device>  m_opna;
41   virtual const rom_entry *device_rom_region() const;
4142protected:
4243   // device-level overrides
4344   virtual void device_validity_check(validity_checker &valid) const;
trunk/src/mess/machine/pc9801_118.c
r19677r19678
2626
2727READ8_MEMBER(pc9801_118_device::opn_porta_r)
2828{
29   if(m_joy_sel == 0x80)
30      return ioport("OPNA_PA1")->read();
29   if(m_joy_sel & 0x80)
30      return ioport(m_joy_sel & 0x40 ? "OPN3_PA2" : "OPN3_PA1")->read();
3131
32   if(m_joy_sel == 0xc0)
33      return ioport("OPNA_PA2")->read();
34
35//  0x81?
36//  printf("%02x\n",m_joy_sel);
3732   return 0xff;
3833}
3934
r19677r19678
8378//-------------------------------------------------
8479
8580static INPUT_PORTS_START( pc9801_118 )
86   PORT_START("OPNA_PA1")
81   PORT_START("OPN3_PA1")
8782   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Up")
8883   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Down")
8984   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Left")
r19677r19678
9287   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2")
9388   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
9489
95   PORT_START("OPNA_PA2")
90   PORT_START("OPN3_PA2")
9691   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up")
9792   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Down")
9893   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Left")
r19677r19678
10095   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
10196   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
10297   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
98
99//   PORT_START("OPN_DSW")
100//   PORT_CONFNAME( 0x01, 0x01, "PC-9801-118: Port Base" )
101//   PORT_CONFSETTING(    0x00, "0x088" )
102//   PORT_CONFSETTING(    0x01, "0x188" )
103103INPUT_PORTS_END
104104
105105ioport_constructor pc9801_118_device::device_input_ports() const
r19677r19678
107107   return INPUT_PORTS_NAME( pc9801_118 );
108108}
109109
110// RAM
111ROM_START( pc9801_118 )
112   ROM_REGION( 0x100000, "opn3", ROMREGION_ERASE00 )
113ROM_END
114
115const rom_entry *pc9801_118_device::device_rom_region() const
116{
117   return ROM_NAME( pc9801_118 );
118}
119
110120//**************************************************************************
111121//  LIVE DEVICE
112122//**************************************************************************
r19677r19678
160170
161171void pc9801_118_device::device_start()
162172{
163   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) );
173   UINT16 port_base = 0x100;//(ioport("OPN_DSW")->read() & 1) << 8;
174   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) );
164175   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) );
165176}
166177
trunk/src/mess/machine/pc9801_118.h
r19677r19678
3939
4040//   required_device<cpu_device>  m_maincpu;
4141   required_device<ym2608_device>  m_opn3;
42   virtual const rom_entry *device_rom_region() const;
4243protected:
4344   // device-level overrides
4445   virtual void device_validity_check(validity_checker &valid) const;
trunk/src/mess/machine/pc9801_26.c
r19677r19678
2121const device_type PC9801_26 = &device_creator<pc9801_26_device>;
2222
2323
24
2425READ8_MEMBER(pc9801_26_device::opn_porta_r)
2526{
26   if(m_joy_sel == 0x80)
27      return ioport("OPN_PA1")->read();
27   if(m_joy_sel & 0x80)
28      return ioport(m_joy_sel & 0x40 ? "OPN_PA2" : "OPN_PA1")->read();
2829
29   if(m_joy_sel == 0xc0)
30      return ioport("OPN_PA2")->read();
31
32//  0x81?
33//  printf("%02x\n",m_joy_sel);
3430   return 0xff;
3531}
3632
r19677r19678
8783   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_NAME("P1 Joystick Right")
8884   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1")
8985   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2")
90   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
86   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
87   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
9188
9289   PORT_START("OPN_PA2")
9390   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Up")
r19677r19678
9693   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_NAME("P2 Joystick Right")
9794   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
9895   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
99   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
96   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
97   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
98
99//   PORT_START("OPN_DSW")
100//   PORT_CONFNAME( 0x01, 0x01, "PC-9801-26: Port Base" )
101//   PORT_CONFSETTING(    0x00, "0x088" )
102//   PORT_CONFSETTING(    0x01, "0x188" )
100103INPUT_PORTS_END
101104
102105ioport_constructor pc9801_26_device::device_input_ports() const
r19677r19678
157160
158161void pc9801_26_device::device_start()
159162{
160   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) );
163   UINT16 port_base = 0x100;//(ioport("OPN_DSW")->read() & 1) << 8;
164   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) );
161165}
162166
163167
trunk/src/mess/drivers/pc9801.c
r19677r19678
35603560//      pic8259_ir2_w(machine().device("pic8259_master"), 0);
35613561}
35623562
3563#if 0
3564static const ym2608_interface pc98_ym2608_intf =
3565{
3566   {
3567      AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
3568      AY8910_DEFAULT_LOADS,
3569      DEVCB_DRIVER_MEMBER(pc9801_state,opn_porta_r),
3570      DEVCB_NULL,//(pc9801_state,opn_portb_r),
3571      DEVCB_NULL,//(pc9801_state,opn_porta_w),
3572      DEVCB_DRIVER_MEMBER(pc9801_state,opn_portb_w),
3573   },
3574   pc9801_sound_irq
3575};
3576#endif
35773563
35783564FLOPPY_FORMATS_MEMBER( pc9801_state::floppy_formats )
35793565   FLOPPY_PC98FDI_FORMAT
r19677r19678
36043590
36053591static MACHINE_CONFIG_FRAGMENT( pc9801_cbus )
36063592   MCFG_PC9801CBUS_SLOT_ADD("cbus0", pc9801_cbus, "pc9801_26", NULL)
3593//   MCFG_PC9801CBUS_SLOT_ADD("cbus1", pc9801_cbus, NULL, NULL)
36073594//   TODO: six max slots
36083595MACHINE_CONFIG_END
36093596
r19677r19678
38263813   ROM_REGION( 0x100000, "kanji", ROMREGION_ERASEFF ) \
38273814   ROM_REGION( 0x80000, "new_chargen", ROMREGION_ERASEFF ) \
38283815
3829#define OPNA_LOAD \
3830   ROM_REGION( 0x100000, "opna", ROMREGION_ERASE00 ) \
3831
38323816/*
38333817F - 8086 5
38343818*/
r19677r19678
38813865    ROM_LOAD( "font_ux.rom",     0x000000, 0x046800, BAD_DUMP CRC(19a76eeb) SHA1(96a006e8515157a624599c2b53a581ae0dd560fd) )
38823866
38833867   KANJI_ROMS
3884   OPNA_LOAD
38853868ROM_END
38863869
38873870/*
r19677r19678
39003883    ROM_LOAD( "font_rx.rom",     0x000000, 0x046800, CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff) )
39013884
39023885   KANJI_ROMS
3903   OPNA_LOAD
39043886ROM_END
39053887
39063888/*
r19677r19678
39323914   ROM_LOAD( "font_rs.rom", 0x00000, 0x46800, BAD_DUMP CRC(da370e7a) SHA1(584d0c7fde8c7eac1f76dc5e242102261a878c5e) )
39333915
39343916   KANJI_ROMS
3935   OPNA_LOAD
39363917ROM_END
39373918
39383919/*
r19677r19678
39533934    ROM_LOAD( "font_vm.rom",     0x000000, 0x046800, BAD_DUMP CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff) )
39543935
39553936   KANJI_ROMS
3956   OPNA_LOAD
39573937ROM_END
39583938
39593939/*
r19677r19678
39773957   ROM_LOAD( "font.rom", 0x00000, 0x46800, BAD_DUMP CRC(a61c0649) SHA1(554b87377d176830d21bd03964dc71f8e98676b1) )
39783958
39793959   KANJI_ROMS
3980   OPNA_LOAD
39813960ROM_END
39823961
39833962/*
r19677r19678
39993978    ROM_LOAD( "font_as.rom",     0x000000, 0x046800, BAD_DUMP CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff) )
40003979
40013980   KANJI_ROMS
4002   OPNA_LOAD
40033981ROM_END
40043982
40053983
r19677r19678
40224000   ROM_LOAD( "font_ne.rom", 0x00000, 0x46800, BAD_DUMP CRC(fb213757) SHA1(61525826d62fb6e99377b23812faefa291d78c2e) )
40234001
40244002   KANJI_ROMS
4025   OPNA_LOAD
40264003ROM_END
40274004
40284005/*
r19677r19678
40444021   ROM_LOAD( "font_486mu.rom", 0x0000, 0x46800, CRC(456d9fc7) SHA1(78ba9960f135372825ab7244b5e4e73a810002ff))
40454022
40464023   KANJI_ROMS
4047   OPNA_LOAD
40484024ROM_END
40494025
40504026/*
r19677r19678
40664042    ROM_LOAD( "font_ce2.rom",     0x000000, 0x046800, CRC(d1c2702a) SHA1(e7781e9d35b6511d12631641d029ad2ba3f7daef) )
40674043
40684044   KANJI_ROMS
4069   OPNA_LOAD
40704045ROM_END
40714046
40724047/*
r19677r19678
40884063    ROM_LOAD( "font_xs.rom",     0x000000, 0x046800, BAD_DUMP CRC(c9a77d8f) SHA1(deb8563712eb2a634a157289838b95098ba0c7f2) )
40894064
40904065   KANJI_ROMS
4091   OPNA_LOAD
40924066ROM_END
40934067
40944068
r19677r19678
41114085   ROM_LOAD( "font_a.rom", 0x00000, 0x46800, BAD_DUMP CRC(c9a77d8f) SHA1(deb8563712eb2a634a157289838b95098ba0c7f2) )
41124086
41134087   KANJI_ROMS
4114   OPNA_LOAD
41154088ROM_END
41164089
41174090/*
r19677r19678
41334106    ROM_LOAD( "font_v20.rom",     0x000000, 0x046800, BAD_DUMP CRC(6244c4c0) SHA1(9513cac321e89b4edb067b30e9ecb1adae7e7be7) )
41344107
41354108   KANJI_ROMS
4136   OPNA_LOAD
41374109ROM_END
41384110
41394111

Previous 199869 Revisions Next


© 1997-2024 The MAME Team