Previous 199869 Revisions Next

r19294 Monday 3rd December, 2012 at 22:51:35 UTC by Angelo Salese
Added Joystick ports, used by Quarth
[src/mess/drivers]pc9801.c

trunk/src/mess/drivers/pc9801.c
r19293r19294
334334   UINT8 *m_ext_gvram;
335335   UINT8 *m_vram256;
336336   UINT8 m_pc9821_window_bank;
337   UINT8 m_joy_sel;
337338
338339   DECLARE_READ8_MEMBER(pc9801_xx_r);
339340   DECLARE_WRITE8_MEMBER(pc9801_xx_w);
r19293r19294
402403   DECLARE_WRITE8_MEMBER(pc9821_memory_w);
403404   DECLARE_READ8_MEMBER(pc9821_vram256_r);
404405   DECLARE_WRITE8_MEMBER(pc9821_vram256_w);
406   DECLARE_READ8_MEMBER(opn_porta_r);
407   DECLARE_WRITE8_MEMBER(opn_portb_w);
405408
406409   DECLARE_READ8_MEMBER(sdip_0_r);
407410   DECLARE_READ8_MEMBER(sdip_1_r);
r19293r19294
594597      {
595598         tile = state->m_video_ram_1[(tile_addr*2) & 0x1fff] & 0x00ff;
596599         knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0x7f;
597         if((tile & 0xf0) == 0 && knj_tile) // kanji select
600         if((tile & 0xe0) == 0 && knj_tile) // kanji select
598601         {
599602            tile <<= 8;
600603            tile |= knj_tile;
601604            /* annoying kanji bit-swap applied on the address bus ... */
602605            tile = BITSWAP16(tile,7,15,14,13,12,11,6,5,10,9,8,4,3,2,1,0);
603            tile &= 0xfff;
606            tile &= 0x1fff;
604607            kanji_on = 2;
605608         }
606609      }
r19293r19294
14751478    ---- ---x select irq
14761479    */
14771480
1478   machine().device<floppy_connector>("upd765_2hd:0")->get_device()->set_rpm(data & 0x02 ? 360 : 300);
1479   machine().device<floppy_connector>("upd765_2hd:1")->get_device()->set_rpm(data & 0x02 ? 360 : 300);
1481//   machine().device<floppy_connector>("upd765_2hd:0")->get_device()->set_rpm(data & 0x02 ? 360 : 300);
1482//   machine().device<floppy_connector>("upd765_2hd:1")->get_device()->set_rpm(data & 0x02 ? 360 : 300);
14801483
14811484   machine().device<upd765a_device>("upd765_2hd")->set_rate(data & 0x02 ? 500000 : 250000);
14821485
r19293r19294
15151518
15161519            pc9801_fdc_2hd_update_ready(NULL, 0);
15171520
1518            machine().device<floppy_connector>("upd765_2hd:0")->get_device()->mon_w(data & 0x08 ? ASSERT_LINE : CLEAR_LINE);
1519            machine().device<floppy_connector>("upd765_2hd:1")->get_device()->mon_w(data & 0x08 ? ASSERT_LINE : CLEAR_LINE);
1521            machine().device<floppy_connector>("upd765_2hd:0")->get_device()->mon_w(data & 0x40 ? ASSERT_LINE : CLEAR_LINE);
1522            machine().device<floppy_connector>("upd765_2hd:1")->get_device()->mon_w(data & 0x40 ? ASSERT_LINE : CLEAR_LINE);
1523
1524//            machine().device<floppy_connector>("upd765_2hd:0")->get_device()->mon_w(data & 0x08 ? ASSERT_LINE : CLEAR_LINE);
1525//            machine().device<floppy_connector>("upd765_2hd:1")->get_device()->mon_w(data & 0x08 ? ASSERT_LINE : CLEAR_LINE);
15201526            return;
15211527      }
15221528   }
r19293r19294
23092315   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:7" )
23102316   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" )
23112317
2318   PORT_START("OPN_PA1")
2319   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
2320   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
2321   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
2322   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
2323   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 1")
2324   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joystick Button 2")
2325   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
2326
2327   PORT_START("OPN_PA2")
2328   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
2329   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
2330   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
2331   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
2332   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 1")
2333   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joystick Button 2")
2334   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
2335
23122336   PORT_START("ROM_LOAD")
23132337   PORT_CONFNAME( 0x01, 0x01, "Load floppy 2hd BIOS" )
23142338   PORT_CONFSETTING(    0x00, DEF_STR( Yes ) )
r19293r19294
27022726   printf("DRQ %d\n",state);
27032727
27042728   if(m_fdc_ctrl & 1)
2705      m_dmac->dreq2_w(state);
2729      m_dmac->dreq2_w(state ^ 1);
27062730   else
27072731      printf("DRQ %02x %d\n",m_fdc_ctrl,state);
27082732}
r19293r19294
29172941   pic8259_ir4_w(device->machine().device("pic8259_slave"), irq);
29182942}
29192943
2944READ8_MEMBER(pc9801_state::opn_porta_r)
2945{
2946   if(m_joy_sel == 0x80)
2947      return machine().root_device().ioport("OPN_PA1")->read();
2948
2949   if(m_joy_sel == 0xc0)
2950      return machine().root_device().ioport("OPN_PA2")->read();
2951
2952//   0x81?
2953//   printf("%02x\n",m_joy_sel);
2954   return 0xff;
2955}
2956
2957WRITE8_MEMBER(pc9801_state::opn_portb_w){ m_joy_sel = data; }
2958
2959
29202960static const ym2203_interface pc98_ym2203_intf =
29212961{
29222962   {
29232963      AY8910_LEGACY_OUTPUT,
29242964      AY8910_DEFAULT_LOADS,
2925      DEVCB_NULL,//(pc8801_state,opn_porta_r),
2965      DEVCB_DRIVER_MEMBER(pc9801_state,opn_porta_r),
29262966      DEVCB_NULL,//(pc8801_state,opn_portb_r),
2927      DEVCB_NULL,
2928      DEVCB_NULL
2967      DEVCB_NULL,//(pc9801_state,opn_porta_w),
2968      DEVCB_DRIVER_MEMBER(pc9801_state,opn_portb_w),
29292969   },
29302970   DEVCB_LINE(pc9801_sound_irq)
29312971};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team