Previous 15994 Revisions Next

r10109 Wednesday 19th January, 2011 at 22:18:00 UTC by Angelo Salese
[PC-8801]: Fixed a silly bug with crtc active flag, fixes text garbage in various games
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r10108r10109
22
33    PC-8801 (c) 1981 NEC
44
5    preliminary driver by Angelo Salese, original MESS PC-88SR by ???
5    preliminary driver by Angelo Salese, original MESS PC-88SR driver by ???
66
77    TODO:
8   - used to do more, currently under rewriting stage. We are currently using plain PC-8801 as the base, will add differences for the
9     later models at some point.
10   - macros for the various rom / ram areas, it might require various attempts in order to finally get a reasonable arrangement ...
11   - dipswitches are WRONG
8   - add differences between various models;
129   - implement proper i8214 routing, also add irq latch mechanism;
1310   - implement proper upd3301 / i8257 support;
1411   - below notes states that plain PC-8801 doesn't have a disk CPU, but the BIOS clearly checks the floppy ports. Wrong info?
15   - joystick / mouse support;
12   - mouse support;
1613   - cursor is 8 x 10, not 8 x 8 as current implementation.
17   - text DMAC stuff isn't well documented;
18   - CRTC really looks like to be a MCU;
1914   - needs to support V1 / V2 properly;
2015   - Add limits for extend work RAM;
16   - Later models have palette bugs with some games (Alphos, Tokyo Nampa Street), check out why;
2117   - What happens to the palette contents when the analog/digital palette mode changes?
18   - dipswitches needs to be controlled;
2219
23   list of games that crashes due of floppy issues:
24   - Bokosuka Wars
25   - Bouken Roman
26   - Bruce Lee
27   - Castle Excellent
28   - Tobira wo Akete (in parent pc8801 only)
29
3020   per-game specific TODO:
3121   - 100 Yen disk(s): reads kanji ports;
32   - 177: gameplay is too fast;
22   - 177: gameplay is too fast (parent pc8801 only);
3323   - Acro Jet: hangs waiting for an irq;
3424   - American Success: reads the light pen?
3525   - Alpha (demo): crashes with "illegal function" msg;
36   - Alphos: text VRAM garbage during gameplay;
3726   - Balance of Power: attempt to use the SIO port for mouse polling, worked around for now;
38   - Battle Entry: moans with a kanji msg then dies if you try to press either numpad 1 or 2 (what it basically asks by looking at the DASM)
39   - Bersekers Front Gaiden 3: checks CPU speed port and polls the PCG stuff too;
27   - Balance of Power: moans with a JP msg;
28   - Battle Entry: moans with a JP msg then dies if you try to press either numpad 1 or 2 (asks if the user wants to use the sound board (yes 1 / no 2)
4029   - Bishoujo Baseball Gakuen: checks ym2608 after intro screen;
4130   - Blue Moon Story: moans with a kanji msg;.
4231   - Bu U Ma: sets gfx compatibility mode on title screen (attr bit 4,N-BASIC), dunno how to draw with it ...;
43   - Grobda: palette is ugly;
44   - Wanderers from Ys: user data looks screwed? It loads with everything as maximum as per now ...
45   - Xevious: game is too fast
32   - Grobda: palette is ugly (parent pc8801 only);
33   - Wanderers from Ys: user data disk looks screwed? It loads with everything as maximum as per now ...
34   - Wanderers from Ys: sound crashes at some point, presumably irq issue;
35   - Xevious: game is too fast (parent pc8801 only)
4636
37   list of games that crashes due of floppy issues:
38   - Bersekers Front Gaiden 3
39   - Bokosuka Wars
40   - Bouken Roman
41   - Bruce Lee
42   - Castle Excellent
43   - Tobira wo Akete (random crashes in parent pc8801 only)
44
45   games that needs to NOT have write-protect floppies (BTANBs):
46   - Tobira wo Akete (hangs at title screen)
47
48
4749   Notes:
4850   - BIOS disk ROM defines what kind of floppies you could load:
4951     * with 0x0800 ROM size you can load 2d floppies only;
r10108r10109
352354   UINT8 y_height;
353355   UINT8 attr;
354356   UINT8 reverse;
355   UINT8 pal;
356   UINT8 gfx_mode;
357   int pal;
358   //UINT8 gfx_mode;
357359
358360   y_height = y_size == 20 ? 10 : 8;
359361
r10108r10109
366368         if(text_color_flag)
367369         {
368370            pal = (attr & 0xe0) >> 5;
369            gfx_mode = (attr & 0x10) >> 4;
371            //gfx_mode = (attr & 0x10) >> 4;
370372            reverse = 0;
373            pal|=8; //text pal bank
371374         }
372375         else
373376         {
374            pal = 7;
377            pal = (txt_color) ? 7 : 0;
375378            reverse = attr & 4;
379            pal|=8; //text pal bank
376380         }
377381
378         pal|=8; //text pal bank
379
380382         for(yi=0;yi<8;yi++)
381383         {
382384            is_cursor = calc_cursor_pos(machine,x,y,yi);
r10108r10109
419421   UINT8 y_height;
420422   UINT8 attr;
421423   UINT8 reverse;
422   UINT8 pal;
424   int pal;
423425
424426   y_height = y_size == 20 ? 10 : 8;
425427
r10108r10109
435437         if(text_color_flag)
436438         {
437439            pal = (attr & 0xe0) >> 5;
440            //gfx_mode = (attr & 0x10) >> 4;
438441            reverse = 0;
442            pal|=8; //text pal bank
439443         }
440444         else
441445         {
442            pal = 7;
446            pal = (txt_color) ? 7 : 0;
443447            reverse = attr & 4;
448            pal|=8; //text pal bank
444449         }
445450
446         pal|=8; //text pal bank
447
448
449451         for(yi=0;yi<8;yi++)
450452         {
451453            is_cursor = calc_cursor_pos(machine,x,y,yi);
r10108r10109
491493         draw_bitmap_1bpp(screen->machine,bitmap);
492494   }
493495
496   //popmessage("%02x %02x %02x %02x",layer_mask,dmac_mode,crtc.status,crtc.irq_mask);
497
494498   if(!(layer_mask & 1) && dmac_mode & 4 && crtc.status & 0x10 && crtc.irq_mask == 3)
495499   {
496500      static int y_size;
r10108r10109
802806static WRITE8_HANDLER( pc8801_ctrl_w )
803807{
804808   /*
805   x--- ---- beeper (mirror?)
809   x--- ---- SING (buzzer mirror?)
806810   -x-- ---- mouse latch (JOP1, routes on OPN sound port A)
807811   --x- ---- beeper
808812   ---
r10108r10109
10121016   switch(crtc.cmd)
10131017   {
10141018      case 0:  // reset CRTC
1015         crtc.status &= (~0x10 | ~0x04 | ~0x02);
1019         crtc.status &= (~0x16);
10161020         break;
10171021      case 1:  // start display
10181022         crtc.status |= 0x10;
10191023         crtc.status &= (~0x08);
10201024         if(data & 1)
10211025            printf("CRTC reverse display ON\n");
1022
10231026         break;
10241027      case 2:  // set irq mask
10251028         crtc.irq_mask = data & 3;
r10108r10109
10321035         break;
10331036      case 5:  // reset IRQ
10341037      case 6:  // reset counters
1035         crtc.status &= (~0x04 | ~0x02);
1038         crtc.status &= (~0x06);
10361039         break;
10371040   }
10381041
r10108r10109
11101113
11111114   txt_width = data & 1;
11121115   txt_color = data & 2;
1116   if((data & 2) == 0)
1117   printf("TEXT COLOR is black\n");
11131118}
11141119
11151120static UINT32 knj_addr[2];
r10108r10109
11721177   AM_RANGE(0x34, 0x34) AM_WRITE(pc8801_alu_ctrl1_w)
11731178   AM_RANGE(0x35, 0x35) AM_WRITE(pc8801_alu_ctrl2_w)
11741179   AM_RANGE(0x40, 0x40) AM_READWRITE(pc8801_ctrl_r, pc8801_ctrl_w)
1175   AM_RANGE(0x44, 0x45) AM_DEVREADWRITE("ym2203", ym2203_r,ym2203_w)
1180   AM_RANGE(0x44, 0x45) AM_DEVREADWRITE("opn", ym2203_r,ym2203_w)
11761181//  AM_RANGE(0x46, 0x47) AM_NOP                                     /* OPNA extra port */
11771182   AM_RANGE(0x50, 0x50) AM_READWRITE(pc8801_crtc_param_r, pc88_crtc_param_w)
11781183   AM_RANGE(0x51, 0x51) AM_READWRITE(pc8801_crtc_status_r, pc88_crtc_cmd_w)
r10108r10109
15291534   PORT_DIPSETTING(    0x80, "9600bps" )
15301535   PORT_DIPSETTING(    0x90, "19200bps" )
15311536
1532   PORT_START("OPNA")
1537   PORT_START("OPN_PA")
15331538   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
15341539   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
15351540   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
15361541   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
15371542   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
15381543
1539   PORT_START("OPNB")
1544   PORT_START("OPN_PB")
15401545   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
15411546   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
15421547   PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
r10108r10109
16141619}
16151620
16161621/* TODO: mouse routing (that's why I don't use DEVCB_INPUT_PORT here) */
1617static READ8_DEVICE_HANDLER( opn_porta_r ) { return input_port_read(device->machine, "OPNA"); }
1618static READ8_DEVICE_HANDLER( opn_portb_r ) { return input_port_read(device->machine, "OPNB"); }
1622static READ8_DEVICE_HANDLER( opn_porta_r ) { return input_port_read(device->machine, "OPN_PA"); }
1623static READ8_DEVICE_HANDLER( opn_portb_r ) { return input_port_read(device->machine, "OPN_PB"); }
16191624
16201625static const ym2203_interface pc88_ym2203_intf =
16211626{
r10108r10109
16981703   cpu_set_input_line_vector(machine->device("fdccpu"), 0, 0);
16991704
17001705   {
1706      txt_color = 2;
1707   }
1708
1709   {
17011710      int i;
17021711
17031712      for(i=0;i<3;i++)
r10108r10109
18051814
18061815   /* sound hardware */
18071816   MCFG_SPEAKER_STANDARD_MONO("mono")
1808   MCFG_SOUND_ADD("ym2203", YM2203, 4000000) //unknown clock
1817   MCFG_SOUND_ADD("opn", YM2203, 4000000) //unknown clock
18091818   MCFG_SOUND_CONFIG(pc88_ym2203_intf)
18101819   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
18111820

Previous 15994 Revisions Next


© 1998-2018 The MESS Team