trunk/src/mame/drivers/mystwarr.c
| r31113 | r31114 | |
| 1006 | 1006 | MCFG_PALETTE_ENABLE_SHADOWS() |
| 1007 | 1007 | MCFG_PALETTE_ENABLE_HILIGHTS() |
| 1008 | 1008 | |
| 1009 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 1009 | 1010 | |
| 1010 | | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 1011 | | MCFG_K056832_ADD_NOINTF("k056832"/*, mystwarr_k056832_intf*/) |
| 1011 | MCFG_DEVICE_ADD("k056832", K056832, 0) |
| 1012 | MCFG_K056832_CB(mystwarr_state, mystwarr_tile_callback) |
| 1013 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "none") |
| 1012 | 1014 | MCFG_K056832_GFXDECODE("gfxdecode") |
| 1013 | 1015 | MCFG_K056832_PALETTE("palette") |
| 1016 | |
| 1014 | 1017 | MCFG_K055555_ADD("k055555") |
| 1018 | |
| 1015 | 1019 | MCFG_K055673_ADD_NOINTF("k055673") |
| 1016 | 1020 | MCFG_K055673_GFXDECODE("gfxdecode") |
| 1017 | 1021 | MCFG_K055673_PALETTE("palette") |
| r31113 | r31114 | |
| 1057 | 1061 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(900)) |
| 1058 | 1062 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1059 | 1063 | MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1) |
| 1064 | |
| 1065 | MCFG_DEVICE_MODIFY("k056832") |
| 1066 | MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) |
| 1060 | 1067 | MACHINE_CONFIG_END |
| 1061 | 1068 | |
| 1062 | 1069 | static MACHINE_CONFIG_DERIVED( metamrph, mystwarr ) |
| r31113 | r31114 | |
| 1083 | 1090 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(900)) |
| 1084 | 1091 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1085 | 1092 | MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 15, 15+224-1) |
| 1093 | |
| 1094 | MCFG_DEVICE_MODIFY("k056832") |
| 1095 | MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) |
| 1086 | 1096 | MACHINE_CONFIG_END |
| 1087 | 1097 | |
| 1088 | 1098 | static MACHINE_CONFIG_DERIVED( dadandrn, mystwarr ) |
| r31113 | r31114 | |
| 1109 | 1119 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600)) |
| 1110 | 1120 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1111 | 1121 | MCFG_SCREEN_VISIBLE_AREA(24, 24+288-1, 17, 17+224-1) |
| 1122 | |
| 1123 | MCFG_DEVICE_MODIFY("k056832") |
| 1124 | MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) |
| 1112 | 1125 | MACHINE_CONFIG_END |
| 1113 | 1126 | |
| 1114 | 1127 | static MACHINE_CONFIG_DERIVED( gaiapols, mystwarr ) |
| r31113 | r31114 | |
| 1138 | 1151 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(600)) |
| 1139 | 1152 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1140 | 1153 | MCFG_SCREEN_VISIBLE_AREA(40, 40+376-1, 16, 16+224-1) |
| 1154 | |
| 1155 | MCFG_DEVICE_MODIFY("k056832") |
| 1156 | MCFG_K056832_CB(mystwarr_state, game4bpp_tile_callback) |
| 1141 | 1157 | MACHINE_CONFIG_END |
| 1142 | 1158 | |
| 1143 | 1159 | static MACHINE_CONFIG_DERIVED( martchmp, mystwarr ) |
| r31113 | r31114 | |
| 1166 | 1182 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 1167 | 1183 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 1168 | 1184 | MCFG_SCREEN_VISIBLE_AREA(32, 32+384-1, 16, 16+224-1) |
| 1185 | |
| 1186 | MCFG_DEVICE_MODIFY("k056832") |
| 1187 | MCFG_K056832_CB(mystwarr_state, game5bpp_tile_callback) |
| 1169 | 1188 | MACHINE_CONFIG_END |
| 1170 | 1189 | |
| 1171 | 1190 | /**********************************************************************************/ |
trunk/src/mame/drivers/konamigx.c
| r31113 | r31114 | |
| 1633 | 1633 | MCFG_PALETTE_ENABLE_HILIGHTS() |
| 1634 | 1634 | |
| 1635 | 1635 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", empty) |
| 1636 | | MCFG_K056832_ADD_NOINTF("k056832"/*, konamigx_k056832_intf*/) |
| 1636 | |
| 1637 | MCFG_DEVICE_ADD("k056832", K056832, 0) |
| 1638 | MCFG_K056832_CB(konamigx_state, type2_tile_callback) |
| 1639 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "none") |
| 1637 | 1640 | MCFG_K056832_GFXDECODE("gfxdecode") |
| 1638 | 1641 | MCFG_K056832_PALETTE("palette") |
| 1642 | |
| 1639 | 1643 | MCFG_K055555_ADD("k055555") |
| 1640 | 1644 | |
| 1641 | 1645 | MCFG_DEVICE_ADD("k054338", K054338, 0) |
| r31113 | r31114 | |
| 1674 | 1678 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1675 | 1679 | MACHINE_CONFIG_END |
| 1676 | 1680 | |
| 1681 | static MACHINE_CONFIG_DERIVED( sexyparo, konamigx ) |
| 1682 | MCFG_DEVICE_MODIFY("k056832") |
| 1683 | MCFG_K056832_CB(konamigx_state, alpha_tile_callback) |
| 1684 | MACHINE_CONFIG_END |
| 1685 | |
| 1686 | static MACHINE_CONFIG_DERIVED( tbyahhoo, konamigx ) |
| 1687 | MCFG_DEVICE_MODIFY("k056832") |
| 1688 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 0, 0, "k055555") |
| 1689 | MACHINE_CONFIG_END |
| 1690 | |
| 1677 | 1691 | static MACHINE_CONFIG_DERIVED( dragoonj, konamigx ) |
| 1678 | 1692 | MCFG_SCREEN_MODIFY("screen") |
| 1679 | 1693 | MCFG_SCREEN_VISIBLE_AREA(40, 40+384-1, 16, 16+224-1) |
| 1680 | 1694 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,dragoonj) |
| 1695 | |
| 1696 | MCFG_DEVICE_MODIFY("k056832") |
| 1697 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_5, 1, 0, "none") |
| 1681 | 1698 | MACHINE_CONFIG_END |
| 1682 | 1699 | |
| 1683 | 1700 | static MACHINE_CONFIG_DERIVED( le2, konamigx ) |
| 1684 | 1701 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,le2) |
| 1702 | |
| 1703 | MCFG_DEVICE_MODIFY("k056832") |
| 1704 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 1, 0, "none") |
| 1685 | 1705 | MACHINE_CONFIG_END |
| 1686 | 1706 | |
| 1687 | 1707 | static MACHINE_CONFIG_DERIVED( konamigx_6bpp, konamigx ) |
| 1688 | 1708 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp) |
| 1709 | |
| 1710 | MCFG_DEVICE_MODIFY("k056832") |
| 1711 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") |
| 1689 | 1712 | MACHINE_CONFIG_END |
| 1690 | 1713 | |
| 1691 | 1714 | static MACHINE_CONFIG_DERIVED( konamigx_6bpp_2, konamigx ) |
| 1692 | 1715 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_6bpp_2) |
| 1716 | |
| 1717 | MCFG_DEVICE_MODIFY("k056832") |
| 1718 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 1, 0, "none") |
| 1693 | 1719 | MACHINE_CONFIG_END |
| 1694 | 1720 | |
| 1695 | 1721 | static MACHINE_CONFIG_DERIVED( opengolf, konamigx ) |
| r31113 | r31114 | |
| 1713 | 1739 | MCFG_GFXDECODE_MODIFY("gfxdecode", racinfrc) |
| 1714 | 1740 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,racinfrc) |
| 1715 | 1741 | |
| 1742 | MCFG_DEVICE_MODIFY("k056832") |
| 1743 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") |
| 1744 | |
| 1716 | 1745 | MCFG_CPU_MODIFY("maincpu") |
| 1717 | 1746 | MCFG_CPU_PROGRAM_MAP(gx_type1_map) |
| 1718 | 1747 | |
| r31113 | r31114 | |
| 1730 | 1759 | |
| 1731 | 1760 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type3) |
| 1732 | 1761 | |
| 1762 | MCFG_DEVICE_MODIFY("k056832") |
| 1763 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_6, 0, 0, "none") |
| 1733 | 1764 | |
| 1734 | 1765 | MCFG_PALETTE_MODIFY("palette") |
| 1735 | 1766 | MCFG_PALETTE_ENTRIES(16384) |
| r31113 | r31114 | |
| 1780 | 1811 | |
| 1781 | 1812 | MCFG_GFXDECODE_MODIFY("gfxdecode", type4) |
| 1782 | 1813 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4) |
| 1814 | |
| 1815 | MCFG_DEVICE_MODIFY("k056832") |
| 1816 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 0, "none") |
| 1783 | 1817 | MACHINE_CONFIG_END |
| 1784 | 1818 | |
| 1785 | 1819 | static MACHINE_CONFIG_DERIVED( gxtype4_vsn, gxtype4 ) |
| 1786 | | |
| 1787 | 1820 | MCFG_DEFAULT_LAYOUT(layout_dualhsxs) |
| 1788 | 1821 | |
| 1789 | 1822 | MCFG_SCREEN_MODIFY("screen") |
| r31113 | r31114 | |
| 1795 | 1828 | MCFG_SCREEN_VISIBLE_AREA(0, 576-1, 16, 32*8-1-16) |
| 1796 | 1829 | |
| 1797 | 1830 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_vsn) |
| 1831 | |
| 1832 | MCFG_DEVICE_MODIFY("k056832") |
| 1833 | 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 |
| 1798 | 1834 | MACHINE_CONFIG_END |
| 1799 | 1835 | |
| 1800 | 1836 | static MACHINE_CONFIG_DERIVED( gxtype4sd2, gxtype4 ) |
| 1801 | | |
| 1802 | 1837 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,konamigx_type4_sd2) |
| 1803 | 1838 | MACHINE_CONFIG_END |
| 1804 | 1839 | |
| 1805 | 1840 | |
| 1806 | 1841 | |
| 1807 | 1842 | static MACHINE_CONFIG_DERIVED( winspike, konamigx ) |
| 1808 | | |
| 1809 | 1843 | MCFG_SCREEN_MODIFY("screen") |
| 1810 | 1844 | MCFG_SCREEN_VISIBLE_AREA(38, 38+384-1, 16, 16+224-1) |
| 1811 | 1845 | MCFG_VIDEO_START_OVERRIDE(konamigx_state,winspike) |
| 1846 | |
| 1847 | MCFG_DEVICE_MODIFY("k056832") |
| 1848 | MCFG_K056832_CB(konamigx_state, alpha_tile_callback) |
| 1849 | MCFG_K056832_CONFIG("gfx1", 0, K056832_BPP_8, 0, 2, "none") |
| 1812 | 1850 | MACHINE_CONFIG_END |
| 1813 | 1851 | |
| 1814 | 1852 | |
| r31113 | r31114 | |
| 3770 | 3808 | GAME( 1994, crzcross, konamigx, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Crazy Cross (ver EAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3771 | 3809 | GAME( 1994, puzldama, crzcross, konamigx, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Taisen Puzzle-dama (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3772 | 3810 | |
| 3773 | | GAME( 1995, tbyahhoo, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3811 | GAME( 1995, tbyahhoo, konamigx, tbyahhoo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Twin Bee Yahhoo! (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3774 | 3812 | |
| 3775 | 3813 | GAME( 1995, tkmmpzdm, konamigx, konamigx_6bpp, puzldama, konamigx_state, konamigx, ROT0, "Konami", "Tokimeki Memorial Taisen Puzzle-dama (ver JAB)", GAME_IMPERFECT_GRAPHICS ) |
| 3776 | 3814 | |
| 3777 | 3815 | GAME( 1995, dragoona, konamigx, dragoonj, dragoonj, konamigx_state, konamigx, ROT0, "Konami", "Dragoon Might (ver AAB)", GAME_IMPERFECT_GRAPHICS ) |
| 3778 | 3816 | GAME( 1995, dragoonj, dragoona, dragoonj, dragoonj, konamigx_state, konamigx, ROT0, "Konami", "Dragoon Might (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3779 | 3817 | |
| 3780 | | GAME( 1996, sexyparo, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3781 | | GAME( 1996, sexyparoa,sexyparo, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3818 | GAME( 1996, sexyparo, konamigx, sexyparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3819 | GAME( 1996, sexyparoa,sexyparo, sexyparo, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Sexy Parodius (ver AAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3782 | 3820 | |
| 3783 | 3821 | GAME( 1996, daiskiss, konamigx, konamigx, gokuparo, konamigx_state, konamigx, ROT0, "Konami", "Daisu-Kiss (ver JAA)", GAME_IMPERFECT_GRAPHICS ) |
| 3784 | 3822 | |
trunk/src/mame/video/konamigx.c
| r31113 | r31114 | |
| 60 | 60 | static bitmap_ind16 *gxtype1_roz_dstbitmap2; |
| 61 | 61 | static rectangle gxtype1_roz_dstbitmapclip; |
| 62 | 62 | |
| 63 | | static void (*game_tile_callback)(running_machine &machine, int layer, int *code, int *color, int *flags); |
| 64 | | |
| 65 | | |
| 66 | | |
| 67 | 63 | /***************************************************************************/ |
| 68 | 64 | /* */ |
| 69 | 65 | /* 1st-Tier GX/MW Variables and Functions */ |
| r31113 | r31114 | |
| 1110 | 1106 | SET_TILE_INFO_MEMBER(0, tileno, colour, flip); |
| 1111 | 1107 | } |
| 1112 | 1108 | |
| 1113 | | static void konamigx_type2_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags) |
| 1109 | K056832_CB_MEMBER(konamigx_state::type2_tile_callback) |
| 1114 | 1110 | { |
| 1115 | 1111 | int d = *code; |
| 1116 | 1112 | |
| r31113 | r31114 | |
| 1118 | 1114 | K055555GX_decode_vmixcolor(layer, color); |
| 1119 | 1115 | } |
| 1120 | 1116 | |
| 1121 | | static void konamigx_alpha_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags) |
| 1117 | K056832_CB_MEMBER(konamigx_state::alpha_tile_callback) |
| 1122 | 1118 | { |
| 1123 | 1119 | int mixcode; |
| 1124 | 1120 | int d = *code; |
| r31113 | r31114 | |
| 1212 | 1208 | |
| 1213 | 1209 | VIDEO_START_MEMBER(konamigx_state,konamigx_5bpp) |
| 1214 | 1210 | { |
| 1215 | | if (!strcmp(machine().system().name,"sexyparo") || !strcmp(machine().system().name,"sexyparoa")) |
| 1216 | | game_tile_callback = konamigx_alpha_tile_callback; |
| 1217 | | else |
| 1218 | | game_tile_callback = konamigx_type2_tile_callback; |
| 1219 | | |
| 1220 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game_tile_callback, 0); |
| 1221 | | |
| 1222 | 1211 | _gxcommoninit(machine()); |
| 1223 | 1212 | |
| 1224 | 1213 | /* here are some hand tuned per game scroll offsets to go with the per game visible areas, |
| r31113 | r31114 | |
| 1226 | 1215 | |
| 1227 | 1216 | if (!strcmp(machine().system().name,"tbyahhoo")) |
| 1228 | 1217 | { |
| 1229 | | m_k056832->K056832_set_k055555(m_k055555); |
| 1230 | 1218 | gx_tilemode = 1; |
| 1231 | 1219 | } else |
| 1232 | 1220 | |
| r31113 | r31114 | |
| 1254 | 1242 | |
| 1255 | 1243 | VIDEO_START_MEMBER(konamigx_state,winspike) |
| 1256 | 1244 | { |
| 1257 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_alpha_tile_callback, 2); |
| 1258 | 1245 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -53, -23, konamigx_type2_sprite_callback); |
| 1259 | 1246 | |
| 1260 | 1247 | _gxcommoninitnosprites(machine()); |
| r31113 | r31114 | |
| 1262 | 1249 | |
| 1263 | 1250 | VIDEO_START_MEMBER(konamigx_state,dragoonj) |
| 1264 | 1251 | { |
| 1265 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 1, NULL, konamigx_type2_tile_callback, 0); |
| 1266 | 1252 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_RNG, -53, -23, konamigx_dragoonj_sprite_callback); |
| 1267 | 1253 | |
| 1268 | 1254 | _gxcommoninitnosprites(machine()); |
| r31113 | r31114 | |
| 1275 | 1261 | |
| 1276 | 1262 | VIDEO_START_MEMBER(konamigx_state,le2) |
| 1277 | 1263 | { |
| 1278 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 1, NULL, konamigx_type2_tile_callback, 0); |
| 1279 | 1264 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_LE2, -46, -23, konamigx_le2_sprite_callback); |
| 1280 | 1265 | |
| 1281 | 1266 | _gxcommoninitnosprites(machine()); |
| r31113 | r31114 | |
| 1288 | 1273 | |
| 1289 | 1274 | VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp) |
| 1290 | 1275 | { |
| 1291 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0); |
| 1292 | | |
| 1293 | 1276 | _gxcommoninit(machine()); |
| 1294 | 1277 | |
| 1295 | 1278 | if (!strcmp(machine().system().name,"tokkae") || !strcmp(machine().system().name,"tkmmpzdm")) |
| r31113 | r31114 | |
| 1303 | 1286 | { |
| 1304 | 1287 | int width = m_screen->width(); |
| 1305 | 1288 | int height = m_screen->height(); |
| 1306 | | |
| 1307 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 1); |
| 1308 | 1289 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback); |
| 1309 | 1290 | |
| 1310 | 1291 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| r31113 | r31114 | |
| 1343 | 1324 | int width = m_screen->width(); |
| 1344 | 1325 | int height = m_screen->height(); |
| 1345 | 1326 | |
| 1346 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0); |
| 1347 | 1327 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -79, -24, konamigx_type2_sprite_callback); // -23 looks better in intro |
| 1348 | 1328 | |
| 1349 | 1329 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| r31113 | r31114 | |
| 1374 | 1354 | int width = m_screen->width(); |
| 1375 | 1355 | int height = m_screen->height(); |
| 1376 | 1356 | |
| 1377 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 2); // set djmain_hack to 2 to kill layer association or half the tilemaps vanish on screen 0 |
| 1378 | 1357 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -132, -23, konamigx_type2_sprite_callback); |
| 1379 | 1358 | |
| 1380 | 1359 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| r31113 | r31114 | |
| 1404 | 1383 | int width = m_screen->width(); |
| 1405 | 1384 | int height = m_screen->height(); |
| 1406 | 1385 | |
| 1407 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_8, 0, NULL, konamigx_type2_tile_callback, 0); |
| 1408 | 1386 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -81, -23, konamigx_type2_sprite_callback); |
| 1409 | 1387 | |
| 1410 | 1388 | dualscreen_left_tempbitmap = auto_bitmap_rgb32_alloc(machine(), width, height); |
| r31113 | r31114 | |
| 1435 | 1413 | |
| 1436 | 1414 | VIDEO_START_MEMBER(konamigx_state,konamigx_6bpp_2) |
| 1437 | 1415 | { |
| 1438 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 1, NULL, konamigx_type2_tile_callback, 0); |
| 1439 | | |
| 1440 | 1416 | if (!strcmp(machine().system().name,"salmndr2") || !strcmp(machine().system().name,"salmndr2a")) |
| 1441 | 1417 | { |
| 1442 | 1418 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -48, -23, konamigx_salmndr2_sprite_callback); |
| r31113 | r31114 | |
| 1451 | 1427 | |
| 1452 | 1428 | VIDEO_START_MEMBER(konamigx_state,opengolf) |
| 1453 | 1429 | { |
| 1454 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, konamigx_type2_tile_callback, 0); |
| 1455 | 1430 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX6, -53, -23, konamigx_type2_sprite_callback); |
| 1456 | 1431 | |
| 1457 | 1432 | _gxcommoninitnosprites(machine()); |
| r31113 | r31114 | |
| 1489 | 1464 | |
| 1490 | 1465 | VIDEO_START_MEMBER(konamigx_state,racinfrc) |
| 1491 | 1466 | { |
| 1492 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_6, 0, NULL, konamigx_type2_tile_callback, 0); |
| 1493 | 1467 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", K055673_LAYOUT_GX, -53, -23, konamigx_type2_sprite_callback); |
| 1494 | 1468 | |
| 1495 | 1469 | _gxcommoninitnosprites(machine()); |
trunk/src/mame/video/k054156_k054157_k056832.c
| r31113 | r31114 | |
| 189 | 189 | m_videoram(NULL), |
| 190 | 190 | m_num_gfx_banks(0), |
| 191 | 191 | m_cur_gfx_banks(0), |
| 192 | | m_rom_half(0), |
| 192 | m_gfx_memory_region(NULL), |
| 193 | m_gfx_num(0), |
| 194 | m_bpp(-1), |
| 195 | m_big(0), |
| 196 | m_djmain_hack(0), |
| 197 | m_k055555_tag(NULL), |
| 193 | 198 | //m_layer_assoc_with_page[K056832_PAGE_COUNT], |
| 194 | 199 | //m_layer_offs[8][2], |
| 195 | 200 | //m_lsram_page[8][2], |
| r31113 | r31114 | |
| 213 | 218 | m_use_ext_linescroll(0), |
| 214 | 219 | m_uses_tile_banks(0), |
| 215 | 220 | m_cur_tile_bank(0), |
| 216 | | m_k055555(0), |
| 221 | m_k055555(NULL), |
| 217 | 222 | m_gfxdecode(*this), |
| 218 | 223 | m_palette(*this) |
| 219 | 224 | { |
| r31113 | r31114 | |
| 240 | 245 | downcast<k056832_device &>(device).m_palette.set_tag(tag); |
| 241 | 246 | } |
| 242 | 247 | |
| 243 | | //------------------------------------------------- |
| 244 | | // device_config_complete - perform any |
| 245 | | // operations now that the configuration is |
| 246 | | // complete |
| 247 | | //------------------------------------------------- |
| 248 | | |
| 249 | | void k056832_device::device_config_complete() |
| 250 | | { |
| 251 | | // inherit a copy of the static data |
| 252 | | const k056832_interface *intf = reinterpret_cast<const k056832_interface *>(static_config()); |
| 253 | | if (intf != NULL) |
| 254 | | *static_cast<k056832_interface *>(this) = *intf; |
| 255 | | |
| 256 | | // or initialize to defaults if none provided |
| 257 | | else |
| 258 | | { |
| 259 | | m_gfx_memory_region = ""; |
| 260 | | m_gfx_num = 0; |
| 261 | | m_bpp = -1; |
| 262 | | m_big = 0; |
| 263 | | m_djmain_hack = 0; |
| 264 | | m_callback = NULL; |
| 265 | | m_k055555_tag = ""; |
| 266 | | }; |
| 267 | | } |
| 268 | | |
| 269 | 248 | void k056832_device::create_tilemaps(running_machine &machine) |
| 270 | 249 | { |
| 271 | 250 | tilemap_t *tmap; |
| r31113 | r31114 | |
| 387 | 366 | memset(m_regs, 0x00, sizeof(m_regs) ); |
| 388 | 367 | memset(m_regsb, 0x00, sizeof(m_regsb) ); |
| 389 | 368 | |
| 390 | | // for non-interface cases we still use the vh_start call |
| 391 | | if (m_bpp == -1) |
| 392 | | return; |
| 369 | if (m_k055555_tag) |
| 370 | m_k055555 = machine().device<k055555_device>(m_k055555_tag); |
| 393 | 371 | |
| 394 | | m_k055555 = machine().device<k055555_device>(m_k055555_tag); |
| 395 | | |
| 396 | 372 | /* TODO: understand which elements MUST be init here (to keep correct layer |
| 397 | 373 | associations) and which ones can can be init at RESET, if any */ |
| 398 | 374 | |
| r31113 | r31114 | |
| 401 | 377 | create_tilemaps(machine()); |
| 402 | 378 | |
| 403 | 379 | finalize_init(machine()); |
| 404 | | |
| 380 | |
| 381 | // bind callbacks |
| 382 | m_k056832_cb.bind_relative_to(*owner()); |
| 405 | 383 | } |
| 406 | 384 | |
| 407 | 385 | /***************************************************************************** |
| r31113 | r31114 | |
| 557 | 535 | color = (attr & smptr->palm1) | (attr >> smptr->pals2 & smptr->palm2); |
| 558 | 536 | flags = TILE_FLIPYX(flip); |
| 559 | 537 | |
| 560 | | m_callback(machine(), layer, &code, &color, &flags); |
| 538 | m_k056832_cb(layer, &code, &color, &flags); |
| 561 | 539 | |
| 562 | 540 | SET_TILE_INFO_MEMBER(m_gfx_num, |
| 563 | 541 | code, |
| r31113 | r31114 | |
| 2185 | 2163 | } |
| 2186 | 2164 | |
| 2187 | 2165 | |
| 2188 | | |
| 2189 | | void k056832_device::altK056832_vh_start(running_machine &machine, const char *gfx_memory_region, int bpp, int big, |
| 2190 | | int (*scrolld)[4][2], |
| 2191 | | void (*callback)(running_machine &machine, int layer, int *code, int *color, int *flags), |
| 2192 | | int djmain_hack) |
| 2193 | | { |
| 2194 | | m_k055555 = 0; |
| 2195 | | m_callback = callback; |
| 2196 | | m_djmain_hack = djmain_hack; |
| 2197 | | |
| 2198 | | create_gfx(machine, gfx_memory_region, bpp, big); |
| 2199 | | |
| 2200 | | create_tilemaps(machine); |
| 2201 | | |
| 2202 | | finalize_init(machine); |
| 2203 | | } |
| 2204 | | |
| 2205 | | |
| 2206 | | |
| 2207 | 2166 | int k056832_device::altK056832_update_linemap(screen_device &screen, bitmap_rgb32 &bitmap, int page, int flags) |
| 2208 | 2167 | { |
| 2209 | 2168 | if (m_page_tile_mode[page]) return(0); |
| r31113 | r31114 | |
| 2614 | 2573 | return(m_layer_association); |
| 2615 | 2574 | } |
| 2616 | 2575 | |
| 2617 | | void k056832_device::K056832_set_k055555(k055555_device * mode) |
| 2618 | | { |
| 2619 | | m_k055555 = mode; |
| 2620 | | } |
trunk/src/mame/video/k054156_k054157_k056832.h
| r31113 | r31114 | |
| 8 | 8 | #include "video/k055555.h"// still needs k055555_get_palette_index |
| 9 | 9 | |
| 10 | 10 | |
| 11 | | typedef void (*k056832_callback)(running_machine &machine, int layer, int *code, int *color, int *flags); |
| 11 | typedef device_delegate<void (int layer, int *code, int *color, int *flags)> k056832_cb_delegate; |
| 12 | #define K056832_CB_MEMBER(_name) void _name(int layer, int *code, int *color, int *flags) |
| 12 | 13 | |
| 14 | #define MCFG_K056832_CB(_class, _method) \ |
| 15 | k056832_device::set_k056832_callback(*device, k056832_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); |
| 13 | 16 | |
| 17 | #define MCFG_K056832_CONFIG(_gfx_reg, _gfx_num, _bpp, _big, _djmain_hack, _k055555) \ |
| 18 | k056832_device::set_config(*device, _gfx_reg, _gfx_num, _bpp, _big, _djmain_hack, _k055555); |
| 19 | |
| 20 | |
| 21 | |
| 14 | 22 | #define MCFG_K056832_ADD(_tag, _interface) \ |
| 15 | 23 | MCFG_DEVICE_ADD(_tag, K056832, 0) \ |
| 16 | 24 | MCFG_DEVICE_CONFIG(_interface) |
| r31113 | r31114 | |
| 21 | 29 | |
| 22 | 30 | struct k056832_interface |
| 23 | 31 | { |
| 24 | | const char *m_gfx_memory_region; |
| 25 | | int m_gfx_num; |
| 26 | | int m_bpp; |
| 27 | | int m_big; |
| 28 | | int m_djmain_hack; |
| 29 | | k056832_callback m_callback; |
| 30 | | |
| 31 | | const char *m_k055555_tag; // tbyahhoo uses the k056832 together with a k055555 |
| 32 | 32 | }; |
| 33 | 33 | |
| 34 | 34 | |
| r31113 | r31114 | |
| 58 | 58 | m_k055555 = 0; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | static void set_k056832_callback(device_t &device, k056832_cb_delegate callback) { downcast<k056832_device &>(device).m_k056832_cb = callback; } |
| 62 | static void set_config(device_t &device, const char *gfx_reg, int gfx_num, int bpp, int big, int djmain_hack, const char *k055555) |
| 63 | { |
| 64 | k056832_device &dev = downcast<k056832_device &>(device); |
| 65 | dev.m_gfx_memory_region = gfx_reg; |
| 66 | dev.m_gfx_num = gfx_num; |
| 67 | dev.m_bpp = bpp; |
| 68 | dev.m_big = big; |
| 69 | dev.m_djmain_hack = djmain_hack; |
| 70 | dev.m_k055555_tag = k055555; |
| 71 | } |
| 72 | |
| 61 | 73 | // static configuration |
| 62 | 74 | static void static_set_gfxdecode_tag(device_t &device, const char *tag); |
| 63 | 75 | static void static_set_palette_tag(device_t &device, const char *tag); |
| r31113 | r31114 | |
| 122 | 134 | |
| 123 | 135 | protected: |
| 124 | 136 | // device-level overrides |
| 125 | | virtual void device_config_complete(); |
| 126 | 137 | virtual void device_start(); |
| 127 | 138 | |
| 128 | 139 | private: |
| r31113 | r31114 | |
| 138 | 149 | int m_num_gfx_banks; // depends on size of graphics ROMs |
| 139 | 150 | int m_cur_gfx_banks; // cached info for K056832_regs[0x1a] |
| 140 | 151 | |
| 152 | k056832_cb_delegate m_k056832_cb; |
| 141 | 153 | |
| 154 | //FIXME: device should be updated to use device_gfx_interface to get rid of most of these! |
| 155 | const char *m_gfx_memory_region; |
| 156 | int m_gfx_num; |
| 157 | int m_bpp; |
| 158 | int m_big; |
| 159 | int m_djmain_hack; |
| 160 | |
| 161 | const char *m_k055555_tag; // tbyahhoo uses the k056832 together with a k055555 |
| 162 | |
| 142 | 163 | |
| 143 | | |
| 144 | | |
| 145 | | |
| 146 | | |
| 147 | | |
| 148 | | |
| 149 | 164 | // ROM readback involves reading 2 halves of a word |
| 150 | 165 | // from the same location in a row. Reading the |
| 151 | 166 | // RAM window resets this state so you get the first half. |
| r31113 | r31114 | |
| 178 | 193 | |
| 179 | 194 | |
| 180 | 195 | |
| 181 | | |
| 182 | | |
| 183 | | |
| 184 | | |
| 185 | 196 | k055555_device *m_k055555; /* used to choose colorbase */ |
| 186 | 197 | |
| 187 | 198 | void get_tile_info( tile_data &tileinfo, int tile_index, int pageIndex ); |
| r31113 | r31114 | |
| 222 | 233 | |
| 223 | 234 | required_device<gfxdecode_device> m_gfxdecode; |
| 224 | 235 | required_device<palette_device> m_palette; |
| 236 | |
| 225 | 237 | public: |
| 238 | void m_tilemap_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority); |
| 226 | 239 | |
| 227 | | // todo: collapse these into above |
| 228 | | void altK056832_vh_start(running_machine &machine, const char *gfx_memory_region, int bpp, int big, |
| 229 | | int (*scrolld)[4][2], |
| 230 | | void (*callback)(running_machine &machine, int layer, int *code, int *color, int *flags), |
| 231 | | int djmain_hack); |
| 232 | | |
| 233 | | void K056832_set_k055555(k055555_device* mode); // k055555 hook |
| 234 | | |
| 235 | | |
| 236 | | void m_tilemap_draw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int num, UINT32 flags, UINT32 priority); |
| 237 | 240 | private: |
| 238 | 241 | int altK056832_update_linemap(screen_device &screen, bitmap_rgb32 &bitmap, int page, int flags); |
| 239 | | |
| 240 | | |
| 241 | 242 | }; |
| 242 | 243 | |
| 243 | 244 | extern const device_type K056832; |
trunk/src/mame/video/mystwarr.c
| r31113 | r31114 | |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | // Mystic Warriors requires tile based blending. |
| 59 | | static void mystwarr_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags) |
| 59 | K056832_CB_MEMBER(mystwarr_state::mystwarr_tile_callback) |
| 60 | 60 | { |
| 61 | | mystwarr_state *state = machine.driver_data<mystwarr_state>(); |
| 62 | | if (layer==1) {if ((*code&0xff00)+(*color)==0x4101) state->m_cbparam++; else state->m_cbparam--;} //* water hack (TEMPORARY) |
| 63 | | |
| 64 | | *color = state->m_layer_colorbase[layer] | (*color>>1 & 0x1e); |
| 61 | if (layer == 1) {if ((*code & 0xff00) + (*color) == 0x4101) m_cbparam++; else m_cbparam--;} //* water hack (TEMPORARY) |
| 62 | *color = m_layer_colorbase[layer] | (*color >> 1 & 0x1e); |
| 65 | 63 | } |
| 66 | 64 | |
| 67 | 65 | // for games with 5bpp tile data |
| 68 | | static void game5bpp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags) |
| 66 | K056832_CB_MEMBER(mystwarr_state::game5bpp_tile_callback) |
| 69 | 67 | { |
| 70 | | mystwarr_state *state = machine.driver_data<mystwarr_state>(); |
| 71 | | *color = state->m_layer_colorbase[layer] | (*color>>1 & 0x1e); |
| 68 | *color = m_layer_colorbase[layer] | (*color >> 1 & 0x1e); |
| 72 | 69 | } |
| 73 | 70 | |
| 74 | 71 | // for games with 4bpp tile data |
| 75 | | static void game4bpp_tile_callback(running_machine &machine, int layer, int *code, int *color, int *flags) |
| 72 | K056832_CB_MEMBER(mystwarr_state::game4bpp_tile_callback) |
| 76 | 73 | { |
| 77 | | mystwarr_state *state = machine.driver_data<mystwarr_state>(); |
| 78 | | *color = state->m_layer_colorbase[layer] | (*color>>2 & 0x0f); |
| 74 | *color = m_layer_colorbase[layer] | (*color >> 2 & 0x0f); |
| 79 | 75 | } |
| 80 | 76 | |
| 81 | 77 | static void mystwarr_sprite_callback(running_machine &machine, int *code, int *color, int *priority) |
| r31113 | r31114 | |
| 160 | 156 | { |
| 161 | 157 | m_gametype = 0; |
| 162 | 158 | |
| 163 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0); |
| 164 | | |
| 165 | 159 | mystwarr_decode_tiles(machine()); |
| 166 | 160 | |
| 167 | 161 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -61, -22, gaiapols_sprite_callback); // stage2 brick walls |
| r31113 | r31114 | |
| 197 | 191 | { |
| 198 | 192 | m_gametype = 1; |
| 199 | 193 | |
| 200 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0); |
| 201 | | |
| 202 | 194 | mystwarr_decode_tiles(machine()); |
| 203 | 195 | |
| 204 | 196 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -42, -22, gaiapols_sprite_callback); |
| r31113 | r31114 | |
| 223 | 215 | { |
| 224 | 216 | m_gametype = 0; |
| 225 | 217 | |
| 226 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, mystwarr_tile_callback, 0); |
| 227 | | |
| 228 | 218 | mystwarr_decode_tiles(machine()); |
| 229 | 219 | |
| 230 | 220 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -48, -24, mystwarr_sprite_callback); |
| r31113 | r31114 | |
| 243 | 233 | { |
| 244 | 234 | m_gametype = 0; |
| 245 | 235 | |
| 246 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0); |
| 247 | | |
| 248 | 236 | mystwarr_decode_tiles(machine()); |
| 249 | 237 | |
| 250 | 238 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -51, -24, metamrph_sprite_callback); |
| r31113 | r31114 | |
| 262 | 250 | { |
| 263 | 251 | m_gametype = 0; |
| 264 | 252 | |
| 265 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game4bpp_tile_callback, 0); |
| 266 | | |
| 267 | 253 | mystwarr_decode_tiles(machine()); |
| 268 | 254 | |
| 269 | 255 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 1, -62, -23, metamrph_sprite_callback); |
| r31113 | r31114 | |
| 280 | 266 | { |
| 281 | 267 | m_gametype = 0; |
| 282 | 268 | |
| 283 | | m_k056832->altK056832_vh_start(machine(), "gfx1", K056832_BPP_5, 0, NULL, game5bpp_tile_callback, 0); |
| 284 | | |
| 285 | 269 | mystwarr_decode_tiles(machine()); |
| 286 | 270 | |
| 287 | 271 | m_k055673->alt_k055673_vh_start(machine(), "gfx2", 0, -58, -23, martchmp_sprite_callback); |