Previous 15994 Revisions Next

r2071 Sunday 23rd March, 2008 at 06:54:43 UTC by Robbbert
[PC8801] Fixed palette.
[src/mess/drivers]pc8801.c
[src/mess/video]pc8801.c

src/mess/video/pc8801.c
r2070r2071
44
55***************************************************************************/
66
7/* NOTE: The palette and colortable have been fixed after the changes in the 0.123-0.124 cycle,
8   but the pen colours may be wrong. This needs to be tested. */
9
710#include "driver.h"
811#include "includes/pc8801.h"
912
r2070r2071
465468    GRP_DIRTY(x,y) ||
466469    full_refresh) {
467470   plot_box(wbm2,x*8,y*BLOCK_YSIZE,8,BLOCK_YSIZE,palette_transparent_pen);
468   ct=screen->machine->pens[((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8];
471   ct=((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8;
469472   TEXT_OLD(x,y)=text_new;
470473   ATTR_OLD(x,y)=attr_new;
471474   if(attr_new&TX_GL) {
r2070r2071
518521        (((gVRAM[0x0000+x+y*2*80+gy*80] << gx) & 0x80) >> 7) |
519522        (((gVRAM[0x4000+x+y*2*80+gy*80] << gx) & 0x80) >> 6) |
520523        (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) >> 5);
521      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,screen->machine->pens[cg]);
522      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,screen->machine->pens[17]);
524      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,cg);
525      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,17);
523526         }
524527       }
525528       break;
r2070r2071
534537        (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) &&
535538         disp_plane[2]) ?
536539        ((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8 : 16;
537      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,screen->machine->pens[cg]);
538      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,screen->machine->pens[17]);
540      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2,cg);
541      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy*2+1,17);
539542         }
540543       }
541544       break;
r2070r2071
547550         & 0x80) &&
548551        disp_plane[y<200 ? 0 : 1] ?
549552        ((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8 : 16;
550      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy,screen->machine->pens[cg]);
553      pc8801_plot_pixel(wbm1,x*8+gx,y*4+gy,cg);
551554         }
552555       }
553556       break;
554557     case GRAPH_NO:
555558     default:
556       plot_box(wbm1,x*8,y*4,8,4,screen->machine->pens[16]);
559       plot_box(wbm1,x*8,y*4,8,4,16);
557560       break;
558561     }
559562   } else {
r2070r2071
565568        (((gVRAM[0x0000+x+y*2*80+gy*80] << gx) & 0x80) >> 7) |
566569        (((gVRAM[0x4000+x+y*2*80+gy*80] << gx) & 0x80) >> 6) |
567570        (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) >> 5);
568      pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,screen->machine->pens[cg]);
571      pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,cg);
569572         }
570573       }
571574       break;
r2070r2071
580583        (((gVRAM[0x8000+x+y*2*80+gy*80] << gx) & 0x80) &&
581584         disp_plane[2]) ?
582585        ((attr_new&TX_COL_MASK)>>TX_COL_SHIFT)+8 : 16;
583      pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,screen->machine->pens[cg]);
586      pc8801_plot_pixel(wbm1,x*8+gx,y*2+gy,cg);
584587         }
585588       }
586589       break;
587590     case GRAPH_NO:
588591     default:
589       plot_box(wbm1,x*8,y*2,8,2,screen->machine->pens[16]);
592       plot_box(wbm1,x*8,y*2,8,2,16);
590593       break;
591594     }
592595   }
r2070r2071
603606
604607PALETTE_INIT( pc8801 )
605608{
606   int i;
609   UINT8 i;
607610
608   for (i = 0; i < 8; i++)
609      palette_set_color_rgb(machine, i, 0, 0, 0);   /* for graphics */
611   machine->colortable = colortable_alloc(machine, 18);
610612
611   /* for text */
612   for (i = 0; i < 8; i++)
613   for ( i = 0; i < 8; i++ )   /* for graphics */
614      colortable_palette_set_color(machine->colortable, i, RGB_BLACK);
615
616
617   for (i = 0; i < 8; i++)      /* standard colours */
618      colortable_palette_set_color(machine->colortable, i+8,
619         MAKE_RGB((i & 2) ? 0xff : 0, (i & 4) ? 0xff : 0, (i & 1) ? 0xff : 0));
620
621   /* for background and scanline */
622   colortable_palette_set_color(machine->colortable, 16, RGB_BLACK);
623   colortable_palette_set_color(machine->colortable, 17, RGB_BLACK);
624
625
626   for ( i = 0; i < 8; i++ )
613627   {
614      palette_set_color_rgb(machine, i+8,
615         (i & 2) ? 0xff : 0x00,
616         (i & 4) ? 0xff : 0x00,
617         (i & 1) ? 0xff : 0x00);
628      colortable_entry_set_value(machine->colortable, i*2, 0);
629      colortable_entry_set_value(machine->colortable, i*2+1, i+8);
630      colortable_entry_set_value(machine->colortable, i*2+16, i+8);
631      colortable_entry_set_value(machine->colortable, i*2+17, 0);
618632   }
619
620   /* for background and scanline */
621   palette_set_color_rgb(machine, 16, 0, 0, 0);
622   palette_set_color_rgb(machine, 17, 0, 0, 0);
623633}
624634
625635WRITE8_HANDLER(pc8801_crtc_write)
r2070r2071
644654    case 0x60:
645655      /* get light pen point */
646656      crtc_state=lpenx;
647      return;
648    case 0x80:
657      return;    case 0x80:
649658      /* set cursor */
650659      crtc_state=cursorx;
651660      text_cursor=((data&1)!=0x00);
r2070r2071
914923   r[offset] = (data & 2) ? 0xff : 0x00;
915924   g[offset] = (data & 4) ? 0xff : 0x00;
916925  }
917  palette_set_color_rgb(machine, palno,r[offset],g[offset],b[offset]);
926  colortable_palette_set_color(machine->colortable, palno, MAKE_RGB(r[offset],g[offset],b[offset]));
918927}
src/mess/drivers/pc8801.c
r2070r2071
528528   MDRV_SCREEN_SIZE(640, 220)
529529   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 200-1)
530530   MDRV_GFXDECODE( pc8801 )
531   MDRV_PALETTE_LENGTH(18)
531   MDRV_PALETTE_LENGTH(32)
532532   MDRV_PALETTE_INIT( pc8801 )
533533
534534   MDRV_VIDEO_START(pc8801)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team