src/mess/video/fmtowns.c
| r7742 | r7743 | |
| 689 | 689 | int xdir,ydir; |
| 690 | 690 | int width = (towns_crtc_reg[12] - towns_crtc_reg[11]) / (((towns_crtc_reg[27] & 0x0f00) >> 8)+1); |
| 691 | 691 | int height = (towns_crtc_reg[16] - towns_crtc_reg[15]) / (((towns_crtc_reg[27] & 0xf000) >> 12)+1); |
| 692 | UINT32 vram_start = (towns_sprite_reg[6] & 0x10) ? 0x60000 : 0x40000; |
| 692 | 693 | |
| 693 | 694 | if(xflip) |
| 694 | 695 | { |
| r7742 | r7743 | |
| 730 | 731 | voffset += (towns_crtc_reg[24] * 4) * ypos; // scanline size in bytes * y pos |
| 731 | 732 | voffset += (xpos & 0x1ff) * 2; |
| 732 | 733 | voffset &= 0x3ffff; |
| 733 | | voffset += (towns_sprite_reg[6] & 0x10) ? 0x60000 : 0x40000; |
| 734 | //voffset += (towns_sprite_reg[6] & 0x10) ? 0x60000 : 0x40000; |
| 734 | 735 | if(xpos < width && ypos < height && pixel != 0) |
| 735 | 736 | { |
| 736 | | towns_gfxvram[voffset+1] = (col & 0xff00) >> 8; |
| 737 | | towns_gfxvram[voffset] = col & 0x00ff; |
| 737 | towns_gfxvram[voffset+vram_start+1] = (col & 0xff00) >> 8; |
| 738 | towns_gfxvram[voffset+vram_start] = col & 0x00ff; |
| 738 | 739 | } |
| 739 | 740 | if(xflip) |
| 740 | 741 | voffset+=2; |
| r7742 | r7743 | |
| 743 | 744 | pixel = towns_txtvram[poffset] & 0x0f; |
| 744 | 745 | col = towns_txtvram[coffset+(pixel*2)] | (towns_txtvram[coffset+(pixel*2)+1] << 8); |
| 745 | 746 | voffset &= 0x3ffff; |
| 746 | | voffset += (towns_sprite_reg[6] & 0x10) ? 0x60000 : 0x40000; |
| 747 | 747 | if(xpos < width && ypos < height && pixel != 0) |
| 748 | 748 | { |
| 749 | | towns_gfxvram[voffset+1] = (col & 0xff00) >> 8; |
| 750 | | towns_gfxvram[voffset] = col & 0x00ff; |
| 749 | towns_gfxvram[voffset+vram_start+1] = (col & 0xff00) >> 8; |
| 750 | towns_gfxvram[voffset+vram_start] = col & 0x00ff; |
| 751 | 751 | } |
| 752 | 752 | poffset++; |
| 753 | 753 | poffset &= 0x1ffff; |
| r7742 | r7743 | |
| 828 | 828 | return; |
| 829 | 829 | |
| 830 | 830 | // clears VRAM for each frame? |
| 831 | | memset(towns_gfxvram+0x40000,0x80,0x40000); |
| 831 | if(towns_sprite_reg[6] & 0x10) |
| 832 | memset(towns_gfxvram+0x60000,0x80,0x20000); |
| 833 | else |
| 834 | memset(towns_gfxvram+0x40000,0x80,0x20000); |
| 832 | 835 | |
| 833 | 836 | for(n=sprite_limit;n<1024;n++) |
| 834 | 837 | { |
src/mess/drivers/fmtowns.c
| r7742 | r7743 | |
| 1723 | 1723 | running_device* pic = devtag_get_device(device->machine,"pic8259_slave"); |
| 1724 | 1724 | |
| 1725 | 1725 | towns_pcm_irq_flag = 1; |
| 1726 | | towns_pcm_channel_flag |= (1 << channel); |
| 1727 | 1726 | if(towns_pcm_channel_mask & (1 << channel)) |
| 1727 | { |
| 1728 | towns_pcm_channel_flag |= (1 << channel); |
| 1728 | 1729 | pic8259_ir5_w(pic, 1); |
| 1730 | } |
| 1729 | 1731 | } |
| 1730 | 1732 | |
| 1731 | 1733 | static WRITE_LINE_DEVICE_HANDLER( towns_pic_irq ) |
| r7742 | r7743 | |
| 1848 | 1850 | AM_RANGE(0x0c30,0x0c33) AM_READ8(towns_unknown_r,0x00ff0000) |
| 1849 | 1851 | // CMOS |
| 1850 | 1852 | AM_RANGE(0x3000,0x3fff) AM_READWRITE8(towns_cmos8_r, towns_cmos8_w,0x00ff00ff) |
| 1851 | | // Something (MS-DOS wants this 0x41ff be 1 |
| 1853 | // Something (MS-DOS wants this 0x41ff to be 1) |
| 1852 | 1854 | AM_RANGE(0x41fc,0x41ff) AM_READ8(towns_41ff_r,0xff000000) |
| 1853 | 1855 | // CRTC / Video (again) |
| 1854 | 1856 | AM_RANGE(0xfd90,0xfda3) AM_READWRITE8(towns_video_fd90_r, towns_video_fd90_w, 0xffffffff) |