trunk/src/mess/drivers/pc9801.c
| r19293 | r19294 | |
| 334 | 334 | UINT8 *m_ext_gvram; |
| 335 | 335 | UINT8 *m_vram256; |
| 336 | 336 | UINT8 m_pc9821_window_bank; |
| 337 | UINT8 m_joy_sel; |
| 337 | 338 | |
| 338 | 339 | DECLARE_READ8_MEMBER(pc9801_xx_r); |
| 339 | 340 | DECLARE_WRITE8_MEMBER(pc9801_xx_w); |
| r19293 | r19294 | |
| 402 | 403 | DECLARE_WRITE8_MEMBER(pc9821_memory_w); |
| 403 | 404 | DECLARE_READ8_MEMBER(pc9821_vram256_r); |
| 404 | 405 | DECLARE_WRITE8_MEMBER(pc9821_vram256_w); |
| 406 | DECLARE_READ8_MEMBER(opn_porta_r); |
| 407 | DECLARE_WRITE8_MEMBER(opn_portb_w); |
| 405 | 408 | |
| 406 | 409 | DECLARE_READ8_MEMBER(sdip_0_r); |
| 407 | 410 | DECLARE_READ8_MEMBER(sdip_1_r); |
| r19293 | r19294 | |
| 594 | 597 | { |
| 595 | 598 | tile = state->m_video_ram_1[(tile_addr*2) & 0x1fff] & 0x00ff; |
| 596 | 599 | 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 |
| 598 | 601 | { |
| 599 | 602 | tile <<= 8; |
| 600 | 603 | tile |= knj_tile; |
| 601 | 604 | /* annoying kanji bit-swap applied on the address bus ... */ |
| 602 | 605 | 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; |
| 604 | 607 | kanji_on = 2; |
| 605 | 608 | } |
| 606 | 609 | } |
| r19293 | r19294 | |
| 1475 | 1478 | ---- ---x select irq |
| 1476 | 1479 | */ |
| 1477 | 1480 | |
| 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); |
| 1480 | 1483 | |
| 1481 | 1484 | machine().device<upd765a_device>("upd765_2hd")->set_rate(data & 0x02 ? 500000 : 250000); |
| 1482 | 1485 | |
| r19293 | r19294 | |
| 1515 | 1518 | |
| 1516 | 1519 | pc9801_fdc_2hd_update_ready(NULL, 0); |
| 1517 | 1520 | |
| 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); |
| 1520 | 1526 | return; |
| 1521 | 1527 | } |
| 1522 | 1528 | } |
| r19293 | r19294 | |
| 2309 | 2315 | PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:7" ) |
| 2310 | 2316 | PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" ) |
| 2311 | 2317 | |
| 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 | |
| 2312 | 2336 | PORT_START("ROM_LOAD") |
| 2313 | 2337 | PORT_CONFNAME( 0x01, 0x01, "Load floppy 2hd BIOS" ) |
| 2314 | 2338 | PORT_CONFSETTING( 0x00, DEF_STR( Yes ) ) |
| r19293 | r19294 | |
| 2702 | 2726 | printf("DRQ %d\n",state); |
| 2703 | 2727 | |
| 2704 | 2728 | if(m_fdc_ctrl & 1) |
| 2705 | | m_dmac->dreq2_w(state); |
| 2729 | m_dmac->dreq2_w(state ^ 1); |
| 2706 | 2730 | else |
| 2707 | 2731 | printf("DRQ %02x %d\n",m_fdc_ctrl,state); |
| 2708 | 2732 | } |
| r19293 | r19294 | |
| 2917 | 2941 | pic8259_ir4_w(device->machine().device("pic8259_slave"), irq); |
| 2918 | 2942 | } |
| 2919 | 2943 | |
| 2944 | READ8_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 | |
| 2957 | WRITE8_MEMBER(pc9801_state::opn_portb_w){ m_joy_sel = data; } |
| 2958 | |
| 2959 | |
| 2920 | 2960 | static const ym2203_interface pc98_ym2203_intf = |
| 2921 | 2961 | { |
| 2922 | 2962 | { |
| 2923 | 2963 | AY8910_LEGACY_OUTPUT, |
| 2924 | 2964 | AY8910_DEFAULT_LOADS, |
| 2925 | | DEVCB_NULL,//(pc8801_state,opn_porta_r), |
| 2965 | DEVCB_DRIVER_MEMBER(pc9801_state,opn_porta_r), |
| 2926 | 2966 | 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), |
| 2929 | 2969 | }, |
| 2930 | 2970 | DEVCB_LINE(pc9801_sound_irq) |
| 2931 | 2971 | }; |