trunk/src/mame/drivers/mystwarr.c
| r31118 | r31119 | |
| 1016 | 1016 | |
| 1017 | 1017 | MCFG_K055555_ADD("k055555") |
| 1018 | 1018 | |
| 1019 | | MCFG_K055673_ADD_NOINTF("k055673") |
| 1019 | MCFG_DEVICE_ADD("k055673", K055673, 0) |
| 1020 | MCFG_K055673_CB(mystwarr_state, mystwarr_sprite_callback) |
| 1021 | MCFG_K055673_CONFIG("gfx2", 0, 0, -48, -24) |
| 1020 | 1022 | MCFG_K055673_GFXDECODE("gfxdecode") |
| 1021 | 1023 | MCFG_K055673_PALETTE("palette") |
| 1022 | 1024 | |
| r31118 | r31119 | |
| 1024 | 1026 | MCFG_K054338_ALPHAINV(1) |
| 1025 | 1027 | MCFG_K054338_MIXER("k055555") |
| 1026 | 1028 | |
| 1027 | | MCFG_VIDEO_START_OVERRIDE(mystwarr_state,mystwarr) |
| 1029 | MCFG_VIDEO_START_OVERRIDE(mystwarr_state, mystwarr) |
| 1028 | 1030 | |
| 1029 | 1031 | /* sound hardware */ |
| 1030 | 1032 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| r31118 | r31119 | |
| 1053 | 1055 | MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt) |
| 1054 | 1056 | |
| 1055 | 1057 | /* video hardware */ |
| 1056 | | MCFG_VIDEO_START_OVERRIDE(mystwarr_state,viostorm) |
| 1058 | MCFG_VIDEO_START_OVERRIDE(mystwarr_state, viostorm) |
| 1057 | 1059 | MCFG_SCREEN_MODIFY("screen") |
| 1058 | 1060 | MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_metamrph) |
| 1059 | 1061 | |
| r31118 | r31119 | |
| 1064 | 1066 | |
| 1065 | 1067 | MCFG_DEVICE_MODIFY("k056832") |
| 1066 | 1068 | MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) |
| 1069 | |
| 1070 | MCFG_DEVICE_MODIFY("k055673") |
| 1071 | MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback) |
| 1072 | MCFG_K055673_CONFIG("gfx2", 0, 1, -62, -23) |
| 1067 | 1073 | MACHINE_CONFIG_END |
| 1068 | 1074 | |
| 1069 | 1075 | static MACHINE_CONFIG_DERIVED( metamrph, mystwarr ) |
| r31118 | r31119 | |
| 1082 | 1088 | MCFG_K053250_ADD("k053250_1", "palette", "screen", -7, 0) |
| 1083 | 1089 | |
| 1084 | 1090 | /* video hardware */ |
| 1085 | | MCFG_VIDEO_START_OVERRIDE(mystwarr_state,metamrph) |
| 1091 | MCFG_VIDEO_START_OVERRIDE(mystwarr_state, metamrph) |
| 1086 | 1092 | MCFG_SCREEN_MODIFY("screen") |
| 1087 | 1093 | MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_metamrph) |
| 1088 | 1094 | |
| r31118 | r31119 | |
| 1093 | 1099 | |
| 1094 | 1100 | MCFG_DEVICE_MODIFY("k056832") |
| 1095 | 1101 | MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) |
| 1102 | |
| 1103 | MCFG_DEVICE_MODIFY("k055673") |
| 1104 | MCFG_K055673_CB(mystwarr_state, metamrph_sprite_callback) |
| 1105 | MCFG_K055673_CONFIG("gfx2", 0, 1, -51, -24) |
| 1096 | 1106 | MACHINE_CONFIG_END |
| 1097 | 1107 | |
| 1098 | 1108 | static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr ) |
| r31118 | r31119 | |
| 1111 | 1121 | MCFG_GFXDECODE_MODIFY("gfxdecode", dadandrn) |
| 1112 | 1122 | |
| 1113 | 1123 | /* video hardware */ |
| 1114 | | MCFG_VIDEO_START_OVERRIDE(mystwarr_state,dadandrn) |
| 1124 | MCFG_VIDEO_START_OVERRIDE(mystwarr_state, dadandrn) |
| 1115 | 1125 | MCFG_SCREEN_MODIFY("screen") |
| 1116 | 1126 | MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_dadandrn) |
| 1117 | 1127 | |
| r31118 | r31119 | |
| 1122 | 1132 | |
| 1123 | 1133 | MCFG_DEVICE_MODIFY("k056832") |
| 1124 | 1134 | MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) |
| 1135 | |
| 1136 | MCFG_DEVICE_MODIFY("k055673") |
| 1137 | MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback) |
| 1138 | MCFG_K055673_CONFIG("gfx2", 0, 0, -42, -22) |
| 1125 | 1139 | MACHINE_CONFIG_END |
| 1126 | 1140 | |
| 1127 | 1141 | static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr ) |
| r31118 | r31119 | |
| 1142 | 1156 | MCFG_GFXDECODE_MODIFY("gfxdecode", gaiapols) |
| 1143 | 1157 | |
| 1144 | 1158 | /* video hardware */ |
| 1145 | | MCFG_VIDEO_START_OVERRIDE(mystwarr_state,gaiapols) |
| 1159 | MCFG_VIDEO_START_OVERRIDE(mystwarr_state, gaiapols) |
| 1146 | 1160 | MCFG_SCREEN_MODIFY("screen") |
| 1147 | 1161 | MCFG_SCREEN_UPDATE_DRIVER(mystwarr_state, screen_update_dadandrn) |
| 1148 | 1162 | |
| r31118 | r31119 | |
| 1154 | 1168 | |
| 1155 | 1169 | MCFG_DEVICE_MODIFY("k056832") |
| 1156 | 1170 | MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) |
| 1171 | |
| 1172 | MCFG_DEVICE_MODIFY("k055673") |
| 1173 | MCFG_K055673_CB(mystwarr_state, gaiapols_sprite_callback) |
| 1174 | MCFG_K055673_CONFIG("gfx2", 0, 1, -61, -22) // stage2 brick walls |
| 1157 | 1175 | MACHINE_CONFIG_END |
| 1158 | 1176 | |
| 1159 | 1177 | static MACHINE_CONFIG_DERIVED( martchmp, mystwarr ) |
| r31118 | r31119 | |
| 1174 | 1192 | MCFG_PALETTE_ENABLE_SHADOWS() |
| 1175 | 1193 | MCFG_PALETTE_ENABLE_HILIGHTS() |
| 1176 | 1194 | |
| 1177 | | MCFG_VIDEO_START_OVERRIDE(mystwarr_state,martchmp) |
| 1195 | MCFG_VIDEO_START_OVERRIDE(mystwarr_state, martchmp) |
| 1178 | 1196 | |
| 1179 | 1197 | MCFG_SCREEN_MODIFY("screen") |
| 1180 | 1198 | MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| r31118 | r31119 | |
| 1185 | 1203 | |
| 1186 | 1204 | MCFG_DEVICE_MODIFY("k056832") |
| 1187 | 1205 | MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) |
| 1206 | |
| 1207 | MCFG_DEVICE_MODIFY("k055673") |
| 1208 | MCFG_K055673_CB(mystwarr_state, martchmp_sprite_callback) |
| 1209 | MCFG_K055673_CONFIG("gfx2", 0, 0, -58, -23) |
| 1188 | 1210 | MACHINE_CONFIG_END |
| 1189 | 1211 | |
| 1190 | 1212 | /**********************************************************************************/ |
trunk/src/mame/drivers/konamigx.c
| r31118 | r31119 | |
| 1647 | 1647 | MCFG_K054338_SET_SCREEN("screen") |
| 1648 | 1648 | MCFG_K054338_ALPHAINV(1) |
| 1649 | 1649 | |
| 1650 | | MCFG_K055673_ADD_NOINTF("k055673") |
| 1650 | MCFG_DEVICE_ADD("k055673", K055673, 0) |
| 1651 | MCFG_K055673_CB(konamigx_state, type2_sprite_callback) |
| 1652 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -26, -23) |
| 1651 | 1653 | MCFG_K055673_SET_SCREEN("screen") |
| 1652 | 1654 | MCFG_K055673_GFXDECODE("gfxdecode") |
| 1653 | 1655 | MCFG_K055673_PALETTE("palette") |
| 1654 | 1656 | |
| 1655 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_5bpp) |
| 1657 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_5bpp) |
| 1656 | 1658 | |
| 1657 | 1659 | /* sound hardware */ |
| 1658 | 1660 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| r31118 | r31119 | |
| 1678 | 1680 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1679 | 1681 | MACHINE_CONFIG_END |
| 1680 | 1682 | |
| 1683 | static MACHINE_CONFIG_DERIVED( gokuparo, konamigx ) |
| 1684 | MCFG_DEVICE_MODIFY("k055673") |
| 1685 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -46, -23) |
| 1686 | MACHINE_CONFIG_END |
| 1687 | |
| 1681 | 1688 | static MACHINE_CONFIG_DERIVED( sexyparo, konamigx ) |
| 1682 | 1689 | MCFG_DEVICE_MODIFY("k056832") |
| 1683 | 1690 | MCFG_K056832_CB(konamigx_state, alpha_tile_callback) |
| 1691 | |
| 1692 | MCFG_DEVICE_MODIFY("k055673") |
| 1693 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -42, -23) |
| 1684 | 1694 | MACHINE_CONFIG_END |
| 1685 | 1695 | |
| 1686 | 1696 | static MACHINE_CONFIG_DERIVED( tbyahhoo, konamigx ) |
| r31118 | r31119 | |
| 1691 | 1701 | static MACHINE_CONFIG_DERIVED( dragoonj, konamigx ) |
| 1692 | 1702 | MCFG_SCREEN_MODIFY("screen") |
| 1693 | 1703 | MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1) |
| 1694 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,dragoonj) |
| 1704 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, dragoonj) |
| 1695 | 1705 | |
| 1696 | 1706 | MCFG_DEVICE_MODIFY("k056832") |
| 1697 | 1707 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 1, 0, "none") |
| 1708 | |
| 1709 | MCFG_DEVICE_MODIFY("k055673") |
| 1710 | MCFG_K055673_CB(konamigx_state, dragoonj_sprite_callback) |
| 1711 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_RNG, -53, -23) |
| 1698 | 1712 | MACHINE_CONFIG_END |
| 1699 | 1713 | |
| 1700 | 1714 | static MACHINE_CONFIG_DERIVED( le2, konamigx ) |
| 1701 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,le2) |
| 1715 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, le2) |
| 1702 | 1716 | |
| 1703 | 1717 | MCFG_DEVICE_MODIFY("k056832") |
| 1704 | 1718 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 1, 0, "none") |
| 1719 | |
| 1720 | MCFG_DEVICE_MODIFY("k055673") |
| 1721 | MCFG_K055673_CB(konamigx_state, le2_sprite_callback) |
| 1722 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_LE2, -46, -23) |
| 1705 | 1723 | MACHINE_CONFIG_END |
| 1706 | 1724 | |
| 1707 | 1725 | static MACHINE_CONFIG_DERIVED( konamigx_6bpp, konamigx ) |
| 1708 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp) |
| 1726 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_6bpp) |
| 1709 | 1727 | |
| 1710 | 1728 | MCFG_DEVICE_MODIFY("k056832") |
| 1711 | 1729 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") |
| 1730 | |
| 1731 | MCFG_DEVICE_MODIFY("k055673") |
| 1732 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -46, -23) |
| 1712 | 1733 | MACHINE_CONFIG_END |
| 1713 | 1734 | |
| 1714 | | static MACHINE_CONFIG_DERIVED( konamigx_6bpp_2, konamigx ) |
| 1715 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp_2) |
| 1716 | | |
| 1735 | static MACHINE_CONFIG_DERIVED( salmndr2, konamigx ) |
| 1717 | 1736 | MCFG_DEVICE_MODIFY("k056832") |
| 1718 | 1737 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 1, 0, "none") |
| 1738 | |
| 1739 | MCFG_DEVICE_MODIFY("k055673") |
| 1740 | MCFG_K055673_CB(konamigx_state, salmndr2_sprite_callback) |
| 1741 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -48, -23) |
| 1719 | 1742 | MACHINE_CONFIG_END |
| 1720 | 1743 | |
| 1721 | 1744 | static MACHINE_CONFIG_DERIVED( opengolf, konamigx ) |
| r31118 | r31119 | |
| 1723 | 1746 | MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223) |
| 1724 | 1747 | MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1) |
| 1725 | 1748 | MCFG_GFXDECODE_MODIFY("gfxdecode", opengolf) |
| 1726 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,opengolf) |
| 1749 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, opengolf) |
| 1727 | 1750 | |
| 1751 | MCFG_DEVICE_MODIFY("k055673") |
| 1752 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -53, -23) |
| 1753 | |
| 1728 | 1754 | MCFG_CPU_MODIFY("maincpu") |
| 1729 | 1755 | MCFG_CPU_PROGRAM_MAP(gx_type1_map) |
| 1730 | 1756 | |
| r31118 | r31119 | |
| 1737 | 1763 | MCFG_SCREEN_RAW_PARAMS(8000000, 384+24+64+40, 0, 383, 224+16+8+16, 0, 223) |
| 1738 | 1764 | MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1) |
| 1739 | 1765 | MCFG_GFXDECODE_MODIFY("gfxdecode", racinfrc) |
| 1740 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,racinfrc) |
| 1766 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, racinfrc) |
| 1741 | 1767 | |
| 1742 | 1768 | MCFG_DEVICE_MODIFY("k056832") |
| 1743 | 1769 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") |
| 1744 | 1770 | |
| 1771 | MCFG_DEVICE_MODIFY("k055673") |
| 1772 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX, -53, -23) |
| 1773 | |
| 1745 | 1774 | MCFG_CPU_MODIFY("maincpu") |
| 1746 | 1775 | MCFG_CPU_PROGRAM_MAP(gx_type1_map) |
| 1747 | 1776 | |
| r31118 | r31119 | |
| 1757 | 1786 | |
| 1758 | 1787 | MCFG_DEFAULT_LAYOUT(layout_dualhsxs) |
| 1759 | 1788 | |
| 1760 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type3) |
| 1789 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type3) |
| 1761 | 1790 | |
| 1762 | 1791 | MCFG_DEVICE_MODIFY("k056832") |
| 1763 | 1792 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") |
| 1764 | 1793 | |
| 1794 | MCFG_DEVICE_MODIFY("k055673") |
| 1795 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -132, -23) |
| 1796 | |
| 1765 | 1797 | MCFG_PALETTE_MODIFY("palette") |
| 1766 | 1798 | MCFG_PALETTE_ENTRIES(16384) |
| 1767 | 1799 | MCFG_PALETTE_ENABLE_SHADOWS() |
| r31118 | r31119 | |
| 1810 | 1842 | MCFG_PALETTE_ENABLE_HILIGHTS() |
| 1811 | 1843 | |
| 1812 | 1844 | MCFG_GFXDECODE_MODIFY("gfxdecode", type4) |
| 1813 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4) |
| 1845 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4) |
| 1814 | 1846 | |
| 1815 | 1847 | MCFG_DEVICE_MODIFY("k056832") |
| 1816 | 1848 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 0, "none") |
| 1849 | |
| 1850 | MCFG_DEVICE_MODIFY("k055673") |
| 1851 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -79, -24) // -23 looks better in intro |
| 1817 | 1852 | MACHINE_CONFIG_END |
| 1818 | 1853 | |
| 1819 | 1854 | static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 ) |
| r31118 | r31119 | |
| 1827 | 1862 | MCFG_SCREEN_SIZE(128*8, 32*8) |
| 1828 | 1863 | MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16) |
| 1829 | 1864 | |
| 1830 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_vsn) |
| 1865 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_vsn) |
| 1831 | 1866 | |
| 1832 | 1867 | MCFG_DEVICE_MODIFY("k056832") |
| 1833 | 1868 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none") // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0 |
| 1869 | |
| 1870 | MCFG_DEVICE_MODIFY("k055673") |
| 1871 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -132, -23) |
| 1834 | 1872 | MACHINE_CONFIG_END |
| 1835 | 1873 | |
| 1836 | 1874 | static MACHINE_CONFIG_DERIVED( gxtype4sd2, gxtype4 ) |
| 1837 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_sd2) |
| 1875 | MCFG_VIDEO_START_OVERRIDE(konamigx_state, konamigx_type4_sd2) |
| 1876 | |
| 1877 | MCFG_DEVICE_MODIFY("k055673") |
| 1878 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_GX6, -81, -23) |
| 1838 | 1879 | MACHINE_CONFIG_END |
| 1839 | 1880 | |
| 1840 | | |
| 1841 | | |
| 1842 | 1881 | static MACHINE_CONFIG_DERIVED( winspike, konamigx ) |
| 1843 | 1882 | MCFG_SCREEN_MODIFY("screen") |
| 1844 | 1883 | MCFG_SCREEN_VISIBLE_AREA(38, 38+384-1, 16, 16+224-1) |
| 1845 | | MCFG_VIDEO_START_OVERRIDE(konamigx_state,winspike) |
| 1846 | 1884 | |
| 1847 | 1885 | MCFG_DEVICE_MODIFY("k056832") |
| 1848 | 1886 | MCFG_K056832_CB(konamigx_state, alpha_tile_callback) |
| 1849 | 1887 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none") |
| 1888 | |
| 1889 | MCFG_DEVICE_MODIFY("k055673") |
| 1890 | MCFG_K055673_CONFIG("gfx2", 0, K055673_LAYOUT_LE2, -53, -23) |
| 1850 | 1891 | MACHINE_CONFIG_END |
| 1851 | 1892 | |
| 1852 | 1893 | |
| r31118 | r31119 | |
| 3801 | 3842 | GAME( 1994, le2u, le2, le2, le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: Gun Fighters (ver UAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3802 | 3843 | GAME( 1994, le2j, le2, le2, le2_flip, konamigx_state, konamigx, ORIENTATION_FLIP_Y, "Konami", "Lethal Enforcers II: The Western (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3803 | 3844 | |
| 3804 | | GAME( 1994, fantjour, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3805 | | GAME( 1994, fantjoura,fantjour, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3806 | | GAME( 1994, gokuparo, fantjour, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", GAME_IMPERFECT_GRAPHICS ) |
| 3845 | GAME( 1994, fantjour, konamigx, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver EAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3846 | GAME( 1994, fantjoura,fantjour, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Fantastic Journey (ver AAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3847 | GAME( 1994, gokuparo, fantjour, gokuparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Gokujyou Parodius (ver JAD)", GAME_IMPERFECT_GRAPHICS ) |
| 3807 | 3848 | |
| 3808 | | GAME( 1994, crzcross, konamigx, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Crazy Cross (ver EAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3809 | | GAME( 1994, puzldama, crzcross, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3849 | GAME( 1994, crzcross, konamigx, gokuparo, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Crazy Cross (ver EAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3850 | GAME( 1994, puzldama, crzcross, gokuparo, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3810 | 3851 | |
| 3811 | 3852 | GAME( 1995, tbyahhoo, konamigx, tbyahhoo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3812 | 3853 | |
| r31118 | r31119 | |
| 3823 | 3864 | GAME( 1996, tokkae, konamigx, konamigx_6bpp, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Tokkae-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3824 | 3865 | |
| 3825 | 3866 | /* protection controls player ship direction in attract mode - doesn't impact playability */ |
| 3826 | | GAME( 1996, salmndr2, konamigx, konamigx_6bpp_2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION ) |
| 3827 | | GAME( 1996, salmndr2a,salmndr2, konamigx_6bpp_2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION ) |
| 3867 | GAME( 1996, salmndr2, konamigx, salmndr2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver JAA)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION ) |
| 3868 | GAME( 1996, salmndr2a,salmndr2, salmndr2, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Salamander 2 (ver AAB)", GAME_IMPERFECT_GRAPHICS|GAME_UNEMULATED_PROTECTION ) |
| 3828 | 3869 | |
| 3829 | 3870 | /* bad sprite colours, part of tilemap gets blanked out when a game starts (might be more protection) */ |
| 3830 | 3871 | GAME( 1997, winspike, konamigx, winspike, konamigx, konamigx_state, konamigx, ROT0, "Konami", "Winning Spike (ver EAA)", GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS ) |
trunk/src/mame/video/mystwarr.c
| r31118 | r31119 | |
| 74 | 74 | *color = m_layer_colorbase[layer] | (*color >> 2 & 0x0f); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | | static void mystwarr_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 77 | K055673_CB_MEMBER(mystwarr_state::mystwarr_sprite_callback) |
| 78 | 78 | { |
| 79 | | mystwarr_state *state = machine.driver_data<mystwarr_state>(); |
| 80 | 79 | int c = *color; |
| 81 | | |
| 82 | | *color = state->m_sprite_colorbase | (c & 0x001f); |
| 83 | | *priority = c & 0x00f0; |
| 80 | *color = m_sprite_colorbase | (c & 0x001f); |
| 81 | *priority_mask = c & 0x00f0; |
| 84 | 82 | } |
| 85 | 83 | |
| 86 | | static void metamrph_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 84 | K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback) |
| 87 | 85 | { |
| 88 | | mystwarr_state *state = machine.driver_data<mystwarr_state>(); |
| 89 | 86 | int c = *color; |
| 90 | 87 | int attr = c; |
| 91 | 88 | |
| 92 | | c = (c & 0x1f) | state->m_sprite_colorbase; |
| 89 | c = (c & 0x1f) | m_sprite_colorbase; |
| 93 | 90 | |
| 94 | 91 | // Bit8 & 9 are effect attributes. It is not known whether the effects are generated by external logic. |
| 95 | 92 | if ((attr & 0x300) != 0x300) |
| 96 | 93 | { |
| 97 | 94 | *color = c; |
| 98 | | *priority = (attr & 0xe0) >> 2; |
| 95 | *priority_mask = (attr & 0xe0) >> 2; |
| 99 | 96 | } |
| 100 | 97 | else |
| 101 | 98 | { |
| 102 | 99 | *color = c | 3<<K055555_MIXSHIFT | K055555_SKIPSHADOW; // reflection? |
| 103 | | *priority = 0x1c; |
| 100 | *priority_mask = 0x1c; |
| 104 | 101 | } |
| 105 | 102 | } |
| 106 | 103 | |
| 107 | | static void gaiapols_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 104 | K055673_CB_MEMBER(mystwarr_state::gaiapols_sprite_callback) |
| 108 | 105 | { |
| 109 | | mystwarr_state *state = machine.driver_data<mystwarr_state>(); |
| 110 | 106 | int c = *color; |
| 111 | 107 | |
| 112 | | *color = state->m_sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f); |
| 113 | | *priority = c & 0x00e0; |
| 108 | *color = m_sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f); |
| 109 | *priority_mask = c & 0x00e0; |
| 114 | 110 | } |
| 115 | 111 | |
| 116 | | static void martchmp_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 112 | K055673_CB_MEMBER(mystwarr_state::martchmp_sprite_callback) |
| 117 | 113 | { |
| 118 | | mystwarr_state *state = machine.driver_data<mystwarr_state>(); |
| 119 | 114 | int c = *color; |
| 120 | 115 | |
| 121 | 116 | // Bit8 & 9 are effect attributes. It is not known whether the effects are generated by external logic. |
| 122 | 117 | if ((c & 0x3ff) == 0x11f) |
| 123 | 118 | *color = K055555_FULLSHADOW; |
| 124 | 119 | else |
| 125 | | *color = state->m_sprite_colorbase | (c & 0x1f); |
| 120 | *color = m_sprite_colorbase | (c & 0x1f); |
| 126 | 121 | |
| 127 | | if (state->m_oinprion & 0xf0) |
| 128 | | *priority = state->m_cbparam; // use PCU2 internal priority |
| 122 | if (m_oinprion & 0xf0) |
| 123 | *priority_mask = m_cbparam; // use PCU2 internal priority |
| 129 | 124 | else |
| 130 | | *priority = c & 0xf0; // use color implied priority |
| 125 | *priority_mask = c & 0xf0; // use color implied priority |
| 131 | 126 | } |
| 132 | 127 | |
| 133 | 128 | |
| r31118 | r31119 | |
| 152 | 147 | SET_TILE_INFO_MEMBER(0, tileno, colour, 0); |
| 153 | 148 | } |
| 154 | 149 | |
| 155 | | VIDEO_START_MEMBER(mystwarr_state,gaiapols) |
| 150 | VIDEO_START_MEMBER(mystwarr_state, gaiapols) |
| 156 | 151 | { |
| 157 | 152 | m_gametype = 0; |
| 158 | 153 | |
| 159 | 154 | mystwarr_decode_tiles(machine()); |
| 160 | 155 | |
| 161 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -61, -22, gaiapols_sprite_callback); // stage2 brick walls |
| 162 | | |
| 163 | 156 | konamigx_mixer_init(*m_screen, 0); |
| 164 | 157 | |
| 165 | 158 | m_k056832->set_layer_offs(0, -2+2-1, 0-1); |
| r31118 | r31119 | |
| 187 | 180 | SET_TILE_INFO_MEMBER(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0); |
| 188 | 181 | } |
| 189 | 182 | |
| 190 | | VIDEO_START_MEMBER(mystwarr_state,dadandrn) |
| 183 | VIDEO_START_MEMBER(mystwarr_state, dadandrn) |
| 191 | 184 | { |
| 192 | 185 | m_gametype = 1; |
| 193 | 186 | |
| 194 | 187 | mystwarr_decode_tiles(machine()); |
| 195 | 188 | |
| 196 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -42, -22, gaiapols_sprite_callback); |
| 197 | | |
| 198 | 189 | konamigx_mixer_init(*m_screen, 0); |
| 199 | 190 | |
| 200 | 191 | konamigx_mixer_primode(1); |
| r31118 | r31119 | |
| 211 | 202 | m_ult_936_tilemap->set_transparent_pen(0); |
| 212 | 203 | } |
| 213 | 204 | |
| 214 | | VIDEO_START_MEMBER(mystwarr_state,mystwarr) |
| 205 | VIDEO_START_MEMBER(mystwarr_state, mystwarr) |
| 215 | 206 | { |
| 216 | 207 | m_gametype = 0; |
| 217 | 208 | |
| 218 | 209 | mystwarr_decode_tiles(machine()); |
| 219 | 210 | |
| 220 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -48, -24, mystwarr_sprite_callback); |
| 221 | | |
| 222 | 211 | konamigx_mixer_init(*m_screen, 0); |
| 223 | 212 | |
| 224 | 213 | m_k056832->set_layer_offs(0, -2-3, 0); |
| r31118 | r31119 | |
| 229 | 218 | m_cbparam = 0; |
| 230 | 219 | } |
| 231 | 220 | |
| 232 | | VIDEO_START_MEMBER(mystwarr_state,metamrph) |
| 221 | VIDEO_START_MEMBER(mystwarr_state, metamrph) |
| 233 | 222 | { |
| 234 | 223 | m_gametype = 0; |
| 235 | 224 | |
| 236 | 225 | mystwarr_decode_tiles(machine()); |
| 237 | 226 | |
| 238 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -51, -24, metamrph_sprite_callback); |
| 239 | | |
| 240 | 227 | konamigx_mixer_init(*m_screen, 0); |
| 241 | 228 | |
| 242 | 229 | // other reference, floor at first boss |
| r31118 | r31119 | |
| 246 | 233 | m_k056832->set_layer_offs(3, 3+4, 0); // attract sky background to sea |
| 247 | 234 | } |
| 248 | 235 | |
| 249 | | VIDEO_START_MEMBER(mystwarr_state,viostorm) |
| 236 | VIDEO_START_MEMBER(mystwarr_state, viostorm) |
| 250 | 237 | { |
| 251 | 238 | m_gametype = 0; |
| 252 | 239 | |
| 253 | 240 | mystwarr_decode_tiles(machine()); |
| 254 | 241 | |
| 255 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -62, -23, metamrph_sprite_callback); |
| 256 | | |
| 257 | 242 | konamigx_mixer_init(*m_screen, 0); |
| 258 | 243 | |
| 259 | 244 | m_k056832->set_layer_offs(0, -2+1, 0); |
| r31118 | r31119 | |
| 262 | 247 | m_k056832->set_layer_offs(3, 3+1, 0); |
| 263 | 248 | } |
| 264 | 249 | |
| 265 | | VIDEO_START_MEMBER(mystwarr_state,martchmp) |
| 250 | VIDEO_START_MEMBER(mystwarr_state, martchmp) |
| 266 | 251 | { |
| 267 | 252 | m_gametype = 0; |
| 268 | 253 | |
| 269 | 254 | mystwarr_decode_tiles(machine()); |
| 270 | 255 | |
| 271 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -58, -23, martchmp_sprite_callback); |
| 272 | | |
| 273 | 256 | konamigx_mixer_init(*m_screen, 0); |
| 274 | 257 | |
| 275 | 258 | m_k056832->set_layer_offs(0, -2-4, 0); |
trunk/src/mame/video/konamigx.c
| r31118 | r31119 | |
| 152 | 152 | return(c18 | op); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | | static void konamigx_type2_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 155 | K055673_CB_MEMBER(konamigx_state::type2_sprite_callback) |
| 156 | 156 | { |
| 157 | 157 | int num = *code; |
| 158 | 158 | int c18 = *color; |
| r31118 | r31119 | |
| 160 | 160 | *code = k053247_vrcbk[num>>14] | (num & 0x3fff); |
| 161 | 161 | c18 = K053247GX_combine_c18(c18); |
| 162 | 162 | *color = K055555GX_decode_objcolor(c18); |
| 163 | | *priority = K055555GX_decode_inpri(c18); |
| 163 | *priority_mask = K055555GX_decode_inpri(c18); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | | static void konamigx_dragoonj_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 166 | K055673_CB_MEMBER(konamigx_state::dragoonj_sprite_callback) |
| 167 | 167 | { |
| 168 | 168 | int num, op, pri, c18; |
| 169 | 169 | |
| r31118 | r31119 | |
| 175 | 175 | pri = (pri & 0x200) ? 4 : pri>>4 & 0xf; |
| 176 | 176 | op &= oinprion; |
| 177 | 177 | pri &=~oinprion; |
| 178 | | *priority = pri | op; |
| 178 | *priority_mask = pri | op; |
| 179 | 179 | |
| 180 | 180 | c18 = K053247GX_combine_c18(c18); |
| 181 | 181 | *color = K055555GX_decode_objcolor(c18); |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | | static void konamigx_salmndr2_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 184 | K055673_CB_MEMBER(konamigx_state::salmndr2_sprite_callback) |
| 185 | 185 | { |
| 186 | 186 | int num, op, pri, c18; |
| 187 | 187 | |
| r31118 | r31119 | |
| 193 | 193 | pri = pri>>4 & 0x3f; |
| 194 | 194 | op &= oinprion; |
| 195 | 195 | pri &=~oinprion; |
| 196 | | *priority = pri | op; |
| 196 | *priority_mask = pri | op; |
| 197 | 197 | |
| 198 | 198 | c18 = K053247GX_combine_c18(c18); |
| 199 | 199 | *color = K055555GX_decode_objcolor(c18); |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | | static void konamigx_le2_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| 202 | K055673_CB_MEMBER(konamigx_state::le2_sprite_callback) |
| 203 | 203 | { |
| 204 | 204 | int num, op, pri; |
| 205 | 205 | |
| r31118 | r31119 | |
| 213 | 213 | pri &= 0xf0; |
| 214 | 214 | op &= oinprion; |
| 215 | 215 | pri &=~oinprion; |
| 216 | | *priority = pri | op; |
| 216 | *priority_mask = pri | op; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | static int K055555GX_decode_vmixcolor(int layer, int *color) // (see p.62 7.2.6 and p.27 3.3) |
| r31118 | r31119 | |
| 341 | 341 | static struct GX_OBJ { int order, offs, code, color; } *gx_objpool; |
| 342 | 342 | static UINT16 *gx_spriteram; |
| 343 | 343 | |
| 344 | | // mirrored K053247 and K054338 settings |
| 345 | | static void (*k053247_callback)(running_machine &machine, int *code,int *color,int *priority); |
| 346 | | |
| 347 | | |
| 344 | // mirrored K054338 settings |
| 348 | 345 | static int *K054338_shdRGB; |
| 349 | 346 | |
| 350 | 347 | |
| r31118 | r31119 | |
| 357 | 354 | gx_shdzbuf = auto_alloc_array(machine(), UINT8, GX_ZBUFSIZE); |
| 358 | 355 | gx_objpool = auto_alloc_array(machine(), struct GX_OBJ, GX_MAX_OBJECTS); |
| 359 | 356 | |
| 360 | | m_k055673->alt_k053247_export_config(&k053247_callback); |
| 361 | 357 | m_k054338->export_config(&K054338_shdRGB); |
| 362 | 358 | |
| 363 | 359 | if (objdma) |
| r31118 | r31119 | |
| 574 | 570 | int color = k = gx_spriteram[offs+6]; |
| 575 | 571 | l = gx_spriteram[offs+7]; |
| 576 | 572 | |
| 577 | | (*k053247_callback)(machine(), &code, &color, &pri); |
| 573 | m_k055673->m_k053247_cb(&code, &color, &pri); |
| 578 | 574 | |
| 579 | 575 | /* |
| 580 | 576 | shadow = shadow code |
| r31118 | r31119 | |
| 1163 | 1159 | > so, well, the top bits of the code are suspicious |
| 1164 | 1160 | */ |
| 1165 | 1161 | |
| 1166 | | void konamigx_state::_gxcommoninitnosprites(running_machine &machine) |
| 1162 | void konamigx_state::common_init() |
| 1167 | 1163 | { |
| 1168 | | int i; |
| 1169 | | |
| 1170 | 1164 | konamigx_mixer_init(*m_screen, 0); |
| 1171 | 1165 | |
| 1172 | | for (i = 0; i < 8; i++) |
| 1166 | for (int i = 0; i < 8; i++) |
| 1173 | 1167 | { |
| 1174 | 1168 | gx_tilebanks[i] = gx_oldbanks[i] = 0; |
| 1175 | 1169 | } |
| 1176 | 1170 | |
| 1177 | | machine.save().save_item(NAME(gx_tilebanks)); |
| 1171 | machine().save().save_item(NAME(gx_tilebanks)); |
| 1178 | 1172 | |
| 1179 | 1173 | gx_tilemode = 0; |
| 1180 | 1174 | |
| r31118 | r31119 | |
| 1197 | 1191 | m_konamigx_current_frame = 0; |
| 1198 | 1192 | } |
| 1199 | 1193 | |
| 1200 | | void konamigx_state::_gxcommoninit(running_machine &machine) |
| 1201 | | { |
| 1202 | | // (+ve values move objects to the right and -ve values move objects to the left) |
| 1203 | | m_k055673->alt_k055673_vh_start(machine, "gfx2", K055673_LAYOUT_GX, -26, -23, konamigx_type2_sprite_callback); |
| 1204 | 1194 | |
| 1205 | | _gxcommoninitnosprites(machine); |
| 1206 | | } |
| 1207 | | |
| 1208 | | |
| 1209 | | VIDEO_START_MEMBER(konamigx_state,konamigx_5bpp) |
| 1195 | VIDEO_START_MEMBER(konamigx_state, konamigx_5bpp) |
| 1210 | 1196 | { |
| 1211 | | _gxcommoninit(machine()); |
| 1212 | | |
| 1213 | | /* here are some hand tuned per game scroll offsets to go with the per game visible areas, |
| 1214 | | i see no better way of doing this for now... */ |
| 1215 | | |
| 1197 | common_init(); |
| 1198 | |
| 1216 | 1199 | if (!strcmp(machine().system().name,"tbyahhoo")) |
| 1217 | | { |
| 1218 | 1200 | gx_tilemode = 1; |
| 1219 | | } else |
| 1220 | | |
| 1221 | | if (!strcmp(machine().system().name,"crzcross") || !strcmp(machine().system().name,"puzldama")) |
| 1222 | | { |
| 1223 | | m_k055673->k053247_set_sprite_offs(-46, -23); |
| 1201 | else if (!strcmp(machine().system().name,"crzcross") || !strcmp(machine().system().name,"puzldama")) |
| 1224 | 1202 | konamigx_mixer_primode(5); |
| 1225 | | } else |
| 1226 | | |
| 1227 | | if (!strcmp(machine().system().name,"daiskiss")) |
| 1228 | | { |
| 1203 | else if (!strcmp(machine().system().name,"daiskiss")) |
| 1229 | 1204 | konamigx_mixer_primode(4); |
| 1230 | | } else |
| 1231 | | |
| 1232 | | if (!strcmp(machine().system().name,"gokuparo") || !strcmp(machine().system().name,"fantjour") || !strcmp(machine().system().name,"fantjoura")) |
| 1233 | | { |
| 1234 | | m_k055673->k053247_set_sprite_offs(-46, -23); |
| 1235 | | } else |
| 1236 | | |
| 1237 | | if (!strcmp(machine().system().name,"sexyparo") || !strcmp(machine().system().name,"sexyparoa")) |
| 1238 | | { |
| 1239 | | m_k055673->k053247_set_sprite_offs(-42, -23); |
| 1240 | | } |
| 1241 | 1205 | } |
| 1242 | 1206 | |
| 1243 | | VIDEO_START_MEMBER(konamigx_state,winspike) |
| 1207 | VIDEO_START_MEMBER(konamigx_state, dragoonj) |
| 1244 | 1208 | { |
| 1245 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -53, -23, konamigx_type2_sprite_callback); |
| 1209 | common_init(); |
| 1246 | 1210 | |
| 1247 | | _gxcommoninitnosprites(machine()); |
| 1248 | | } |
| 1249 | | |
| 1250 | | VIDEO_START_MEMBER(konamigx_state,dragoonj) |
| 1251 | | { |
| 1252 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_RNG, -53, -23, konamigx_dragoonj_sprite_callback); |
| 1253 | | |
| 1254 | | _gxcommoninitnosprites(machine()); |
| 1255 | | |
| 1256 | 1211 | m_k056832->set_layer_offs(0, -2+1, 0); |
| 1257 | 1212 | m_k056832->set_layer_offs(1, 0+1, 0); |
| 1258 | 1213 | m_k056832->set_layer_offs(2, 2+1, 0); |
| 1259 | 1214 | m_k056832->set_layer_offs(3, 3+1, 0); |
| 1260 | 1215 | } |
| 1261 | 1216 | |
| 1262 | | VIDEO_START_MEMBER(konamigx_state,le2) |
| 1217 | VIDEO_START_MEMBER(konamigx_state, le2) |
| 1263 | 1218 | { |
| 1264 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -46, -23, konamigx_le2_sprite_callback); |
| 1219 | common_init(); |
| 1265 | 1220 | |
| 1266 | | _gxcommoninitnosprites(machine()); |
| 1267 | | |
| 1268 | 1221 | konamigx_mixer_primode(-1); // swapped layer B and C priorities? |
| 1269 | 1222 | |
| 1270 | 1223 | gx_le2_textcolour_hack = 1; // force text layer to use the right palette |
| 1271 | 1224 | m_k055555->K055555_write_reg(K55_INPUT_ENABLES, 1); // it doesn't turn on the video output at first for the test screens, maybe it should default to ON? |
| 1272 | 1225 | } |
| 1273 | 1226 | |
| 1274 | | VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp) |
| 1227 | VIDEO_START_MEMBER(konamigx_state, konamigx_6bpp) |
| 1275 | 1228 | { |
| 1276 | | _gxcommoninit(machine()); |
| 1277 | | |
| 1278 | | if (!strcmp(machine().system().name,"tokkae") || !strcmp(machine().system().name,"tkmmpzdm")) |
| 1279 | | { |
| 1280 | | m_k055673->k053247_set_sprite_offs(-46, -23); |
| 1281 | | konamigx_mixer_primode(5); |
| 1282 | | } |
| 1229 | common_init(); |
| 1230 | konamigx_mixer_primode(5); |
| 1283 | 1231 | } |
| 1284 | 1232 | |
| 1285 | | VIDEO_START_MEMBER(konamigx_state,konamigx_type3) |
| 1233 | VIDEO_START_MEMBER(konamigx_state, konamigx_type3) |
| 1286 | 1234 | { |
| 1287 | 1235 | int width = m_screen->width(); |
| 1288 | 1236 | int height = m_screen->height(); |
| 1289 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback); |
| 1290 | 1237 | |
| 1291 | 1238 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1292 | 1239 | dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1293 | 1240 | |
| 1294 | | _gxcommoninitnosprites(machine()); |
| 1241 | common_init(); |
| 1295 | 1242 | |
| 1296 | 1243 | gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 256, 256); |
| 1297 | 1244 | gx_psac_tilemap_alt = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac3_alt_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 256, 256); |
| r31118 | r31119 | |
| 1319 | 1266 | konamigx_palformat = 1; |
| 1320 | 1267 | } |
| 1321 | 1268 | |
| 1322 | | VIDEO_START_MEMBER(konamigx_state,konamigx_type4) |
| 1269 | VIDEO_START_MEMBER(konamigx_state, konamigx_type4) |
| 1323 | 1270 | { |
| 1324 | 1271 | int width = m_screen->width(); |
| 1325 | 1272 | int height = m_screen->height(); |
| 1326 | 1273 | |
| 1327 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -79, -24, konamigx_type2_sprite_callback); // -23 looks better in intro |
| 1328 | | |
| 1329 | 1274 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1330 | 1275 | dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1331 | 1276 | |
| 1332 | | _gxcommoninitnosprites(machine()); |
| 1277 | common_init(); |
| 1333 | 1278 | |
| 1334 | 1279 | gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128); |
| 1335 | 1280 | gx_rozenable = 0; |
| r31118 | r31119 | |
| 1349 | 1294 | |
| 1350 | 1295 | } |
| 1351 | 1296 | |
| 1352 | | VIDEO_START_MEMBER(konamigx_state,konamigx_type4_vsn) |
| 1297 | VIDEO_START_MEMBER(konamigx_state, konamigx_type4_vsn) |
| 1353 | 1298 | { |
| 1354 | 1299 | int width = m_screen->width(); |
| 1355 | 1300 | int height = m_screen->height(); |
| 1356 | 1301 | |
| 1357 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback); |
| 1358 | | |
| 1359 | 1302 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1360 | 1303 | dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1361 | 1304 | |
| 1362 | | _gxcommoninitnosprites(machine()); |
| 1305 | common_init(); |
| 1363 | 1306 | |
| 1364 | 1307 | gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128); |
| 1365 | 1308 | gx_rozenable = 0; |
| r31118 | r31119 | |
| 1378 | 1321 | konamigx_palformat = 0; |
| 1379 | 1322 | } |
| 1380 | 1323 | |
| 1381 | | VIDEO_START_MEMBER(konamigx_state,konamigx_type4_sd2) |
| 1324 | VIDEO_START_MEMBER(konamigx_state, konamigx_type4_sd2) |
| 1382 | 1325 | { |
| 1383 | 1326 | int width = m_screen->width(); |
| 1384 | 1327 | int height = m_screen->height(); |
| 1385 | 1328 | |
| 1386 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -81, -23, konamigx_type2_sprite_callback); |
| 1387 | | |
| 1388 | 1329 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1389 | 1330 | dualscreen_right_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| 1390 | 1331 | |
| 1391 | | _gxcommoninitnosprites(machine()); |
| 1332 | common_init(); |
| 1392 | 1333 | |
| 1393 | 1334 | gx_psac_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(konamigx_state::get_gx_psac_tile_info),this), TILEMAP_SCAN_COLS, 16, 16, 128, 128); |
| 1394 | 1335 | gx_rozenable = 0; |
| r31118 | r31119 | |
| 1410 | 1351 | |
| 1411 | 1352 | } |
| 1412 | 1353 | |
| 1413 | | |
| 1414 | | VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp_2) |
| 1354 | VIDEO_START_MEMBER(konamigx_state, opengolf) |
| 1415 | 1355 | { |
| 1416 | | if (!strcmp(machine().system().name,"salmndr2") || !strcmp(machine().system().name,"salmndr2a")) |
| 1417 | | { |
| 1418 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -48, -23, konamigx_salmndr2_sprite_callback); |
| 1356 | common_init(); |
| 1419 | 1357 | |
| 1420 | | _gxcommoninitnosprites(machine()); |
| 1421 | | } |
| 1422 | | else |
| 1423 | | { |
| 1424 | | _gxcommoninit(machine()); |
| 1425 | | } |
| 1426 | | } |
| 1427 | | |
| 1428 | | VIDEO_START_MEMBER(konamigx_state,opengolf) |
| 1429 | | { |
| 1430 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -53, -23, konamigx_type2_sprite_callback); |
| 1431 | | |
| 1432 | | _gxcommoninitnosprites(machine()); |
| 1433 | | |
| 1434 | 1358 | m_k056832->set_layer_offs(0, -2+1, 0); |
| 1435 | 1359 | m_k056832->set_layer_offs(1, 0+1, 0); |
| 1436 | 1360 | m_k056832->set_layer_offs(2, 2+1, 0); |
| r31118 | r31119 | |
| 1462 | 1386 | |
| 1463 | 1387 | } |
| 1464 | 1388 | |
| 1465 | | VIDEO_START_MEMBER(konamigx_state,racinfrc) |
| 1389 | VIDEO_START_MEMBER(konamigx_state, racinfrc) |
| 1466 | 1390 | { |
| 1467 | | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX, -53, -23, konamigx_type2_sprite_callback); |
| 1391 | common_init(); |
| 1468 | 1392 | |
| 1469 | | _gxcommoninitnosprites(machine()); |
| 1470 | | |
| 1471 | 1393 | m_k056832->set_layer_offs(0, -2+1, 0); |
| 1472 | 1394 | m_k056832->set_layer_offs(1, 0+1, 0); |
| 1473 | 1395 | m_k056832->set_layer_offs(2, 2+1, 0); |
trunk/src/mame/video/k053246_k053247_k055673.c
| r31118 | r31119 | |
| 56 | 56 | for (int i=0;i<16;i++) |
| 57 | 57 | m_kx47_regs[i] = 0; |
| 58 | 58 | |
| 59 | | m_dx = m_dy = 0; |
| 60 | 59 | m_objcha_line = 0; |
| 61 | 60 | m_z_rejection = 0; |
| 62 | 61 | |
| 63 | | m_callback = 0; |
| 64 | | |
| 65 | 62 | m_memory_region = 0; |
| 66 | | |
| 67 | | m_intf_gfx_memory_region = 0; |
| 68 | | m_intf_gfx_num = -1; |
| 69 | | m_intf_plane_order = 0; |
| 70 | | m_intf_dx = m_intf_dy = 0; |
| 71 | | m_intf_callback = 0; |
| 72 | 63 | } |
| 73 | 64 | |
| 74 | 65 | void k053247_device::k053247_get_ram( UINT16 **ram ) |
| r31118 | r31119 | |
| 96 | 87 | return(m_kx47_regs[regnum]); |
| 97 | 88 | } |
| 98 | 89 | |
| 99 | | void k053247_device::k053247_set_sprite_offs( int offsx, int offsy ) |
| 100 | | { |
| 101 | | m_dx = offsx; |
| 102 | | m_dy = offsy; |
| 103 | | } |
| 104 | 90 | |
| 105 | | |
| 106 | | |
| 107 | 91 | WRITE16_MEMBER( k053247_device::k053247_reg_word_w ) // write-only OBJSET2 registers (see p.43 table 6.1) |
| 108 | 92 | { |
| 109 | 93 | COMBINE_DATA(m_kx47_regs + offset); |
| r31118 | r31119 | |
| 462 | 446 | shadow = color = m_ram[offs + 6]; |
| 463 | 447 | primask = 0; |
| 464 | 448 | |
| 465 | | m_callback(machine(), &code, &color, &primask); |
| 449 | m_k053247_cb(&code, &color, &primask); |
| 466 | 450 | |
| 467 | 451 | k053247_draw_single_sprite_gxcore( bitmap, cliprect, |
| 468 | 452 | NULL, NULL, |
| r31118 | r31119 | |
| 979 | 963 | |
| 980 | 964 | void k055673_device::device_start() |
| 981 | 965 | { |
| 982 | | /* early out for the non-interface cases for now */ |
| 983 | | if (m_intf_gfx_num == -1) |
| 984 | | return; |
| 985 | | |
| 986 | | alt_k055673_vh_start(machine(), m_intf_gfx_memory_region, m_intf_plane_order, m_intf_dx, m_intf_dy, m_intf_callback); |
| 966 | int gfx_index; |
| 967 | UINT32 total; |
| 968 | |
| 969 | static const gfx_layout spritelayout = /* System GX sprite layout */ |
| 970 | { |
| 971 | 16,16, |
| 972 | 0, |
| 973 | 5, |
| 974 | { 32, 24, 16, 8, 0 }, |
| 975 | { 0, 1, 2, 3, 4, 5, 6, 7, 40, 41, 42, 43, 44, 45, 46, 47 }, |
| 976 | { 0, 10*8, 10*8*2, 10*8*3, 10*8*4, 10*8*5, 10*8*6, 10*8*7, 10*8*8, |
| 977 | 10*8*9, 10*8*10, 10*8*11, 10*8*12, 10*8*13, 10*8*14, 10*8*15 }, |
| 978 | 16*16*5 |
| 979 | }; |
| 980 | static const gfx_layout spritelayout2 = /* Run and Gun sprite layout */ |
| 981 | { |
| 982 | 16,16, |
| 983 | 0, |
| 984 | 4, |
| 985 | { 24, 16, 8, 0 }, |
| 986 | { 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39 }, |
| 987 | { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }, |
| 988 | 16*16*4 |
| 989 | }; |
| 990 | static const gfx_layout spritelayout3 = /* Lethal Enforcers II sprite layout */ |
| 991 | { |
| 992 | 16,16, |
| 993 | 0, |
| 994 | 8, |
| 995 | { 8*1,8*0,8*3,8*2,8*5,8*4,8*7,8*6 }, |
| 996 | { 0,1,2,3,4,5,6,7,64+0,64+1,64+2,64+3,64+4,64+5,64+6,64+7 }, |
| 997 | { 128*0, 128*1, 128*2, 128*3, 128*4, 128*5, 128*6, 128*7, |
| 998 | 128*8, 128*9, 128*10, 128*11, 128*12, 128*13, 128*14, 128*15 }, |
| 999 | 128*16 |
| 1000 | }; |
| 1001 | static const gfx_layout spritelayout4 = /* System GX 6bpp sprite layout */ |
| 1002 | { |
| 1003 | 16,16, |
| 1004 | 0, |
| 1005 | 6, |
| 1006 | { 40, 32, 24, 16, 8, 0 }, |
| 1007 | { 0, 1, 2, 3, 4, 5, 6, 7, 48, 49, 50, 51, 52, 53, 54, 55 }, |
| 1008 | { 0, 12*8, 12*8*2, 12*8*3, 12*8*4, 12*8*5, 12*8*6, 12*8*7, 12*8*8, |
| 1009 | 12*8*9, 12*8*10, 12*8*11, 12*8*12, 12*8*13, 12*8*14, 12*8*15 }, |
| 1010 | 16*16*6 |
| 1011 | }; |
| 1012 | UINT8 *s1, *s2, *d; |
| 1013 | long i; |
| 1014 | UINT16 *alt_k055673_rom; |
| 1015 | int size4; |
| 1016 | |
| 1017 | /* find first empty slot to decode gfx */ |
| 1018 | for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) |
| 1019 | if (m_gfxdecode->gfx(gfx_index) == 0) |
| 1020 | break; |
| 1021 | assert(gfx_index != MAX_GFX_ELEMENTS); |
| 1022 | |
| 1023 | alt_k055673_rom = (UINT16 *)machine().root_device().memregion(m_memory_region)->base(); |
| 1024 | |
| 1025 | /* decode the graphics */ |
| 1026 | switch (m_plane_order) |
| 1027 | { |
| 1028 | case K055673_LAYOUT_GX: |
| 1029 | size4 = (machine().root_device().memregion(m_memory_region)->bytes()/(1024*1024))/5; |
| 1030 | size4 *= 4*1024*1024; |
| 1031 | /* set the # of tiles based on the 4bpp section */ |
| 1032 | alt_k055673_rom = auto_alloc_array(machine(), UINT16, size4 * 5 / 2); |
| 1033 | d = (UINT8 *)alt_k055673_rom; |
| 1034 | // now combine the graphics together to form 5bpp |
| 1035 | s1 = machine().root_device().memregion(m_memory_region)->base(); // 4bpp area |
| 1036 | s2 = s1 + (size4); // 1bpp area |
| 1037 | for (i = 0; i < size4; i+= 4) |
| 1038 | { |
| 1039 | *d++ = *s1++; |
| 1040 | *d++ = *s1++; |
| 1041 | *d++ = *s1++; |
| 1042 | *d++ = *s1++; |
| 1043 | *d++ = *s2++; |
| 1044 | } |
| 1045 | |
| 1046 | total = size4 / 128; |
| 1047 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout, 5); |
| 1048 | break; |
| 1049 | |
| 1050 | case K055673_LAYOUT_RNG: |
| 1051 | total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16/2); |
| 1052 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout2, 4); |
| 1053 | break; |
| 1054 | |
| 1055 | case K055673_LAYOUT_LE2: |
| 1056 | total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16); |
| 1057 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout3, 8); |
| 1058 | break; |
| 1059 | |
| 1060 | case K055673_LAYOUT_GX6: |
| 1061 | total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16*6/8); |
| 1062 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout4, 6); |
| 1063 | break; |
| 1064 | |
| 1065 | default: |
| 1066 | fatalerror("Unsupported layout\n"); |
| 1067 | } |
| 1068 | |
| 1069 | if (VERBOSE && !(m_palette->shadows_enabled())) |
| 1070 | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| 1071 | |
| 1072 | m_z_rejection = -1; |
| 1073 | m_gfx = m_gfxdecode->gfx(gfx_index); |
| 1074 | m_objcha_line = CLEAR_LINE; |
| 1075 | m_ram = auto_alloc_array(machine(), UINT16, 0x1000/2); |
| 1076 | |
| 1077 | memset(m_ram, 0, 0x1000); |
| 1078 | memset(m_kx46_regs, 0, 8); |
| 1079 | memset(m_kx47_regs, 0, 32); |
| 1080 | |
| 1081 | machine().save().save_pointer(NAME(m_ram), 0x800); |
| 1082 | machine().save().save_item(NAME(m_kx46_regs)); |
| 1083 | machine().save().save_item(NAME(m_kx47_regs)); |
| 1084 | machine().save().save_item(NAME(m_objcha_line)); |
| 987 | 1085 | } |
| 988 | 1086 | |
| 989 | 1087 | //------------------------------------------------- |
| r31118 | r31119 | |
| 1033 | 1131 | } |
| 1034 | 1132 | |
| 1035 | 1133 | //------------------------------------------------- |
| 1036 | | // device_config_complete - perform any |
| 1037 | | // operations now that the configuration is |
| 1038 | | // complete |
| 1039 | | //------------------------------------------------- |
| 1040 | | |
| 1041 | | void k053247_device::device_config_complete() |
| 1042 | | { |
| 1043 | | // inherit a copy of the static data |
| 1044 | | const k053247_interface *intf = reinterpret_cast<const k053247_interface *>(static_config()); |
| 1045 | | if (intf != NULL) |
| 1046 | | *static_cast<k053247_interface *>(this) = *intf; |
| 1047 | | |
| 1048 | | // or initialize to defaults if none provided |
| 1049 | | else |
| 1050 | | { |
| 1051 | | } |
| 1052 | | |
| 1053 | | } |
| 1054 | | |
| 1055 | | //------------------------------------------------- |
| 1056 | 1134 | // device_start - device-specific startup |
| 1057 | 1135 | //------------------------------------------------- |
| 1058 | 1136 | |
| r31118 | r31119 | |
| 1087 | 1165 | }; |
| 1088 | 1166 | |
| 1089 | 1167 | /* decode the graphics */ |
| 1090 | | switch (m_intf_plane_order) |
| 1168 | switch (m_plane_order) |
| 1091 | 1169 | { |
| 1092 | 1170 | case NORMAL_PLANE_ORDER: |
| 1093 | | total = machine().root_device().memregion(m_intf_gfx_memory_region)->bytes() / 128; |
| 1094 | | konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_intf_gfx_num, machine().root_device().memregion(m_intf_gfx_memory_region)->base(), total, &spritelayout, 4); |
| 1171 | total = machine().root_device().memregion(m_memory_region)->bytes() / 128; |
| 1172 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_memory_region)->base(), total, &spritelayout, 4); |
| 1095 | 1173 | break; |
| 1096 | 1174 | |
| 1097 | 1175 | case TASMAN_PLANE_ORDER: |
| 1098 | | total = machine().root_device().memregion(m_intf_gfx_memory_region)->bytes() / 128; |
| 1099 | | konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_intf_gfx_num, machine().root_device().memregion(m_intf_gfx_memory_region)->base(), total, &tasman_16x16_layout, 4); |
| 1176 | total = machine().root_device().memregion(m_memory_region)->bytes() / 128; |
| 1177 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, m_gfx_num, machine().root_device().memregion(m_memory_region)->base(), total, &tasman_16x16_layout, 4); |
| 1100 | 1178 | break; |
| 1101 | 1179 | |
| 1102 | 1180 | default: |
| r31118 | r31119 | |
| 1117 | 1195 | } |
| 1118 | 1196 | } |
| 1119 | 1197 | |
| 1120 | | m_dx = m_intf_dx; |
| 1121 | | m_dy = m_intf_dy; |
| 1122 | | m_memory_region = m_intf_gfx_memory_region; |
| 1123 | | m_gfx = m_gfxdecode->gfx(m_intf_gfx_num); |
| 1124 | | m_callback = m_intf_callback; |
| 1198 | m_gfx = m_gfxdecode->gfx(m_gfx_num); |
| 1125 | 1199 | |
| 1126 | 1200 | m_ram = auto_alloc_array_clear(machine(), UINT16, 0x1000 / 2); |
| 1127 | 1201 | |
| r31118 | r31119 | |
| 1185 | 1259 | return (k053247_reg_word_r( space, offset + 1, 0xffff) | k053247_reg_word_r( space, offset, 0xffff) << 16); |
| 1186 | 1260 | } |
| 1187 | 1261 | |
| 1188 | | |
| 1189 | | /***************************************************************************/ |
| 1190 | | /* */ |
| 1191 | | /* 053246/053247 */ |
| 1192 | | /* stuff GX still relies on */ |
| 1193 | | /* */ |
| 1194 | | /***************************************************************************/ |
| 1195 | | |
| 1196 | | |
| 1197 | | void k053247_device::alt_k053247_export_config(void (**callback)(running_machine &, int *, int *, int *)) |
| 1198 | | { |
| 1199 | | if(callback) |
| 1200 | | *callback = m_callback; |
| 1201 | | } |
| 1202 | | |
| 1203 | | /* alt_K055673 used with the 54246 in PreGX/Run and Gun/System GX games */ |
| 1204 | | void k053247_device::alt_k055673_vh_start(running_machine &machine, const char *gfx_memory_region, int layout, int dx, int dy, void (*callback)(running_machine &machine, int *code,int *color,int *priority)) |
| 1205 | | { |
| 1206 | | int gfx_index; |
| 1207 | | UINT32 total; |
| 1208 | | |
| 1209 | | static const gfx_layout spritelayout = /* System GX sprite layout */ |
| 1210 | | { |
| 1211 | | 16,16, |
| 1212 | | 0, |
| 1213 | | 5, |
| 1214 | | { 32, 24, 16, 8, 0 }, |
| 1215 | | { 0, 1, 2, 3, 4, 5, 6, 7, 40, 41, 42, 43, 44, 45, 46, 47 }, |
| 1216 | | { 0, 10*8, 10*8*2, 10*8*3, 10*8*4, 10*8*5, 10*8*6, 10*8*7, 10*8*8, |
| 1217 | | 10*8*9, 10*8*10, 10*8*11, 10*8*12, 10*8*13, 10*8*14, 10*8*15 }, |
| 1218 | | 16*16*5 |
| 1219 | | }; |
| 1220 | | static const gfx_layout spritelayout2 = /* Run and Gun sprite layout */ |
| 1221 | | { |
| 1222 | | 16,16, |
| 1223 | | 0, |
| 1224 | | 4, |
| 1225 | | { 24, 16, 8, 0 }, |
| 1226 | | { 0, 1, 2, 3, 4, 5, 6, 7, 32, 33, 34, 35, 36, 37, 38, 39 }, |
| 1227 | | { 0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960 }, |
| 1228 | | 16*16*4 |
| 1229 | | }; |
| 1230 | | static const gfx_layout spritelayout3 = /* Lethal Enforcers II sprite layout */ |
| 1231 | | { |
| 1232 | | 16,16, |
| 1233 | | 0, |
| 1234 | | 8, |
| 1235 | | { 8*1,8*0,8*3,8*2,8*5,8*4,8*7,8*6 }, |
| 1236 | | { 0,1,2,3,4,5,6,7,64+0,64+1,64+2,64+3,64+4,64+5,64+6,64+7 }, |
| 1237 | | { 128*0, 128*1, 128*2, 128*3, 128*4, 128*5, 128*6, 128*7, |
| 1238 | | 128*8, 128*9, 128*10, 128*11, 128*12, 128*13, 128*14, 128*15 }, |
| 1239 | | 128*16 |
| 1240 | | }; |
| 1241 | | static const gfx_layout spritelayout4 = /* System GX 6bpp sprite layout */ |
| 1242 | | { |
| 1243 | | 16,16, |
| 1244 | | 0, |
| 1245 | | 6, |
| 1246 | | { 40, 32, 24, 16, 8, 0 }, |
| 1247 | | { 0, 1, 2, 3, 4, 5, 6, 7, 48, 49, 50, 51, 52, 53, 54, 55 }, |
| 1248 | | { 0, 12*8, 12*8*2, 12*8*3, 12*8*4, 12*8*5, 12*8*6, 12*8*7, 12*8*8, |
| 1249 | | 12*8*9, 12*8*10, 12*8*11, 12*8*12, 12*8*13, 12*8*14, 12*8*15 }, |
| 1250 | | 16*16*6 |
| 1251 | | }; |
| 1252 | | UINT8 *s1, *s2, *d; |
| 1253 | | long i; |
| 1254 | | UINT16 *alt_k055673_rom; |
| 1255 | | int size4; |
| 1256 | | |
| 1257 | | /* find first empty slot to decode gfx */ |
| 1258 | | for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) |
| 1259 | | if (m_gfxdecode->gfx(gfx_index) == 0) |
| 1260 | | break; |
| 1261 | | assert(gfx_index != MAX_GFX_ELEMENTS); |
| 1262 | | |
| 1263 | | alt_k055673_rom = (UINT16 *)machine.root_device().memregion(gfx_memory_region)->base(); |
| 1264 | | |
| 1265 | | /* decode the graphics */ |
| 1266 | | switch(layout) |
| 1267 | | { |
| 1268 | | case K055673_LAYOUT_GX: |
| 1269 | | size4 = (machine.root_device().memregion(gfx_memory_region)->bytes()/(1024*1024))/5; |
| 1270 | | size4 *= 4*1024*1024; |
| 1271 | | /* set the # of tiles based on the 4bpp section */ |
| 1272 | | alt_k055673_rom = auto_alloc_array(machine, UINT16, size4 * 5 / 2); |
| 1273 | | d = (UINT8 *)alt_k055673_rom; |
| 1274 | | // now combine the graphics together to form 5bpp |
| 1275 | | s1 = machine.root_device().memregion(gfx_memory_region)->base(); // 4bpp area |
| 1276 | | s2 = s1 + (size4); // 1bpp area |
| 1277 | | for (i = 0; i < size4; i+= 4) |
| 1278 | | { |
| 1279 | | *d++ = *s1++; |
| 1280 | | *d++ = *s1++; |
| 1281 | | *d++ = *s1++; |
| 1282 | | *d++ = *s1++; |
| 1283 | | *d++ = *s2++; |
| 1284 | | } |
| 1285 | | |
| 1286 | | total = size4 / 128; |
| 1287 | | konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout, 5); |
| 1288 | | break; |
| 1289 | | |
| 1290 | | case K055673_LAYOUT_RNG: |
| 1291 | | total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16/2); |
| 1292 | | konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout2, 4); |
| 1293 | | break; |
| 1294 | | |
| 1295 | | case K055673_LAYOUT_LE2: |
| 1296 | | total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16); |
| 1297 | | konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout3, 8); |
| 1298 | | break; |
| 1299 | | |
| 1300 | | case K055673_LAYOUT_GX6: |
| 1301 | | total = machine.root_device().memregion(gfx_memory_region)->bytes() / (16*16*6/8); |
| 1302 | | konami_decode_gfx(machine, m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout4, 6); |
| 1303 | | break; |
| 1304 | | |
| 1305 | | default: |
| 1306 | | fatalerror("Unsupported layout\n"); |
| 1307 | | } |
| 1308 | | |
| 1309 | | if (VERBOSE && !(m_palette->shadows_enabled())) |
| 1310 | | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| 1311 | | |
| 1312 | | m_dx = dx; |
| 1313 | | m_dy = dy; |
| 1314 | | m_z_rejection = -1; |
| 1315 | | m_memory_region = gfx_memory_region; |
| 1316 | | m_gfx = m_gfxdecode->gfx(gfx_index); |
| 1317 | | m_callback = callback; |
| 1318 | | m_objcha_line = CLEAR_LINE; |
| 1319 | | m_ram = auto_alloc_array(machine, UINT16, 0x1000/2); |
| 1320 | | |
| 1321 | | memset(m_ram, 0, 0x1000); |
| 1322 | | memset(m_kx46_regs, 0, 8); |
| 1323 | | memset(m_kx47_regs, 0, 32); |
| 1324 | | |
| 1325 | | machine.save().save_pointer(NAME(m_ram), 0x800); |
| 1326 | | machine.save().save_item(NAME(m_kx46_regs)); |
| 1327 | | machine.save().save_item(NAME(m_kx47_regs)); |
| 1328 | | machine.save().save_item(NAME(m_objcha_line)); |
| 1329 | | } |
trunk/src/mame/video/k053246_k053247_k055673.h
| r31118 | r31119 | |
| 9 | 9 | #define NORMAL_PLANE_ORDER 0x0123 |
| 10 | 10 | #define TASMAN_PLANE_ORDER 0x1616 |
| 11 | 11 | |
| 12 | | typedef void (*k05324x_callback)(running_machine &machine, int *code, int *color, int *priority); |
| 12 | typedef device_delegate<void (int *code, int *color, int *priority_mask)> k053247_cb_delegate; |
| 13 | #define K053246_CB_MEMBER(_name) void _name(int *code, int *color, int *priority_mask) |
| 14 | #define K055673_CB_MEMBER(_name) void _name(int *code, int *color, int *priority_mask) |
| 13 | 15 | |
| 16 | #define MCFG_K053246_CB(_class, _method) \ |
| 17 | k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); |
| 14 | 18 | |
| 19 | #define MCFG_K053246_CONFIG(_gfx_reg, _gfx_num, _order, _dx, _dy) \ |
| 20 | k053247_device::set_config(*device, _gfx_reg, _gfx_num, _order, _dx, _dy); |
| 21 | |
| 22 | #define MCFG_K055673_CB(_class, _method) \ |
| 23 | k053247_device::set_k053247_callback(*device, k053247_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); |
| 24 | |
| 25 | #define MCFG_K055673_CONFIG(_gfx_reg, _gfx_num, _order, _dx, _dy) \ |
| 26 | k053247_device::set_config(*device, _gfx_reg, _gfx_num, _order, _dx, _dy); |
| 27 | |
| 28 | |
| 15 | 29 | /** Konami 053246 / 053247 / 055673 **/ |
| 16 | 30 | #define K055673_LAYOUT_GX 0 |
| 17 | 31 | #define K055673_LAYOUT_RNG 1 |
| r31118 | r31119 | |
| 42 | 56 | #endif |
| 43 | 57 | |
| 44 | 58 | |
| 45 | | struct k053247_interface |
| 46 | | { |
| 47 | | const char *m_intf_gfx_memory_region; |
| 48 | | int m_intf_gfx_num; |
| 49 | | int m_intf_plane_order; |
| 50 | | int m_intf_dx, m_intf_dy; |
| 51 | | k05324x_callback m_intf_callback; |
| 52 | | }; |
| 53 | | |
| 54 | 59 | class k053247_device : public device_t, |
| 55 | | public device_video_interface, |
| 56 | | public k053247_interface |
| 60 | public device_video_interface |
| 57 | 61 | { |
| 58 | 62 | public: |
| 59 | 63 | k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| r31118 | r31119 | |
| 64 | 68 | // static configuration |
| 65 | 69 | static void static_set_gfxdecode_tag(device_t &device, const char *tag); |
| 66 | 70 | static void static_set_palette_tag(device_t &device, const char *tag); |
| 67 | | |
| 71 | static void set_k053247_callback(device_t &device, k053247_cb_delegate callback) { downcast<k053247_device &>(device).m_k053247_cb = callback; } |
| 72 | static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int order, int dx, int dy) |
| 73 | { |
| 74 | k053247_device &dev = downcast<k053247_device &>(device); |
| 75 | dev.m_memory_region = gfx_reg; |
| 76 | dev.m_gfx_num = gfx_num; |
| 77 | dev.m_plane_order = order; |
| 78 | dev.m_dx = dx; |
| 79 | dev.m_dy = dy; |
| 80 | } |
| 81 | |
| 68 | 82 | void clear_all(); |
| 69 | 83 | |
| 70 | 84 | DECLARE_READ16_MEMBER( k055673_rom_word_r ); |
| r31118 | r31119 | |
| 82 | 96 | void k053247_sprites_draw( bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 83 | 97 | void k053247_sprites_draw( bitmap_rgb32 &bitmap,const rectangle &cliprect); |
| 84 | 98 | int k053247_read_register( int regnum); |
| 85 | | void k053247_set_sprite_offs( int offsx, int offsy); |
| 86 | 99 | void k053247_set_z_rejection( int zcode); // common to k053246/7 |
| 87 | 100 | void k053247_get_ram( UINT16 **ram); |
| 88 | 101 | int k053247_get_dx( void ); |
| r31118 | r31119 | |
| 113 | 126 | UINT8 m_objcha_line; |
| 114 | 127 | int m_z_rejection; |
| 115 | 128 | |
| 116 | | k05324x_callback m_callback; |
| 129 | k053247_cb_delegate m_k053247_cb; |
| 117 | 130 | |
| 131 | //FIXME: device should be updated to use device_gfx_interface to get rid of most of these! |
| 118 | 132 | const char *m_memory_region; |
| 133 | int m_gfx_num; |
| 134 | int m_plane_order; |
| 119 | 135 | required_device<gfxdecode_device> m_gfxdecode; |
| 120 | 136 | required_device<palette_device> m_palette; |
| 121 | 137 | |
| 122 | 138 | /* alt implementation - to be collapsed */ |
| 123 | | void alt_k055673_vh_start(running_machine &machine, const char *gfx_memory_region, int alt_layout, int dx, int dy, |
| 124 | | void (*callback)(running_machine &machine, int *code,int *color,int *priority)); |
| 125 | | |
| 126 | | void alt_k053247_export_config(void (**callback)(running_machine &, int *, int *, int *)); |
| 127 | | |
| 128 | 139 | void zdrawgfxzoom32GP( |
| 129 | 140 | bitmap_rgb32 &bitmap, const rectangle &cliprect, |
| 130 | 141 | UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, |
| r31118 | r31119 | |
| 469 | 480 | |
| 470 | 481 | protected: |
| 471 | 482 | // device-level overrides |
| 472 | | virtual void device_config_complete(); |
| 473 | 483 | virtual void device_start(); |
| 474 | 484 | virtual void device_reset(); |
| 475 | 485 | private: |
| r31118 | r31119 | |
| 487 | 497 | |
| 488 | 498 | protected: |
| 489 | 499 | // device-level overrides |
| 490 | | // virtual void device_config_complete(); |
| 491 | 500 | virtual void device_start(); |
| 492 | 501 | // virtual void device_reset(); |
| 493 | 502 | private: |
| r31118 | r31119 | |
| 497 | 506 | extern const device_type K055673; |
| 498 | 507 | |
| 499 | 508 | |
| 500 | | #define MCFG_K053246_ADD(_tag, _interface) \ |
| 501 | | MCFG_DEVICE_ADD(_tag, K053246, 0) \ |
| 502 | | MCFG_DEVICE_CONFIG(_interface) |
| 503 | | |
| 504 | 509 | #define MCFG_K053246_SET_SCREEN MCFG_VIDEO_SET_SCREEN |
| 505 | 510 | |
| 506 | 511 | #define MCFG_K053246_GFXDECODE(_gfxtag) \ |
| r31118 | r31119 | |
| 510 | 515 | k053247_device::static_set_palette_tag(*device, "^" _palette_tag); |
| 511 | 516 | |
| 512 | 517 | |
| 513 | | #define MCFG_K055673_ADD(_tag, _interface) \ |
| 514 | | MCFG_DEVICE_ADD(_tag, K055673, 0) \ |
| 515 | | MCFG_DEVICE_CONFIG(_interface) |
| 516 | | |
| 517 | | #define MCFG_K055673_ADD_NOINTF(_tag ) \ |
| 518 | | MCFG_DEVICE_ADD(_tag, K055673, 0) |
| 519 | | |
| 520 | 518 | #define MCFG_K055673_SET_SCREEN MCFG_VIDEO_SET_SCREEN |
| 521 | 519 | |
| 522 | 520 | #define MCFG_K055673_GFXDECODE(_gfxtag) \ |
| r31118 | r31119 | |
| 526 | 524 | k055673_device::static_set_palette_tag(*device, "^" _palette_tag); |
| 527 | 525 | |
| 528 | 526 | |
| 529 | | /* old non-device stuff */ |
| 530 | | |
| 531 | | |
| 532 | | |
| 533 | | |
| 534 | | |
| 535 | | |
| 536 | 527 | #endif |