src/mess/video/fmtowns.c
| r15216 | r15217 | |
| 691 | 691 | UINT16 xstart,xend,ystart,yend; |
| 692 | 692 | int xdir,ydir; |
| 693 | 693 | int width = (state->m_video.towns_crtc_reg[12] - state->m_video.towns_crtc_reg[11]) / (((state->m_video.towns_crtc_reg[27] & 0x0f00) >> 8)+1); |
| 694 | | int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+1); |
| 694 | int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+2); |
| 695 | 695 | |
| 696 | 696 | if(xflip) |
| 697 | 697 | { |
| r15216 | r15217 | |
| 735 | 735 | col = state->m_towns_txtvram[coffset+(pixel*2)] | (state->m_towns_txtvram[coffset+(pixel*2)+1] << 8); |
| 736 | 736 | voffset += (state->m_video.towns_crtc_reg[24] * 4) * (ypos & 0x1ff); // scanline size in bytes * y pos |
| 737 | 737 | voffset += (xpos & 0x1ff) * 2; |
| 738 | | voffset &= 0x3ffff; |
| 739 | | if(xpos < width && ypos < height && pixel != 0) |
| 738 | if((state->m_video.towns_sprite_page != 0 && voffset > 0x1ffff && voffset < 0x40000) |
| 739 | || (state->m_video.towns_sprite_page == 0 && voffset < 0x20000)) |
| 740 | 740 | { |
| 741 | | state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8; |
| 742 | | state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff; |
| 741 | if(xpos < width && ypos < height && pixel != 0) |
| 742 | { |
| 743 | state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8; |
| 744 | state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff; |
| 745 | } |
| 743 | 746 | } |
| 744 | 747 | if(xflip) |
| 745 | 748 | voffset+=2; |
| r15216 | r15217 | |
| 747 | 750 | voffset-=2; |
| 748 | 751 | pixel = state->m_towns_txtvram[poffset] & 0x0f; |
| 749 | 752 | col = state->m_towns_txtvram[coffset+(pixel*2)] | (state->m_towns_txtvram[coffset+(pixel*2)+1] << 8); |
| 750 | | voffset &= 0x3ffff; |
| 751 | | if(xpos < width && ypos < height && pixel != 0) |
| 753 | if((state->m_video.towns_sprite_page != 0 && voffset > 0x1ffff && voffset < 0x40000) |
| 754 | || (state->m_video.towns_sprite_page == 0 && voffset < 0x20000)) |
| 752 | 755 | { |
| 753 | | state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8; |
| 754 | | state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff; |
| 756 | if(xpos < width && ypos < height && pixel != 0) |
| 757 | { |
| 758 | state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8; |
| 759 | state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff; |
| 760 | } |
| 755 | 761 | } |
| 756 | 762 | poffset++; |
| 757 | 763 | poffset &= 0x1ffff; |
| r15216 | r15217 | |
| 768 | 774 | UINT16 xstart,ystart,xend,yend; |
| 769 | 775 | int xdir,ydir; |
| 770 | 776 | int width = (state->m_video.towns_crtc_reg[12] - state->m_video.towns_crtc_reg[11]) / (((state->m_video.towns_crtc_reg[27] & 0x0f00) >> 8)+1); |
| 771 | | int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+1); |
| 777 | int height = (state->m_video.towns_crtc_reg[16] - state->m_video.towns_crtc_reg[15]) / (((state->m_video.towns_crtc_reg[27] & 0xf000) >> 12)+2); |
| 772 | 778 | |
| 773 | 779 | if(xflip) |
| 774 | 780 | { |
| r15216 | r15217 | |
| 811 | 817 | col = state->m_towns_txtvram[poffset] | (state->m_towns_txtvram[poffset+1] << 8); |
| 812 | 818 | voffset += (state->m_video.towns_crtc_reg[24] * 4) * (ypos & 0x1ff); // scanline size in bytes * y pos |
| 813 | 819 | voffset += (xpos & 0x1ff) * 2; |
| 814 | | voffset &= 0x3ffff; |
| 815 | | if(xpos < width && ypos < height && col < 0x8000) |
| 820 | if((state->m_video.towns_sprite_page != 0 && voffset > 0x1ffff && voffset < 0x40000) |
| 821 | || (state->m_video.towns_sprite_page == 0 && voffset < 0x20000)) |
| 816 | 822 | { |
| 817 | | state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8; |
| 818 | | state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff; |
| 823 | if(xpos < width && ypos < height && col < 0x8000) |
| 824 | { |
| 825 | state->m_towns_gfxvram[0x40000+voffset+1] = (col & 0xff00) >> 8; |
| 826 | state->m_towns_gfxvram[0x40000+voffset] = col & 0x00ff; |
| 827 | } |
| 819 | 828 | } |
| 820 | 829 | poffset+=2; |
| 821 | 830 | poffset &= 0x1ffff; |
| r15216 | r15217 | |
| 1843 | 1852 | |
| 1844 | 1853 | #ifdef CRTC_REG_DISP |
| 1845 | 1854 | popmessage("CRTC: %i %i %i %i %i %i %i %i %i\n%i %i %i %i | %i %i %i %i\n%04x %i %i %i | %04x %i %i %i\nZOOM: %04x\nVideo: %02x %02x\nText=%i Spr=%02x\nReg28=%04x", |
| 1846 | | state->m_video.towns_crtc_reg[0],state->m_video.towns_crtc_reg[1],state->m_video.towns_crtc_reg[2],state->m_video.towns_crtc_reg[3], |
| 1847 | | state->m_video.towns_crtc_reg[4],state->m_video.towns_crtc_reg[5],state->m_video.towns_crtc_reg[6],state->m_video.towns_crtc_reg[7], |
| 1848 | | state->m_video.towns_crtc_reg[8], |
| 1849 | | state->m_video.towns_crtc_reg[9],state->m_video.towns_crtc_reg[10],state->m_video.towns_crtc_reg[11],state->m_video.towns_crtc_reg[12], |
| 1850 | | state->m_video.towns_crtc_reg[13],state->m_video.towns_crtc_reg[14],state->m_video.towns_crtc_reg[15],state->m_video.towns_crtc_reg[16], |
| 1851 | | state->m_video.towns_crtc_reg[17],state->m_video.towns_crtc_reg[18],state->m_video.towns_crtc_reg[19],state->m_video.towns_crtc_reg[20], |
| 1852 | | state->m_video.towns_crtc_reg[21],state->m_video.towns_crtc_reg[22],state->m_video.towns_crtc_reg[23],state->m_video.towns_crtc_reg[24], |
| 1853 | | state->m_video.towns_crtc_reg[27],state->m_video.towns_video_reg[0],state->m_video.towns_video_reg[1],state->m_video.towns_tvram_enable,state->m_video.towns_sprite_reg[1] & 0x80, |
| 1854 | | state->m_video.towns_crtc_reg[28]); |
| 1855 | m_video.towns_crtc_reg[0],m_video.towns_crtc_reg[1],m_video.towns_crtc_reg[2],m_video.towns_crtc_reg[3], |
| 1856 | m_video.towns_crtc_reg[4],m_video.towns_crtc_reg[5],m_video.towns_crtc_reg[6],m_video.towns_crtc_reg[7], |
| 1857 | m_video.towns_crtc_reg[8], |
| 1858 | m_video.towns_crtc_reg[9],m_video.towns_crtc_reg[10],m_video.towns_crtc_reg[11],m_video.towns_crtc_reg[12], |
| 1859 | m_video.towns_crtc_reg[13],m_video.towns_crtc_reg[14],m_video.towns_crtc_reg[15],m_video.towns_crtc_reg[16], |
| 1860 | m_video.towns_crtc_reg[17],m_video.towns_crtc_reg[18],m_video.towns_crtc_reg[19],m_video.towns_crtc_reg[20], |
| 1861 | m_video.towns_crtc_reg[21],m_video.towns_crtc_reg[22],m_video.towns_crtc_reg[23],m_video.towns_crtc_reg[24], |
| 1862 | m_video.towns_crtc_reg[27],m_video.towns_video_reg[0],m_video.towns_video_reg[1],m_video.towns_tvram_enable,m_video.towns_sprite_reg[1] & 0x80, |
| 1863 | m_video.towns_crtc_reg[28]); |
| 1855 | 1864 | #endif |
| 1856 | 1865 | |
| 1857 | 1866 | return 0; |