Previous 15994 Revisions Next

r10787 Sunday 13th March, 2011 at 17:28:44 UTC by Angelo Salese
[uPD7220]: Guessed an undocumented behaviour, fixes QX-10 layer clearances
[src/mess/video]upd7220.c

src/mess/video/upd7220.c
r10786r10787
451451   int horiz_pix_total = (upd7220->hs + upd7220->hbp + upd7220->aw + upd7220->hfp) * 8;
452452   int vert_pix_total = upd7220->vs + upd7220->vbp + upd7220->al + upd7220->vfp;
453453
454   //printf("%d %d %d %d\n",upd7220->hs,upd7220->hbp,upd7220->aw,upd7220->hfp);
455   //printf("%d %d\n",upd7220->aw * 8,upd7220->pitch * 8);
456
454457   if(horiz_pix_total == 0 || vert_pix_total == 0) //bail out if screen params aren't valid
455458      return;
456459
r10786r10787
812815   }
813816   #endif
814817
815   /* TODO: D has presumably upper bits for ysize */
816   xsize = upd7220->figs.d;
817   ysize = upd7220->figs.dc + 1;
818   xsize = upd7220->figs.d & 0x3ff;
819   /* Guess: D has presumably upper bits for ysize, QX-10 relies on this (TODO: check this on any real HW) */
820   ysize = ((upd7220->figs.d & 0x400) + upd7220->figs.dc) + 1;
818821
819   /* TODO: internal direction, slanted character, zooming, size stuff bigger than 8, rewrite using draw_pixel function */
822   /* TODO: internal direction, zooming, size stuff bigger than 8, rewrite using draw_pixel function */
820823   for(yi=0;yi<ysize;yi++)
821824   {
822825      switch(upd7220->figs.dir & 7)
823826      {
824         case 0: tile_data = BITSWAP8(upd7220->ra[((yi) & 7) | 8],0,1,2,3,4,5,6,7); printf("%d %d %d %d %d\n",upd7220->pitch,x,y,xsize,ysize); break; // TODO
827         case 0: tile_data = BITSWAP8(upd7220->ra[((yi) & 7) | 8],0,1,2,3,4,5,6,7); break; // TODO
825828         case 2:   tile_data = BITSWAP8(upd7220->ra[((yi) & 7) | 8],0,1,2,3,4,5,6,7); break;
826829         case 6:   tile_data = BITSWAP8(upd7220->ra[((ysize-1-yi) & 7) | 8],7,6,5,4,3,2,1,0); break;
827830         default: tile_data = BITSWAP8(upd7220->ra[((yi) & 7) | 8],7,6,5,4,3,2,1,0);
r10786r10787
833836      {
834837         UINT32 addr = ((y+yi) * upd7220->pitch * 2) + ((x+xi) >> 3);
835838
836         upd7220->vram[addr + upd7220->vram_bank] &= ~(1 << (xi & 7));
837         upd7220->vram[addr + upd7220->vram_bank] |= ((tile_data) & (1 << (xi & 7)));
839         upd7220->vram[(addr + upd7220->vram_bank) & 0x3ffff] &= ~(1 << (xi & 7));
840         upd7220->vram[(addr + upd7220->vram_bank) & 0x3ffff] |= ((tile_data) & (1 << (xi & 7)));
838841      }
839842   }
840843

Previous 15994 Revisions Next


© 1998-2018 The MESS Team