trunk/src/mess/drivers/pc9801.c
| r19459 | r19460 | |
| 7 | 7 | TODO: |
| 8 | 8 | - proper 8251 uart hook-up on keyboard |
| 9 | 9 | - investigate on POR bit |
| 10 | | - Check for mouse support |
| 11 | 10 | - kanji support; |
| 12 | 11 | - Write a PC80S31K device (also used on PC-8801 and PC-88VA, it's the FDC + Z80 sub-system); |
| 13 | 12 | - Finish DIP-Switches support |
| 13 | - text scrolling |
| 14 | - GRCG+ |
| 15 | - EGC |
| 16 | - rewrite using slot devices |
| 17 | - some games put "Invalid command byte 05" |
| 14 | 18 | |
| 15 | 19 | TODO (PC-9801RS): |
| 16 | 20 | - extra features; |
| r19459 | r19460 | |
| 22 | 26 | - "cache error" |
| 23 | 27 | - undumped IDE ROM, kludged to work |
| 24 | 28 | - slave PIC never enables floppy IRQ (PC=0xffd08) |
| 29 | - Compatibility is untested; |
| 25 | 30 | |
| 26 | 31 | TODO: (PC-486MU) |
| 27 | 32 | - Tries to read port C of i8255_sys (-> 0x35) at boot without setting up the control |
| r19459 | r19460 | |
| 32 | 37 | floppy issues TODO (certain fail) |
| 33 | 38 | - Bokosuka Wars |
| 34 | 39 | - Dokkin Minako Sensei (2dd image) |
| 40 | - Jangou 2: floppy fails to load after the title screen; |
| 41 | - Okuman Chouja 2: fails loading in PC-9801RS only ("packed file is corrupt"). Maybe a 386 core bug? |
| 42 | - Quarth: fails loading in PC-9801RS only ("packed file is corrupt"). Maybe a 386 core bug? |
| 35 | 43 | |
| 36 | 44 | List of per-game TODO: |
| 45 | - 31 - Iwayuru Hitotsu no Chou Lovely na Bouken Katsugeki: missing text? (it appears if you press a button) |
| 37 | 46 | - 4D Boxing: inputs are unresponsive |
| 38 | | - 4D Driving: accesses some undefined ports (guess that it accesses the low part of them with word opcodes ...) |
| 39 | 47 | - Absolutely Mahjong: Kanji data doesn't appear at the Epson logo. Transitions are too fast. |
| 40 | 48 | - Brandish 2: Intro needs some window masking effects; |
| 41 | | - Dragon Buster: missing bitplanes for the PCG, slight issue with window masking; |
| 42 | | - Far Side Moon: doesn't detect neither mouse nor sound board; |
| 43 | | - First Queen: has broken text display; |
| 44 | | - Flappy Plus: keyboard is unresponsive; |
| 45 | | - Jan Borg Suzume: error text isn't shown; |
| 46 | | - Jangou 2: floppy fails to load after the title screen; |
| 49 | - Dragon Buster: missing bitplanes for the PCG (or not?), slight issue with window masking; |
| 50 | - Far Side Moon: doesn't detect sound board (tied to 0x00ec ports) |
| 51 | - Jan Borg Suzume: gets stuck at a pic8259 read; |
| 47 | 52 | - Lovely Horror: Doesn't show kanji, tries to read it thru the 0xa9 port; |
| 48 | | - Okuman Chouja 2: needs 16 colors support; |
| 49 | 53 | - Quarth: should do a split screen effect, it doesn't hence there are broken gfxs |
| 50 | 54 | - Quarth: uploads a PCG charset |
| 51 | | - Uchiyama Aki no Chou Bangai: half size gfxs, can't start (needs mouse)? |
| 55 | - Uchiyama Aki no Chou Bangai: keyboard irq is fussy (sometimes it doesn't register a key press); |
| 52 | 56 | |
| 53 | 57 | ======================================================================================== |
| 54 | 58 | |
| r19459 | r19460 | |
| 1606 | 1610 | READ8_MEMBER(pc9801_state::pc9801rs_knjram_r) |
| 1607 | 1611 | { |
| 1608 | 1612 | if((m_font_addr & 0xff00) == 0x5600 || (m_font_addr & 0xff00) == 0x5700) |
| 1609 | | return m_pcg_ram[((m_font_addr & 0x7f7f) << 4) | m_font_lr | ((offset >> 1) & 0x0f)]; |
| 1613 | return m_pcg_ram[((m_font_addr & 0x7f7f) << 5) | m_font_lr | ((offset >> 1) & 0x0f)]; |
| 1610 | 1614 | |
| 1615 | printf("RS knjram %08x\n",offset); |
| 1616 | |
| 1611 | 1617 | return machine().rand(); |
| 1612 | 1618 | } |
| 1613 | 1619 | |
| 1614 | 1620 | WRITE8_MEMBER(pc9801_state::pc9801rs_knjram_w) |
| 1615 | 1621 | { |
| 1616 | 1622 | if((m_font_addr & 0xff00) == 0x5600 || (m_font_addr & 0xff00) == 0x5700) |
| 1617 | | m_pcg_ram[((m_font_addr & 0x7f7f) << 4) | m_font_lr | ((offset >> 1) & 0x0f)] = data; |
| 1623 | m_pcg_ram[((m_font_addr & 0x7f7f) << 5) | m_font_lr | ((offset >> 1) & 0x0f)] = data; |
| 1618 | 1624 | } |
| 1619 | 1625 | |
| 1620 | 1626 | /* FF-based */ |
| r19459 | r19460 | |
| 1958 | 1964 | AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r, pc9801rs_a0_w, 0xffffffff) //upd7220 bitmap ports / display registers |
| 1959 | 1965 | AM_RANGE(0x00bc, 0x00bf) AM_READWRITE8(pc9810rs_fdc_ctrl_r,pc9810rs_fdc_ctrl_w,0xffffffff) |
| 1960 | 1966 | AM_RANGE(0x00c8, 0x00cf) AM_READWRITE8(pc9801rs_2hd_r, pc9801rs_2hd_w, 0xffffffff) |
| 1967 | // AM_RANGE(0x00ec, 0x00ef) PC-9801-86 sound board |
| 1961 | 1968 | AM_RANGE(0x00f0, 0x00ff) AM_READWRITE8(pc9801rs_f0_r, pc9801rs_f0_w, 0xffffffff) |
| 1962 | 1969 | AM_RANGE(0x0188, 0x018b) AM_READWRITE8(pc9801_opn_r, pc9801_opn_w, 0xffffffff) //ym2203 opn / <undefined> |
| 1963 | 1970 | AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffffffff) |
| r19459 | r19460 | |
| 2730 | 2737 | PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_RESET PORT_SENSITIVITY(30) PORT_KEYDELTA(30) |
| 2731 | 2738 | |
| 2732 | 2739 | PORT_START("MOUSE_B") |
| 2733 | | PORT_BIT(0x1f, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 2734 | | /* TODO: Brandish 2 apparently needs both bits 7 & 5 to be active, to enter into a main menu sub-item. */ |
| 2735 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED )// PORT_CODE(MOUSECODE_BUTTON3) PORT_NAME("Mouse Middle Button") |
| 2736 | | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("Mouse Right Button") |
| 2737 | | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("Mouse Left Button") |
| 2740 | PORT_BIT(0x1f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 2741 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_CODE(MOUSECODE_BUTTON3) PORT_NAME("Mouse Middle Button") |
| 2742 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("Mouse Right Button") |
| 2743 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("Mouse Left Button") |
| 2738 | 2744 | |
| 2739 | 2745 | PORT_START("ROM_LOAD") |
| 2740 | 2746 | PORT_CONFNAME( 0x01, 0x01, "Load floppy 2hd BIOS" ) |
| r19459 | r19460 | |
| 2882 | 2888 | * |
| 2883 | 2889 | ****************************************/ |
| 2884 | 2890 | |
| 2885 | | static const struct pit8253_config pit8253_config = |
| 2891 | /* basically, PC-98xx series has two xtals. |
| 2892 | My guess is that both are on the PCB, and they clocks the various system components. |
| 2893 | PC-9801RS needs X1 for the pit, otherwise Uchiyama Aki no Chou Bangai has sound pitch bugs |
| 2894 | PC-9821 definitely needs X2, otherwise there's a timer error at POST. Unless it needs a different clock anyway ... |
| 2895 | */ |
| 2896 | #define MAIN_CLOCK_X1 XTAL_1_9968MHz |
| 2897 | #define MAIN_CLOCK_X2 XTAL_2_4576MHz |
| 2898 | |
| 2899 | static const struct pit8253_config pc9801_pit8253_config = |
| 2886 | 2900 | { |
| 2887 | 2901 | { |
| 2888 | 2902 | { |
| 2889 | | 1996800, /* heartbeat IRQ */ |
| 2903 | MAIN_CLOCK_X1, /* heartbeat IRQ */ |
| 2890 | 2904 | DEVCB_NULL, |
| 2891 | 2905 | DEVCB_DEVICE_LINE("pic8259_master", pic8259_ir0_w) |
| 2892 | 2906 | }, { |
| 2893 | | 1996800, /* Memory Refresh */ |
| 2907 | MAIN_CLOCK_X1, /* Memory Refresh */ |
| 2894 | 2908 | DEVCB_NULL, |
| 2895 | 2909 | DEVCB_NULL |
| 2896 | 2910 | }, { |
| 2897 | | 1996800, /* RS-232c */ |
| 2911 | MAIN_CLOCK_X1, /* RS-232c */ |
| 2898 | 2912 | DEVCB_NULL, |
| 2899 | 2913 | DEVCB_NULL |
| 2900 | 2914 | } |
| 2901 | 2915 | } |
| 2902 | 2916 | }; |
| 2903 | 2917 | |
| 2904 | | static const struct pit8253_config pc9801rs_pit8253_config = |
| 2918 | static const struct pit8253_config pc9821_pit8253_config = |
| 2905 | 2919 | { |
| 2906 | 2920 | { |
| 2907 | 2921 | { |
| 2908 | | 16000000/4, /* heartbeat IRQ */ |
| 2922 | MAIN_CLOCK_X2, /* heartbeat IRQ */ |
| 2909 | 2923 | DEVCB_NULL, |
| 2910 | 2924 | DEVCB_DEVICE_LINE("pic8259_master", pic8259_ir0_w) |
| 2911 | 2925 | }, { |
| 2912 | | 16000000/4, /* Memory Refresh */ |
| 2926 | MAIN_CLOCK_X2, /* Memory Refresh */ |
| 2913 | 2927 | DEVCB_NULL, |
| 2914 | 2928 | DEVCB_NULL |
| 2915 | 2929 | }, { |
| 2916 | | 16000000/4, /* RS-232c */ |
| 2930 | MAIN_CLOCK_X2, /* RS-232c */ |
| 2917 | 2931 | DEVCB_NULL, |
| 2918 | 2932 | DEVCB_NULL |
| 2919 | 2933 | } |
| r19459 | r19460 | |
| 3119 | 3133 | |
| 3120 | 3134 | WRITE8_MEMBER(pc9801_state::ppi_mouse_porta_w) |
| 3121 | 3135 | { |
| 3122 | | printf("A %02x\n",data); |
| 3136 | // printf("A %02x\n",data); |
| 3123 | 3137 | } |
| 3124 | 3138 | |
| 3125 | 3139 | WRITE8_MEMBER(pc9801_state::ppi_mouse_portb_w) |
| 3126 | 3140 | { |
| 3127 | | printf("B %02x\n",data); |
| 3141 | // printf("B %02x\n",data); |
| 3128 | 3142 | } |
| 3129 | 3143 | |
| 3130 | 3144 | WRITE8_MEMBER(pc9801_state::ppi_mouse_portc_w) |
| r19459 | r19460 | |
| 3485 | 3499 | MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801f) |
| 3486 | 3500 | MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801f) |
| 3487 | 3501 | |
| 3488 | | MCFG_PIT8253_ADD( "pit8253", pit8253_config ) |
| 3502 | MCFG_PIT8253_ADD( "pit8253", pc9801_pit8253_config ) |
| 3489 | 3503 | MCFG_I8237_ADD("i8237", 5000000, dmac_intf) // unknown clock |
| 3490 | 3504 | MCFG_PIC8259_ADD( "pic8259_master", pic8259_master_config ) |
| 3491 | 3505 | MCFG_PIC8259_ADD( "pic8259_slave", pic8259_slave_config ) |
| r19459 | r19460 | |
| 3546 | 3560 | #endif |
| 3547 | 3561 | |
| 3548 | 3562 | static MACHINE_CONFIG_START( pc9801rs, pc9801_state ) |
| 3549 | | MCFG_CPU_ADD("maincpu", I386, 16000000) |
| 3563 | MCFG_CPU_ADD("maincpu", I386, MAIN_CLOCK_X1*8) // unknown clock. |
| 3550 | 3564 | MCFG_CPU_PROGRAM_MAP(pc9801rs_map) |
| 3551 | 3565 | MCFG_CPU_IO_MAP(pc9801rs_io) |
| 3552 | 3566 | MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq) |
| r19459 | r19460 | |
| 3554 | 3568 | MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801rs) |
| 3555 | 3569 | MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801rs) |
| 3556 | 3570 | |
| 3557 | | MCFG_PIT8253_ADD( "pit8253", pc9801rs_pit8253_config ) |
| 3558 | | MCFG_I8237_ADD("i8237", 16000000, pc9801rs_dmac_intf) // unknown clock |
| 3571 | MCFG_PIT8253_ADD( "pit8253", pc9801_pit8253_config ) |
| 3572 | MCFG_I8237_ADD("i8237", MAIN_CLOCK_X1*8, pc9801rs_dmac_intf) // unknown clock |
| 3559 | 3573 | MCFG_PIC8259_ADD( "pic8259_master", pic8259_master_config ) |
| 3560 | 3574 | MCFG_PIC8259_ADD( "pic8259_slave", pic8259_slave_config ) |
| 3561 | 3575 | MCFG_I8255_ADD( "ppi8255_sys", ppi_system_intf ) |
| r19459 | r19460 | |
| 3609 | 3623 | MACHINE_CONFIG_END |
| 3610 | 3624 | |
| 3611 | 3625 | static MACHINE_CONFIG_START( pc9821, pc9801_state ) |
| 3612 | | MCFG_CPU_ADD("maincpu", I486, 16000000) |
| 3626 | MCFG_CPU_ADD("maincpu", I486, 16000000) // unknown clock |
| 3613 | 3627 | MCFG_CPU_PROGRAM_MAP(pc9821_map) |
| 3614 | 3628 | MCFG_CPU_IO_MAP(pc9821_io) |
| 3615 | 3629 | MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq) |
| r19459 | r19460 | |
| 3617 | 3631 | MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9821) |
| 3618 | 3632 | MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9821) |
| 3619 | 3633 | |
| 3620 | | MCFG_PIT8253_ADD( "pit8253", pc9801rs_pit8253_config ) |
| 3634 | MCFG_PIT8253_ADD( "pit8253", pc9821_pit8253_config ) |
| 3621 | 3635 | MCFG_I8237_ADD("i8237", 16000000, pc9801rs_dmac_intf) // unknown clock |
| 3622 | 3636 | MCFG_PIC8259_ADD( "pic8259_master", pic8259_master_config ) |
| 3623 | 3637 | MCFG_PIC8259_ADD( "pic8259_slave", pic8259_slave_config ) |