src/mess/video/upd7220.c
| r10786 | r10787 | |
| 451 | 451 | int horiz_pix_total = (upd7220->hs + upd7220->hbp + upd7220->aw + upd7220->hfp) * 8; |
| 452 | 452 | int vert_pix_total = upd7220->vs + upd7220->vbp + upd7220->al + upd7220->vfp; |
| 453 | 453 | |
| 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 | |
| 454 | 457 | if(horiz_pix_total == 0 || vert_pix_total == 0) //bail out if screen params aren't valid |
| 455 | 458 | return; |
| 456 | 459 | |
| r10786 | r10787 | |
| 812 | 815 | } |
| 813 | 816 | #endif |
| 814 | 817 | |
| 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; |
| 818 | 821 | |
| 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 */ |
| 820 | 823 | for(yi=0;yi<ysize;yi++) |
| 821 | 824 | { |
| 822 | 825 | switch(upd7220->figs.dir & 7) |
| 823 | 826 | { |
| 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 |
| 825 | 828 | case 2: tile_data = BITSWAP8(upd7220->ra[((yi) & 7) | 8],0,1,2,3,4,5,6,7); break; |
| 826 | 829 | case 6: tile_data = BITSWAP8(upd7220->ra[((ysize-1-yi) & 7) | 8],7,6,5,4,3,2,1,0); break; |
| 827 | 830 | default: tile_data = BITSWAP8(upd7220->ra[((yi) & 7) | 8],7,6,5,4,3,2,1,0); |
| r10786 | r10787 | |
| 833 | 836 | { |
| 834 | 837 | UINT32 addr = ((y+yi) * upd7220->pitch * 2) + ((x+xi) >> 3); |
| 835 | 838 | |
| 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))); |
| 838 | 841 | } |
| 839 | 842 | } |
| 840 | 843 | |