comparison vdp.c @ 1185:9de9d2c6ebe5

Fix border rendering at end of line 1FE. vdp_inactive will probably need a small fixup for the edge case when we start between when the vcounter is incremented and the line is truly finished.
author Michael Pavone <pavone@retrodev.com>
date Thu, 19 Jan 2017 09:32:34 -0800
parents 8d8c71ebbbce
children 75ba222877f7
comparison
equal deleted inserted replaced
1184:b1147418254a 1185:9de9d2c6ebe5
1675 { 1675 {
1676 for (;;) 1676 for (;;)
1677 { 1677 {
1678 case 165: 1678 case 165:
1679 if (context->vcounter == 0x1FF) { 1679 if (context->vcounter == 0x1FF) {
1680 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F];
1681 uint32_t *dst;
1682 if (headless) {
1683 dst = context->output;
1684 } else {
1685 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
1686 + (context->hslot - BG_START_SLOT) * 2;
1687 }
1688 *(dst++) = bg_color;
1689 *dst = bg_color;
1680 external_slot(context); 1690 external_slot(context);
1681 } else { 1691 } else {
1682 render_sprite_cells(context); 1692 render_sprite_cells(context);
1683 } 1693 }
1684 CHECK_LIMIT 1694 CHECK_LIMIT
1685 case 166: 1695 case 166:
1686 if (context->vcounter == 0x1FF) { 1696 if (context->vcounter == 0x1FF) {
1697 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F];
1698 uint32_t *dst;
1699 if (headless) {
1700 dst = context->output;
1701 } else {
1702 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
1703 + (context->hslot - BG_START_SLOT) * 2;
1704 }
1705 *(dst++) = bg_color;
1706 *dst = bg_color;
1687 external_slot(context); 1707 external_slot(context);
1688 } else { 1708 } else {
1689 render_sprite_cells(context); 1709 render_sprite_cells(context);
1690 } 1710 }
1691 CHECK_LIMIT 1711 CHECK_LIMIT
1692 //sprite attribute table scan starts 1712 //sprite attribute table scan starts
1693 case 167: 1713 case 167:
1714 if (context->vcounter == 0x1FF) {
1715 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F];
1716 uint32_t *dst;
1717 if (headless) {
1718 dst = context->output;
1719 } else {
1720 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
1721 + (context->hslot - BG_START_SLOT) * 2;
1722 }
1723 *(dst++) = bg_color;
1724 *(dst++) = bg_color;
1725 *(dst++) = bg_color;
1726 *dst = bg_color;
1727 }
1694 context->sprite_index = 0x80; 1728 context->sprite_index = 0x80;
1695 context->slot_counter = MAX_SPRITES_LINE; 1729 context->slot_counter = MAX_SPRITES_LINE;
1696 render_sprite_cells( context); 1730 render_sprite_cells( context);
1697 scan_sprite_table(context->vcounter, context); 1731 scan_sprite_table(context->vcounter, context);
1698 CHECK_LIMIT 1732 CHECK_LIMIT
1842 { 1876 {
1843 for (;;) 1877 for (;;)
1844 { 1878 {
1845 case 133: 1879 case 133:
1846 if (context->vcounter == 0x1FF) { 1880 if (context->vcounter == 0x1FF) {
1881 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F];
1882 uint32_t *dst;
1883 if (headless) {
1884 dst = context->output;
1885 } else {
1886 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
1887 + (context->hslot - BG_START_SLOT) * 2;
1888 }
1889 *(dst++) = bg_color;
1890 *dst = bg_color;
1847 external_slot(context); 1891 external_slot(context);
1848 } else { 1892 } else {
1849 render_sprite_cells(context); 1893 render_sprite_cells(context);
1850 } 1894 }
1851 CHECK_LIMIT 1895 CHECK_LIMIT
1852 case 134: 1896 case 134:
1853 if (context->vcounter == 0x1FF) { 1897 if (context->vcounter == 0x1FF) {
1898 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F];
1899 uint32_t *dst;
1900 if (headless) {
1901 dst = context->output;
1902 } else {
1903 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
1904 + (context->hslot - BG_START_SLOT) * 2;
1905 }
1906 *(dst++) = bg_color;
1907 *dst = bg_color;
1854 external_slot(context); 1908 external_slot(context);
1855 } else { 1909 } else {
1856 render_sprite_cells(context); 1910 render_sprite_cells(context);
1857 } 1911 }
1858 CHECK_LIMIT 1912 CHECK_LIMIT
1859 //sprite attribute table scan starts 1913 //sprite attribute table scan starts
1860 case 135: //FIXME - Here 1914 case 135: //FIXME - Here
1915 if (context->vcounter == 0x1FF) {
1916 uint32_t bg_color = context->colors[context->regs[REG_BG_COLOR] & 0x3F];
1917 uint32_t *dst;
1918 if (headless) {
1919 dst = context->output;
1920 } else {
1921 dst = ((uint32_t *)(((char *)context->fb) + context->output_pitch * (context->border_top - 2)))
1922 + (context->hslot - BG_START_SLOT) * 2;
1923 }
1924 *(dst++) = bg_color;
1925 *(dst++) = bg_color;
1926 *(dst++) = bg_color;
1927 *dst = bg_color;
1928 }
1861 context->sprite_index = 0x80; 1929 context->sprite_index = 0x80;
1862 context->slot_counter = MAX_SPRITES_LINE_H32; 1930 context->slot_counter = MAX_SPRITES_LINE_H32;
1863 render_sprite_cells( context); 1931 render_sprite_cells( context);
1864 scan_sprite_table(context->vcounter, context); 1932 scan_sprite_table(context->vcounter, context);
1865 CHECK_LIMIT 1933 CHECK_LIMIT