Previous 199869 Revisions Next

r19460 Tuesday 11th December, 2012 at 00:59:38 UTC by Angelo Salese
More fixes
[src/emu/drivers]xtal.h
[src/mess/drivers]pc9801.c

trunk/src/emu/drivers/xtal.h
r19459r19460
4949   XTAL_1MHz         = 1000000,      /* Used to drive OKI M6295 chips */
5050   XTAL_1_75MHz      = 1750000,      /* RCA CDP1861 */
5151   XTAL_1_8432MHz      = 1843200,      /* Bondwell 12/14 */
52   XTAL_1_9968MHz      = 1996800,      /* NEC PC-98xx */
5253   XTAL_2MHz         = 2000000,
5354   XTAL_2_01216MHz      = 2012160,      /* Cidelsa Draco sound board */
54   XTAL_2_4576MHz      = 2457600,      /* Atari ST MFP */
55   XTAL_2_4576MHz      = 2457600,      /* Atari ST MFP, NEC PC-98xx */
5556   XTAL_2_5MHz         = 2500000,      /* Janken Man units */
5657   XTAL_3MHz         = 3000000,      /* Probably only used to drive 68705 or similar MCUs on 80's Taito PCBs */
5758   XTAL_3_12MHz      = 3120000,      /* SP0250 clock on Gottlieb games */
trunk/src/mess/drivers/pc9801.c
r19459r19460
77    TODO:
88    - proper 8251 uart hook-up on keyboard
99    - investigate on POR bit
10   - Check for mouse support
1110   - kanji support;
1211    - Write a PC80S31K device (also used on PC-8801 and PC-88VA, it's the FDC + Z80 sub-system);
1312   - Finish DIP-Switches support
13   - text scrolling
14   - GRCG+
15   - EGC
16   - rewrite using slot devices
17   - some games put "Invalid command byte 05"
1418
1519    TODO (PC-9801RS):
1620    - extra features;
r19459r19460
2226    - "cache error"
2327    - undumped IDE ROM, kludged to work
2428   - slave PIC never enables floppy IRQ (PC=0xffd08)
29   - Compatibility is untested;
2530
2631    TODO: (PC-486MU)
2732    - Tries to read port C of i8255_sys (-> 0x35) at boot without setting up the control
r19459r19460
3237   floppy issues TODO (certain fail)
3338   - Bokosuka Wars
3439   - 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?
3543
3644   List of per-game TODO:
45   - 31 - Iwayuru Hitotsu no Chou Lovely na Bouken Katsugeki: missing text? (it appears if you press a button)
3746   - 4D Boxing: inputs are unresponsive
38   - 4D Driving: accesses some undefined ports (guess that it accesses the low part of them with word opcodes ...)
3947   - Absolutely Mahjong: Kanji data doesn't appear at the Epson logo. Transitions are too fast.
4048   - 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;
4752   - Lovely Horror: Doesn't show kanji, tries to read it thru the 0xa9 port;
48   - Okuman Chouja 2: needs 16 colors support;
4953   - Quarth: should do a split screen effect, it doesn't hence there are broken gfxs
5054   - 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);
5256
5357========================================================================================
5458
r19459r19460
16061610READ8_MEMBER(pc9801_state::pc9801rs_knjram_r)
16071611{
16081612   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)];
16101614
1615   printf("RS knjram %08x\n",offset);
1616
16111617   return machine().rand();
16121618}
16131619
16141620WRITE8_MEMBER(pc9801_state::pc9801rs_knjram_w)
16151621{
16161622   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;
16181624}
16191625
16201626/* FF-based */
r19459r19460
19581964   AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r,        pc9801rs_a0_w,      0xffffffff) //upd7220 bitmap ports / display registers
19591965   AM_RANGE(0x00bc, 0x00bf) AM_READWRITE8(pc9810rs_fdc_ctrl_r,pc9810rs_fdc_ctrl_w,0xffffffff)
19601966   AM_RANGE(0x00c8, 0x00cf) AM_READWRITE8(pc9801rs_2hd_r,     pc9801rs_2hd_w,     0xffffffff)
1967//   AM_RANGE(0x00ec, 0x00ef) PC-9801-86 sound board
19611968   AM_RANGE(0x00f0, 0x00ff) AM_READWRITE8(pc9801rs_f0_r,      pc9801rs_f0_w,      0xffffffff)
19621969   AM_RANGE(0x0188, 0x018b) AM_READWRITE8(pc9801_opn_r,       pc9801_opn_w,       0xffffffff) //ym2203 opn / <undefined>
19631970   AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffffffff)
r19459r19460
27302737   PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y ) PORT_RESET PORT_SENSITIVITY(30) PORT_KEYDELTA(30)
27312738
27322739   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")
27382744
27392745   PORT_START("ROM_LOAD")
27402746   PORT_CONFNAME( 0x01, 0x01, "Load floppy 2hd BIOS" )
r19459r19460
28822888*
28832889****************************************/
28842890
2885static 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
2899static const struct pit8253_config pc9801_pit8253_config =
28862900{
28872901   {
28882902      {
2889         1996800,              /* heartbeat IRQ */
2903         MAIN_CLOCK_X1,              /* heartbeat IRQ */
28902904         DEVCB_NULL,
28912905         DEVCB_DEVICE_LINE("pic8259_master", pic8259_ir0_w)
28922906      }, {
2893         1996800,              /* Memory Refresh */
2907         MAIN_CLOCK_X1,              /* Memory Refresh */
28942908         DEVCB_NULL,
28952909         DEVCB_NULL
28962910      }, {
2897         1996800,              /* RS-232c */
2911         MAIN_CLOCK_X1,              /* RS-232c */
28982912         DEVCB_NULL,
28992913         DEVCB_NULL
29002914      }
29012915   }
29022916};
29032917
2904static const struct pit8253_config pc9801rs_pit8253_config =
2918static const struct pit8253_config pc9821_pit8253_config =
29052919{
29062920   {
29072921      {
2908         16000000/4,            /* heartbeat IRQ */
2922         MAIN_CLOCK_X2,            /* heartbeat IRQ */
29092923         DEVCB_NULL,
29102924         DEVCB_DEVICE_LINE("pic8259_master", pic8259_ir0_w)
29112925      }, {
2912         16000000/4,            /* Memory Refresh */
2926         MAIN_CLOCK_X2,            /* Memory Refresh */
29132927         DEVCB_NULL,
29142928         DEVCB_NULL
29152929      }, {
2916         16000000/4,            /* RS-232c */
2930         MAIN_CLOCK_X2,            /* RS-232c */
29172931         DEVCB_NULL,
29182932         DEVCB_NULL
29192933      }
r19459r19460
31193133
31203134WRITE8_MEMBER(pc9801_state::ppi_mouse_porta_w)
31213135{
3122   printf("A %02x\n",data);
3136//   printf("A %02x\n",data);
31233137}
31243138
31253139WRITE8_MEMBER(pc9801_state::ppi_mouse_portb_w)
31263140{
3127   printf("B %02x\n",data);
3141//   printf("B %02x\n",data);
31283142}
31293143
31303144WRITE8_MEMBER(pc9801_state::ppi_mouse_portc_w)
r19459r19460
34853499   MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801f)
34863500   MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801f)
34873501
3488   MCFG_PIT8253_ADD( "pit8253", pit8253_config )
3502   MCFG_PIT8253_ADD( "pit8253", pc9801_pit8253_config )
34893503   MCFG_I8237_ADD("i8237", 5000000, dmac_intf) // unknown clock
34903504   MCFG_PIC8259_ADD( "pic8259_master", pic8259_master_config )
34913505   MCFG_PIC8259_ADD( "pic8259_slave", pic8259_slave_config )
r19459r19460
35463560#endif
35473561
35483562static 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.
35503564   MCFG_CPU_PROGRAM_MAP(pc9801rs_map)
35513565   MCFG_CPU_IO_MAP(pc9801rs_io)
35523566   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
r19459r19460
35543568   MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801rs)
35553569   MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801rs)
35563570
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
35593573   MCFG_PIC8259_ADD( "pic8259_master", pic8259_master_config )
35603574   MCFG_PIC8259_ADD( "pic8259_slave", pic8259_slave_config )
35613575   MCFG_I8255_ADD( "ppi8255_sys", ppi_system_intf )
r19459r19460
36093623MACHINE_CONFIG_END
36103624
36113625static MACHINE_CONFIG_START( pc9821, pc9801_state )
3612   MCFG_CPU_ADD("maincpu", I486, 16000000)
3626   MCFG_CPU_ADD("maincpu", I486, 16000000) // unknown clock
36133627   MCFG_CPU_PROGRAM_MAP(pc9821_map)
36143628   MCFG_CPU_IO_MAP(pc9821_io)
36153629   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
r19459r19460
36173631   MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9821)
36183632   MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9821)
36193633
3620   MCFG_PIT8253_ADD( "pit8253", pc9801rs_pit8253_config )
3634   MCFG_PIT8253_ADD( "pit8253", pc9821_pit8253_config )
36213635   MCFG_I8237_ADD("i8237", 16000000, pc9801rs_dmac_intf) // unknown clock
36223636   MCFG_PIC8259_ADD( "pic8259_master", pic8259_master_config )
36233637   MCFG_PIC8259_ADD( "pic8259_slave", pic8259_slave_config )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team