Previous 15994 Revisions Next

r10657 Wednesday 2nd March, 2011 at 20:27:03 UTC by Angelo Salese
[uPD7220]: Fixed drawing patterns for lines
[src/mess/video]upd7220.c

src/mess/video/upd7220.c
r10656r10657
653653   }
654654}
655655
656static UINT16 check_pattern(upd7220_t *upd7220, UINT16 pattern)
657{
658   UINT16 res;
659
660   res = 0;
661
662   switch(upd7220->bitmap_mod & 3)
663   {
664      case 0: res = pattern; break; //replace
665      case 1: res = pattern ^ 0xffff; break; //complement
666      case 2: res = 0; break; //reset to zero
667      case 3: res |= 0xffff; break; //set to one
668   }
669
670   return res;
671}
672
656673static void draw_pixel(upd7220_t *upd7220,int x,int y,UINT16 tile_data)
657674{
658675   UINT32 addr = (y * upd7220->pitch + (x >> 4)) & 0x3ffff;
r10656r10657
660677
661678   dad = x & 0xf;
662679
663   if((upd7220->bitmap_mod & 3) == 2) //reset to zero
664      tile_data = 0;
665
666   if((upd7220->bitmap_mod & 2) == 0)
667      printf("Used bitmap modifier %02x\n",upd7220->bitmap_mod);
668
669680   upd7220->vram[addr + upd7220->vram_bank] &= ~(0x8000 >> (15-dad));
670681   upd7220->vram[addr + upd7220->vram_bank] |= ((tile_data) & (0x8000 >> (15-dad)));
671682}
r10656r10657
682693   UINT8 dot;
683694
684695   line_size = upd7220->figs.dc + 1;
685   line_pattern = (upd7220->ra[8]) | (upd7220->ra[9]<<8);
696   line_pattern = check_pattern(upd7220,(upd7220->ra[8]) | (upd7220->ra[9]<<8));
686697
687698   for(i = 0;i<line_size;i++)
688699   {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team