trunk/src/mame/drivers/deco32.c
| r24015 | r24016 | |
| 235 | 235 | #include "includes/deco32.h" |
| 236 | 236 | #include "sound/2151intf.h" |
| 237 | 237 | #include "sound/okim6295.h" |
| 238 | | #include "video/deco16ic.h" |
| 239 | 238 | |
| 240 | 239 | /**********************************************************************************/ |
| 241 | 240 | |
| r24015 | r24016 | |
| 730 | 729 | |
| 731 | 730 | AM_RANGE(0x178000, 0x178003) AM_WRITE(deco32_pri_w) |
| 732 | 731 | |
| 733 | | AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 734 | | AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 735 | | AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) /* Mirror address - bug in program code */ |
| 736 | | AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 732 | AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 733 | AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 734 | AM_RANGE(0x192000, 0x193fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) /* Mirror address - bug in program code */ |
| 735 | AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 737 | 736 | AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") |
| 738 | 737 | AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") |
| 739 | 738 | |
| 740 | | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 741 | | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 742 | | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) // unused |
| 739 | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 740 | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 741 | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused |
| 743 | 742 | AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") |
| 744 | 743 | AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused |
| 745 | 744 | ADDRESS_MAP_END |
| r24015 | r24016 | |
| 761 | 760 | AM_RANGE(0x178000, 0x179fff) AM_READWRITE(deco32_spriteram_r, deco32_spriteram_w) |
| 762 | 761 | AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w) |
| 763 | 762 | |
| 764 | | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 765 | | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 763 | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 764 | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 766 | 765 | AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") |
| 767 | 766 | AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") |
| 768 | | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 767 | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 769 | 768 | |
| 770 | | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 771 | | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 769 | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 770 | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 772 | 771 | AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") |
| 773 | 772 | AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") |
| 774 | | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 773 | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 775 | 774 | |
| 776 | 775 | AM_RANGE(0x16c000, 0x16c01f) AM_READNOP |
| 777 | 776 | AM_RANGE(0x17c000, 0x17c03f) AM_READNOP |
| r24015 | r24016 | |
| 794 | 793 | AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram_w) |
| 795 | 794 | AM_RANGE(0x17c020, 0x17c023) AM_READNOP |
| 796 | 795 | |
| 797 | | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 798 | | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 796 | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 797 | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 799 | 798 | AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") |
| 800 | 799 | AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") |
| 801 | | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 800 | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 802 | 801 | |
| 803 | | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 804 | | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 802 | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 803 | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 805 | 804 | AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") |
| 806 | 805 | AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") |
| 807 | | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 806 | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 808 | 807 | |
| 809 | 808 | AM_RANGE(0x200000, 0x200fff) AM_READWRITE_LEGACY(deco16_146_fghthist_prot_r, deco16_146_fghthist_prot_w) AM_SHARE("prot32ram") |
| 810 | 809 | ADDRESS_MAP_END |
| r24015 | r24016 | |
| 821 | 820 | AM_RANGE(0x138000, 0x138003) AM_NOP /* Palette dma complete in bit 0x8? ack? return 0 else tight loop */ |
| 822 | 821 | AM_RANGE(0x138008, 0x13800b) AM_WRITE(deco32_palette_dma_w) |
| 823 | 822 | |
| 824 | | AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 825 | | AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 826 | | AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 823 | AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 824 | AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 825 | AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 827 | 826 | AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") |
| 828 | 827 | AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") |
| 829 | 828 | |
| 830 | | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 831 | | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 832 | | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) // unused |
| 829 | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 830 | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 831 | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused |
| 833 | 832 | AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") |
| 834 | 833 | AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused |
| 835 | 834 | |
| r24015 | r24016 | |
| 872 | 871 | AM_RANGE(0x170000, 0x170007) AM_READ(lockload_gun_mirror_r) /* Not on Dragongun */ |
| 873 | 872 | AM_RANGE(0x178008, 0x17800f) AM_WRITENOP /* Gun read ACK's */ |
| 874 | 873 | |
| 875 | | AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 876 | | AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 877 | | AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 874 | AM_RANGE(0x180000, 0x18001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 875 | AM_RANGE(0x190000, 0x191fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 876 | AM_RANGE(0x194000, 0x195fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 878 | 877 | AM_RANGE(0x1a0000, 0x1a3fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") |
| 879 | 878 | AM_RANGE(0x1a4000, 0x1a5fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") |
| 880 | 879 | |
| 881 | | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 882 | | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 883 | | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) // unused |
| 880 | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 881 | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 882 | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) // unused |
| 884 | 883 | AM_RANGE(0x1e0000, 0x1e3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") |
| 885 | 884 | AM_RANGE(0x1e4000, 0x1e5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") // unused |
| 886 | 885 | |
| r24015 | r24016 | |
| 934 | 933 | AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram2_w) |
| 935 | 934 | AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */ |
| 936 | 935 | |
| 937 | | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 938 | | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 936 | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 937 | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 939 | 938 | AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") |
| 940 | 939 | AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") |
| 941 | | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 940 | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 942 | 941 | |
| 943 | | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 944 | | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 942 | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 943 | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 945 | 944 | AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") |
| 946 | 945 | AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") |
| 947 | | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 946 | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 948 | 947 | |
| 949 | 948 | AM_RANGE(0x200000, 0x200fff) AM_READWRITE(tattass_prot_r, tattass_prot_w) AM_SHARE("prot32ram") |
| 950 | 949 | ADDRESS_MAP_END |
| r24015 | r24016 | |
| 975 | 974 | AM_RANGE(0x17c010, 0x17c013) AM_WRITE(deco32_buffer_spriteram2_w) |
| 976 | 975 | AM_RANGE(0x17c018, 0x17c01b) AM_WRITENOP /* Sprite 'CPU' (unused) */ |
| 977 | 976 | |
| 978 | | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 979 | | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 977 | AM_RANGE(0x182000, 0x183fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 978 | AM_RANGE(0x184000, 0x185fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 980 | 979 | AM_RANGE(0x192000, 0x193fff) AM_RAM_WRITE(deco32_pf1_rowscroll_w) AM_SHARE("pf1_rowscroll32") |
| 981 | 980 | AM_RANGE(0x194000, 0x195fff) AM_RAM_WRITE(deco32_pf2_rowscroll_w) AM_SHARE("pf2_rowscroll32") |
| 982 | | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 981 | AM_RANGE(0x1a0000, 0x1a001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 983 | 982 | |
| 984 | | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 985 | | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 983 | AM_RANGE(0x1c2000, 0x1c3fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 984 | AM_RANGE(0x1c4000, 0x1c5fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 986 | 985 | AM_RANGE(0x1d2000, 0x1d3fff) AM_RAM_WRITE(deco32_pf3_rowscroll_w) AM_SHARE("pf3_rowscroll32") |
| 987 | 986 | AM_RANGE(0x1d4000, 0x1d5fff) AM_RAM_WRITE(deco32_pf4_rowscroll_w) AM_SHARE("pf4_rowscroll32") |
| 988 | | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 987 | AM_RANGE(0x1e0000, 0x1e001f) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 989 | 988 | |
| 990 | 989 | AM_RANGE(0x200000, 0x200fff) AM_READWRITE(nslasher_prot_r, nslasher_prot_w) AM_SHARE("prot32ram") |
| 991 | 990 | ADDRESS_MAP_END |
trunk/src/mame/drivers/cninja.c
| r24015 | r24016 | |
| 50 | 50 | #include "sound/2203intf.h" |
| 51 | 51 | #include "sound/2151intf.h" |
| 52 | 52 | #include "sound/okim6295.h" |
| 53 | | #include "video/deco16ic.h" |
| 54 | 53 | #include "video/decocomn.h" |
| 55 | 54 | |
| 56 | 55 | WRITE16_MEMBER(cninja_state::cninja_sound_w) |
| r24015 | r24016 | |
| 148 | 147 | WRITE16_MEMBER(cninja_state::cninja_pf12_control_w) |
| 149 | 148 | { |
| 150 | 149 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); |
| 151 | | deco16ic_pf_control_w(m_deco_tilegen1, space, offset, data, mem_mask); |
| 150 | m_deco_tilegen1->pf_control_w(space, offset, data, mem_mask); |
| 152 | 151 | } |
| 153 | 152 | |
| 154 | 153 | |
| 155 | 154 | WRITE16_MEMBER(cninja_state::cninja_pf34_control_w) |
| 156 | 155 | { |
| 157 | 156 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); |
| 158 | | deco16ic_pf_control_w(m_deco_tilegen2, space, offset, data, mem_mask); |
| 157 | m_deco_tilegen2->pf_control_w(space, offset, data, mem_mask); |
| 159 | 158 | } |
| 160 | 159 | |
| 161 | 160 | |
| r24015 | r24016 | |
| 163 | 162 | AM_RANGE(0x000000, 0x0bffff) AM_ROM |
| 164 | 163 | |
| 165 | 164 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) |
| 166 | | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 167 | | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 165 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 166 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 168 | 167 | AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_SHARE("pf1_rowscroll") |
| 169 | 168 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll") |
| 170 | 169 | |
| 171 | 170 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) |
| 172 | | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 173 | | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 171 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 172 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 174 | 173 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll") |
| 175 | 174 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll") |
| 176 | 175 | |
| r24015 | r24016 | |
| 192 | 191 | AM_RANGE(0x138000, 0x1387ff) AM_RAM AM_SHARE("spriteram") /* bootleg sprite-ram (sprites rewritten here in new format) */ |
| 193 | 192 | |
| 194 | 193 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) |
| 195 | | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 196 | | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 194 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 195 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 197 | 196 | AM_RANGE(0x14c000, 0x14c7ff) AM_WRITEONLY AM_SHARE("pf1_rowscroll") |
| 198 | 197 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll") |
| 199 | 198 | |
| 200 | 199 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) // not used / incorrect on this |
| 201 | | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 202 | | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 200 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 201 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 203 | 202 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll") |
| 204 | 203 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll") |
| 205 | 204 | |
| r24015 | r24016 | |
| 220 | 219 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 221 | 220 | |
| 222 | 221 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) |
| 223 | | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 224 | | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 222 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 223 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 225 | 224 | AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_SHARE("pf1_rowscroll") |
| 226 | 225 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll") |
| 227 | 226 | |
| 228 | 227 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) |
| 229 | | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 230 | | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 228 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 229 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 231 | 230 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll") |
| 232 | 231 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll") |
| 233 | 232 | |
| r24015 | r24016 | |
| 248 | 247 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 249 | 248 | |
| 250 | 249 | AM_RANGE(0x140000, 0x14000f) AM_WRITE(cninja_pf12_control_w) |
| 251 | | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 252 | | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 250 | AM_RANGE(0x144000, 0x144fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 251 | AM_RANGE(0x146000, 0x146fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 253 | 252 | AM_RANGE(0x14c000, 0x14c7ff) AM_RAM AM_SHARE("pf1_rowscroll") |
| 254 | 253 | AM_RANGE(0x14e000, 0x14e7ff) AM_RAM AM_SHARE("pf2_rowscroll") |
| 255 | 254 | |
| 256 | 255 | AM_RANGE(0x150000, 0x15000f) AM_WRITE(cninja_pf34_control_w) |
| 257 | | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 258 | | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 256 | AM_RANGE(0x154000, 0x154fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 257 | AM_RANGE(0x156000, 0x156fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 259 | 258 | AM_RANGE(0x15c000, 0x15c7ff) AM_RAM AM_SHARE("pf3_rowscroll") |
| 260 | 259 | AM_RANGE(0x15e000, 0x15e7ff) AM_RAM AM_SHARE("pf4_rowscroll") |
| 261 | 260 | |
| r24015 | r24016 | |
| 284 | 283 | AM_RANGE(0x1e0000, 0x1e0001) AM_DEVWRITE("spriteram2", buffered_spriteram16_device, write) |
| 285 | 284 | |
| 286 | 285 | AM_RANGE(0x300000, 0x30000f) AM_WRITE(cninja_pf12_control_w) |
| 287 | | AM_RANGE(0x304000, 0x305fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 288 | | AM_RANGE(0x306000, 0x307fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 286 | AM_RANGE(0x304000, 0x305fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 287 | AM_RANGE(0x306000, 0x307fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 289 | 288 | AM_RANGE(0x308000, 0x3087ff) AM_RAM AM_SHARE("pf1_rowscroll") |
| 290 | 289 | AM_RANGE(0x30a000, 0x30a7ff) AM_RAM AM_SHARE("pf2_rowscroll") |
| 291 | 290 | |
| 292 | 291 | AM_RANGE(0x310000, 0x31000f) AM_WRITE(cninja_pf34_control_w) |
| 293 | | AM_RANGE(0x314000, 0x315fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 294 | | AM_RANGE(0x316000, 0x317fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 292 | AM_RANGE(0x314000, 0x315fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 293 | AM_RANGE(0x316000, 0x317fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 295 | 294 | AM_RANGE(0x318000, 0x3187ff) AM_RAM AM_SHARE("pf3_rowscroll") |
| 296 | 295 | AM_RANGE(0x31a000, 0x31a7ff) AM_RAM AM_SHARE("pf4_rowscroll") |
| 297 | 296 | |
trunk/src/mame/drivers/simpl156.c
| r24015 | r24016 | |
| 94 | 94 | #include "includes/simpl156.h" |
| 95 | 95 | #include "machine/eeprom.h" |
| 96 | 96 | #include "sound/okim6295.h" |
| 97 | | #include "video/deco16ic.h" |
| 98 | 97 | |
| 99 | 98 | static INPUT_PORTS_START( simpl156 ) |
| 100 | 99 | PORT_START("IN0") |
| r24015 | r24016 | |
| 243 | 242 | AM_RANGE(0x110000, 0x111fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) |
| 244 | 243 | AM_RANGE(0x120000, 0x120fff) AM_READWRITE(simpl156_palette_r, simpl156_palette_w) |
| 245 | 244 | AM_RANGE(0x130000, 0x130003) AM_READWRITE(simpl156_system_r, simpl156_eeprom_w) |
| 246 | | AM_RANGE(0x140000, 0x14001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 247 | | AM_RANGE(0x150000, 0x151fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 248 | | AM_RANGE(0x152000, 0x153fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 249 | | AM_RANGE(0x154000, 0x155fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 245 | AM_RANGE(0x140000, 0x14001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 246 | AM_RANGE(0x150000, 0x151fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 247 | AM_RANGE(0x152000, 0x153fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 248 | AM_RANGE(0x154000, 0x155fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 250 | 249 | AM_RANGE(0x160000, 0x161fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 251 | 250 | AM_RANGE(0x164000, 0x165fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 252 | 251 | AM_RANGE(0x170000, 0x170003) AM_READONLY AM_WRITENOP // ? |
| r24015 | r24016 | |
| 267 | 266 | AM_RANGE(0x410000, 0x411fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) |
| 268 | 267 | AM_RANGE(0x420000, 0x420fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 269 | 268 | AM_RANGE(0x430000, 0x430003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 270 | | AM_RANGE(0x440000, 0x44001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 271 | | AM_RANGE(0x450000, 0x451fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 272 | | AM_RANGE(0x452000, 0x453fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 273 | | AM_RANGE(0x454000, 0x455fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 269 | AM_RANGE(0x440000, 0x44001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 270 | AM_RANGE(0x450000, 0x451fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 271 | AM_RANGE(0x452000, 0x453fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 272 | AM_RANGE(0x454000, 0x455fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 274 | 273 | AM_RANGE(0x460000, 0x461fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 275 | 274 | AM_RANGE(0x464000, 0x465fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 276 | 275 | AM_RANGE(0x470000, 0x470003) AM_READONLY AM_WRITENOP // ?? |
| r24015 | r24016 | |
| 288 | 287 | AM_RANGE(0x390000, 0x391fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) |
| 289 | 288 | AM_RANGE(0x3a0000, 0x3a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 290 | 289 | AM_RANGE(0x3b0000, 0x3b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 291 | | AM_RANGE(0x3c0000, 0x3c001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 292 | | AM_RANGE(0x3d0000, 0x3d1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 293 | | AM_RANGE(0x3d2000, 0x3d3fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 294 | | AM_RANGE(0x3d4000, 0x3d5fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 290 | AM_RANGE(0x3c0000, 0x3c001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 291 | AM_RANGE(0x3d0000, 0x3d1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 292 | AM_RANGE(0x3d2000, 0x3d3fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 293 | AM_RANGE(0x3d4000, 0x3d5fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 295 | 294 | AM_RANGE(0x3e0000, 0x3e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 296 | 295 | AM_RANGE(0x3e4000, 0x3e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 297 | 296 | AM_RANGE(0x3f0000, 0x3f0003) AM_READONLY AM_WRITENOP //? |
| r24015 | r24016 | |
| 309 | 308 | AM_RANGE(0x690000, 0x691fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) |
| 310 | 309 | AM_RANGE(0x6a0000, 0x6a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 311 | 310 | AM_RANGE(0x6b0000, 0x6b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 312 | | AM_RANGE(0x6c0000, 0x6c001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 313 | | AM_RANGE(0x6d0000, 0x6d1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 314 | | AM_RANGE(0x6d2000, 0x6d3fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 315 | | AM_RANGE(0x6d4000, 0x6d5fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 311 | AM_RANGE(0x6c0000, 0x6c001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 312 | AM_RANGE(0x6d0000, 0x6d1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 313 | AM_RANGE(0x6d2000, 0x6d3fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 314 | AM_RANGE(0x6d4000, 0x6d5fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 316 | 315 | AM_RANGE(0x6e0000, 0x6e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 317 | 316 | AM_RANGE(0x6e4000, 0x6e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 318 | 317 | AM_RANGE(0x6f0000, 0x6f0003) AM_READONLY AM_WRITENOP // ? |
| r24015 | r24016 | |
| 329 | 328 | AM_RANGE(0x190000, 0x191fff) AM_READWRITE(simpl156_spriteram_r, simpl156_spriteram_w) |
| 330 | 329 | AM_RANGE(0x1a0000, 0x1a0fff) AM_READWRITE(simpl156_palette_r,simpl156_palette_w) |
| 331 | 330 | AM_RANGE(0x1b0000, 0x1b0003) AM_READWRITE(simpl156_system_r,simpl156_eeprom_w) |
| 332 | | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf_control_dword_r, deco16ic_pf_control_dword_w) |
| 333 | | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 334 | | AM_RANGE(0x1d2000, 0x1d3fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_dword_r, deco16ic_pf1_data_dword_w) |
| 335 | | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_dword_r, deco16ic_pf2_data_dword_w) |
| 331 | AM_RANGE(0x1c0000, 0x1c001f) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf_control_dword_r, pf_control_dword_w) |
| 332 | AM_RANGE(0x1d0000, 0x1d1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 333 | AM_RANGE(0x1d2000, 0x1d3fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_dword_r, pf1_data_dword_w) |
| 334 | AM_RANGE(0x1d4000, 0x1d5fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_dword_r, pf2_data_dword_w) |
| 336 | 335 | AM_RANGE(0x1e0000, 0x1e1fff) AM_READWRITE(simpl156_pf1_rowscroll_r, simpl156_pf1_rowscroll_w) |
| 337 | 336 | AM_RANGE(0x1e4000, 0x1e5fff) AM_READWRITE(simpl156_pf2_rowscroll_r, simpl156_pf2_rowscroll_w) |
| 338 | 337 | AM_RANGE(0x1f0000, 0x1f0003) AM_READONLY AM_WRITENOP // ? |
trunk/src/mame/drivers/rohga.c
| r24015 | r24016 | |
| 133 | 133 | static ADDRESS_MAP_START( rohga_map, AS_PROGRAM, 16, rohga_state ) |
| 134 | 134 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 135 | 135 | |
| 136 | | AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w) |
| 137 | | AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w) |
| 136 | AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w) |
| 137 | AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w) |
| 138 | 138 | |
| 139 | 139 | AM_RANGE(0x280000, 0x2807ff) AM_MIRROR(0x800) AM_READWRITE_LEGACY(deco16_104_rohga_prot_r,deco16_104_rohga_prot_w) AM_SHARE("prot16ram") /* Protection device */ |
| 140 | 140 | |
| r24015 | r24016 | |
| 147 | 147 | AM_RANGE(0x322000, 0x322001) AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w) |
| 148 | 148 | AM_RANGE(0x321100, 0x321101) AM_READ(rohga_irq_ack_r) /* Irq ack? Value not used */ |
| 149 | 149 | |
| 150 | | AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 151 | | AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 152 | | AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 153 | | AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 150 | AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 151 | AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 152 | AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 153 | AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 154 | 154 | |
| 155 | 155 | AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf1_rowscroll") |
| 156 | 156 | AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf2_rowscroll") |
| r24015 | r24016 | |
| 165 | 165 | static ADDRESS_MAP_START( wizdfire_map, AS_PROGRAM, 16, rohga_state ) |
| 166 | 166 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 167 | 167 | |
| 168 | | AM_RANGE(0x200000, 0x200fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 169 | | AM_RANGE(0x202000, 0x202fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 170 | | AM_RANGE(0x208000, 0x208fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 171 | | AM_RANGE(0x20a000, 0x20afff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 168 | AM_RANGE(0x200000, 0x200fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 169 | AM_RANGE(0x202000, 0x202fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 170 | AM_RANGE(0x208000, 0x208fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 171 | AM_RANGE(0x20a000, 0x20afff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 172 | 172 | |
| 173 | 173 | AM_RANGE(0x20b000, 0x20b3ff) AM_WRITEONLY /* ? Always 0 written */ |
| 174 | 174 | AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_SHARE("pf3_rowscroll") |
| 175 | 175 | AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_SHARE("pf4_rowscroll") |
| 176 | 176 | |
| 177 | | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w) |
| 178 | | AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w) |
| 177 | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w) |
| 178 | AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w) |
| 179 | 179 | |
| 180 | 180 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w) /* Priority */ |
| 181 | 181 | AM_RANGE(0x320002, 0x320003) AM_WRITENOP /* ? */ |
| r24015 | r24016 | |
| 196 | 196 | static ADDRESS_MAP_START( nitrobal_map, AS_PROGRAM, 16, rohga_state ) |
| 197 | 197 | AM_RANGE(0x000000, 0x1fffff) AM_ROM |
| 198 | 198 | |
| 199 | | AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 200 | | AM_RANGE(0x202000, 0x2027ff) AM_MIRROR(0x800) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 201 | | AM_RANGE(0x208000, 0x2087ff) AM_MIRROR(0x800) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 202 | | AM_RANGE(0x20a000, 0x20a7ff) AM_MIRROR(0x800) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 199 | AM_RANGE(0x200000, 0x200fff) AM_MIRROR(0x1000) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 200 | AM_RANGE(0x202000, 0x2027ff) AM_MIRROR(0x800) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 201 | AM_RANGE(0x208000, 0x2087ff) AM_MIRROR(0x800) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 202 | AM_RANGE(0x20a000, 0x20a7ff) AM_MIRROR(0x800) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 203 | 203 | |
| 204 | 204 | AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_SHARE("pf1_rowscroll") |
| 205 | 205 | AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_SHARE("pf2_rowscroll") |
| 206 | 206 | AM_RANGE(0x20c000, 0x20c7ff) AM_RAM AM_SHARE("pf3_rowscroll") |
| 207 | 207 | AM_RANGE(0x20e000, 0x20e7ff) AM_RAM AM_SHARE("pf4_rowscroll") |
| 208 | 208 | |
| 209 | | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w) |
| 210 | | AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w) |
| 209 | AM_RANGE(0x300000, 0x30000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w) |
| 210 | AM_RANGE(0x310000, 0x31000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w) |
| 211 | 211 | |
| 212 | 212 | AM_RANGE(0x320000, 0x320001) AM_READ_PORT("DSW3") AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w) /* Priority */ |
| 213 | 213 | AM_RANGE(0x320002, 0x320003) AM_WRITENOP /* ? */ |
| r24015 | r24016 | |
| 228 | 228 | |
| 229 | 229 | static ADDRESS_MAP_START( schmeisr_map, AS_PROGRAM, 16, rohga_state ) |
| 230 | 230 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 231 | | AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE_LEGACY("tilegen1", deco16ic_pf_control_w) |
| 232 | | AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE_LEGACY("tilegen2", deco16ic_pf_control_w) |
| 231 | AM_RANGE(0x200000, 0x20000f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w) |
| 232 | AM_RANGE(0x240000, 0x24000f) AM_DEVWRITE("tilegen2", deco16ic_device, pf_control_w) |
| 233 | 233 | AM_RANGE(0x280000, 0x2807ff) AM_MIRROR(0x800) AM_READWRITE_LEGACY(deco16_104_rohga_prot_r,deco16_104_rohga_prot_w) AM_SHARE("prot16ram") /* Protection device */ |
| 234 | 234 | |
| 235 | 235 | AM_RANGE(0x2c0000, 0x2c0001) AM_READ_PORT("DSW3") |
| r24015 | r24016 | |
| 241 | 241 | AM_RANGE(0x322000, 0x322001) AM_DEVWRITE_LEGACY("deco_common", decocomn_priority_w) |
| 242 | 242 | AM_RANGE(0x321100, 0x321101) AM_WRITE(wizdfire_irq_ack_w) /* Irq ack? Value not used */ |
| 243 | 243 | |
| 244 | | AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 245 | | AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE_LEGACY("tilegen1", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 246 | | AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf1_data_r, deco16ic_pf1_data_w) |
| 247 | | AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE_LEGACY("tilegen2", deco16ic_pf2_data_r, deco16ic_pf2_data_w) |
| 244 | AM_RANGE(0x3c0000, 0x3c1fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf1_data_r, pf1_data_w) |
| 245 | AM_RANGE(0x3c2000, 0x3c2fff) AM_DEVREADWRITE("tilegen1", deco16ic_device, pf2_data_r, pf2_data_w) |
| 246 | AM_RANGE(0x3c4000, 0x3c4fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf1_data_r, pf1_data_w) |
| 247 | AM_RANGE(0x3c6000, 0x3c6fff) AM_DEVREADWRITE("tilegen2", deco16ic_device, pf2_data_r, pf2_data_w) |
| 248 | 248 | AM_RANGE(0x3c8000, 0x3c8fff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf1_rowscroll") |
| 249 | 249 | AM_RANGE(0x3ca000, 0x3cafff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf2_rowscroll") |
| 250 | 250 | AM_RANGE(0x3cc000, 0x3ccfff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("pf3_rowscroll") |
trunk/src/mame/video/cninja.c
| r24015 | r24016 | |
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | | #include "video/deco16ic.h" |
| 9 | 8 | #include "includes/cninja.h" |
| 10 | 9 | #include "video/decocomn.h" |
| 11 | 10 | |
| r24015 | r24016 | |
| 14 | 13 | VIDEO_START_MEMBER(cninja_state,stoneage) |
| 15 | 14 | { |
| 16 | 15 | /* The bootleg has broken scroll registers */ |
| 17 | | deco16ic_set_scrolldx(m_deco_tilegen1, 3, 0, -10, -10); /* pf4 16x16 tilemap */ |
| 18 | | deco16ic_set_scrolldx(m_deco_tilegen1, 1, 0, -10, -10); /* pf2 16x16 tilemap */ |
| 19 | | deco16ic_set_scrolldx(m_deco_tilegen1, 0, 1, 2, 2); /* pf1 8x8 tilemap */ |
| 16 | m_deco_tilegen1->set_scrolldx(3, 0, -10, -10); /* pf4 16x16 tilemap */ |
| 17 | m_deco_tilegen1->set_scrolldx(1, 0, -10, -10); /* pf2 16x16 tilemap */ |
| 18 | m_deco_tilegen1->set_scrolldx(0, 1, 2, 2); /* pf1 8x8 tilemap */ |
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | /******************************************************************************/ |
| r24015 | r24016 | |
| 124 | 123 | UINT32 cninja_state::screen_update_cninja(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 125 | 124 | { |
| 126 | 125 | address_space &space = machine().driver_data()->generic_space(); |
| 127 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 126 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 128 | 127 | |
| 129 | 128 | flip_screen_set(BIT(flip, 7)); |
| 130 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 131 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 129 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 130 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 132 | 131 | |
| 133 | 132 | /* Draw playfields */ |
| 134 | 133 | machine().priority_bitmap.fill(0, cliprect); |
| 135 | 134 | bitmap.fill(512, cliprect); |
| 136 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 137 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 138 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); |
| 139 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); |
| 135 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 136 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 137 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); |
| 138 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); |
| 140 | 139 | m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); |
| 141 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 140 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 142 | 141 | return 0; |
| 143 | 142 | } |
| 144 | 143 | |
| 145 | 144 | UINT32 cninja_state::screen_update_cninjabl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 146 | 145 | { |
| 147 | 146 | address_space &space = machine().driver_data()->generic_space(); |
| 148 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 147 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 149 | 148 | |
| 150 | 149 | /* force layers to be enabled */ |
| 151 | | deco16ic_set_enable(m_deco_tilegen2, 0, 1 ); |
| 152 | | deco16ic_set_enable(m_deco_tilegen2, 1, 1 ); |
| 150 | m_deco_tilegen2->set_enable(0, 1 ); |
| 151 | m_deco_tilegen2->set_enable(1, 1 ); |
| 153 | 152 | |
| 154 | 153 | flip_screen_set(BIT(flip, 7)); |
| 155 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 156 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 154 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 155 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 157 | 156 | |
| 158 | 157 | /* Draw playfields */ |
| 159 | 158 | machine().priority_bitmap.fill(0, cliprect); |
| 160 | 159 | bitmap.fill(512, cliprect); |
| 161 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 162 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 163 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); |
| 164 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); |
| 160 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 161 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 162 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 2); |
| 163 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 4); |
| 165 | 164 | cninjabl_draw_sprites(bitmap, cliprect); |
| 166 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 165 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 167 | 166 | return 0; |
| 168 | 167 | } |
| 169 | 168 | |
| 170 | 169 | UINT32 cninja_state::screen_update_edrandy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 171 | 170 | { |
| 172 | 171 | address_space &space = machine().driver_data()->generic_space(); |
| 173 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 172 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 174 | 173 | |
| 175 | 174 | flip_screen_set(BIT(flip, 7)); |
| 176 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 177 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 175 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 176 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 178 | 177 | |
| 179 | 178 | machine().priority_bitmap.fill(0, cliprect); |
| 180 | 179 | bitmap.fill(0, cliprect); |
| 181 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 182 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 183 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 180 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 181 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 182 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4); |
| 184 | 183 | m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); |
| 185 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 184 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 186 | 185 | return 0; |
| 187 | 186 | } |
| 188 | 187 | |
| 189 | 188 | UINT32 cninja_state::screen_update_robocop2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 190 | 189 | { |
| 191 | 190 | address_space &space = machine().driver_data()->generic_space(); |
| 192 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 191 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 193 | 192 | UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff); |
| 194 | 193 | |
| 195 | 194 | /* One of the tilemap chips can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */ |
| 196 | 195 | if (priority & 4) |
| 197 | 196 | { |
| 198 | | deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 2, 0); |
| 199 | | deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 3, 0); |
| 200 | | deco16ic_pf12_set_gfxbank(m_deco_tilegen2, 0, 4); |
| 197 | m_deco_tilegen1->set_tilemap_colour_mask(2, 0); |
| 198 | m_deco_tilegen1->set_tilemap_colour_mask(3, 0); |
| 199 | m_deco_tilegen2->pf12_set_gfxbank(0, 4); |
| 201 | 200 | } |
| 202 | 201 | else |
| 203 | 202 | { |
| 204 | | deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 2, 0xf); |
| 205 | | deco16ic_set_tilemap_colour_mask(m_deco_tilegen1, 3, 0xf); |
| 206 | | deco16ic_pf12_set_gfxbank(m_deco_tilegen2, 0, 2); |
| 203 | m_deco_tilegen1->set_tilemap_colour_mask(2, 0xf); |
| 204 | m_deco_tilegen1->set_tilemap_colour_mask(3, 0xf); |
| 205 | m_deco_tilegen2->pf12_set_gfxbank(0, 2); |
| 207 | 206 | } |
| 208 | 207 | |
| 209 | 208 | /* Update playfields */ |
| 210 | 209 | flip_screen_set(BIT(flip, 7)); |
| 211 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 212 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 210 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 211 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 213 | 212 | |
| 214 | 213 | /* Draw playfields */ |
| 215 | 214 | machine().priority_bitmap.fill(0, cliprect); |
| 216 | 215 | bitmap.fill(0x200, cliprect); |
| 217 | 216 | |
| 218 | 217 | if ((priority & 4) == 0) |
| 219 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 218 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 220 | 219 | |
| 221 | 220 | /* Switchable priority */ |
| 222 | 221 | switch (priority & 0x8) |
| 223 | 222 | { |
| 224 | 223 | case 8: |
| 225 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 226 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 224 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2); |
| 225 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4); |
| 227 | 226 | break; |
| 228 | 227 | default: |
| 229 | 228 | case 0: |
| 230 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 231 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 229 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 230 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4); |
| 232 | 231 | break; |
| 233 | 232 | } |
| 234 | 233 | |
| 235 | 234 | m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400); |
| 236 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 235 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 237 | 236 | return 0; |
| 238 | 237 | } |
| 239 | 238 | |
| r24015 | r24016 | |
| 246 | 245 | UINT32 cninja_state::screen_update_mutantf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 247 | 246 | { |
| 248 | 247 | address_space &space = machine().driver_data()->generic_space(); |
| 249 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 248 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 250 | 249 | UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff); |
| 251 | 250 | |
| 252 | 251 | |
| 253 | 252 | flip_screen_set(BIT(flip, 7)); |
| 254 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 255 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 253 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 254 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 256 | 255 | |
| 257 | 256 | /* Draw playfields */ |
| 258 | 257 | bitmap.fill(0x400, cliprect); /* Confirmed */ |
| r24015 | r24016 | |
| 274 | 273 | The other bits may control alpha blend on the 2nd sprite chip, or |
| 275 | 274 | layer order. |
| 276 | 275 | */ |
| 277 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 278 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 279 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0); |
| 276 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 277 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0); |
| 278 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 280 | 279 | |
| 281 | 280 | |
| 282 | 281 | if (priority & 1) |
| r24015 | r24016 | |
| 289 | 288 | m_sprgen2->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 1024+768, 0x0ff, 0x80); // fixed alpha of 0x80 for this layer? |
| 290 | 289 | m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x100, 0x1ff); |
| 291 | 290 | } |
| 292 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 291 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 293 | 292 | return 0; |
| 294 | 293 | } |
trunk/src/mame/video/deco32.c
| r24015 | r24016 | |
| 1 | 1 | #include "emu.h" |
| 2 | 2 | #include "includes/deco32.h" |
| 3 | | #include "video/deco16ic.h" |
| 4 | 3 | |
| 5 | 4 | /******************************************************************************/ |
| 6 | 5 | |
| r24015 | r24016 | |
| 573 | 572 | machine().priority_bitmap.fill(0, cliprect); |
| 574 | 573 | bitmap.fill(machine().pens[0x000], cliprect); // Palette index not confirmed |
| 575 | 574 | |
| 576 | | deco16ic_set_pf1_8bpp_mode(m_deco_tilegen2, 1); |
| 575 | m_deco_tilegen2->set_pf1_8bpp_mode(1); |
| 577 | 576 | |
| 578 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 579 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 577 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 578 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 580 | 579 | |
| 581 | 580 | // pf4 not used (because pf3 is in 8bpp mode) |
| 582 | 581 | |
| 583 | 582 | if ((m_pri&1)==0) |
| 584 | 583 | { |
| 585 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1); |
| 586 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 584 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 1); |
| 585 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2); |
| 587 | 586 | } |
| 588 | 587 | else |
| 589 | 588 | { |
| 590 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 1); |
| 591 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 589 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 1); |
| 590 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 592 | 591 | } |
| 593 | 592 | |
| 594 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 593 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 4); |
| 595 | 594 | |
| 596 | 595 | m_sprgen->set_alt_format(true); |
| 597 | 596 | m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x400); |
| r24015 | r24016 | |
| 603 | 602 | { |
| 604 | 603 | bitmap.fill(get_black_pen(machine()), cliprect); |
| 605 | 604 | |
| 606 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 607 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 605 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 606 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 608 | 607 | |
| 609 | | //deco16ic_set_pf3_8bpp_mode(m_deco_tilegen1, 1); // despite being 8bpp this doesn't require the same shifting as captaven, why not? |
| 608 | //m_deco_tilegen1->set_pf3_8bpp_mode(1); // despite being 8bpp this doesn't require the same shifting as captaven, why not? |
| 610 | 609 | |
| 611 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0); // it uses pf3 in 8bpp mode instead, like captaven |
| 612 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0); |
| 613 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 610 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 0); // it uses pf3 in 8bpp mode instead, like captaven |
| 611 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 612 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0); |
| 614 | 613 | |
| 615 | 614 | // zooming sprite draw is very slow, and sprites are buffered.. however, one of the levels attempts to use |
| 616 | 615 | // partial updates for every line, which causes things to be very slow... the sprites appear to support |
| r24015 | r24016 | |
| 627 | 626 | rectangle clip(cliprect.min_x, cliprect.max_x, 8, 247); |
| 628 | 627 | |
| 629 | 628 | dragngun_draw_sprites(bitmap,clip,m_spriteram->buffer()); |
| 630 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, clip, 0, 0); |
| 629 | m_deco_tilegen1->tilemap_1_draw(bitmap, clip, 0, 0); |
| 631 | 630 | |
| 632 | 631 | } |
| 633 | 632 | |
| r24015 | r24016 | |
| 640 | 639 | machine().priority_bitmap.fill(0, cliprect); |
| 641 | 640 | bitmap.fill(machine().pens[0x000], cliprect); // Palette index not confirmed |
| 642 | 641 | |
| 643 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 644 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 642 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 643 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 645 | 644 | |
| 646 | 645 | m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram16_buffered, 0x800, true); |
| 647 | 646 | |
| 648 | 647 | /* Draw screen */ |
| 649 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1); |
| 648 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 1); |
| 650 | 649 | |
| 651 | 650 | if(m_pri&1) |
| 652 | 651 | { |
| 653 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 652 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2); |
| 654 | 653 | m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); |
| 655 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 654 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4); |
| 656 | 655 | } |
| 657 | 656 | else |
| 658 | 657 | { |
| 659 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 658 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 660 | 659 | m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0800, 0x0800, 1024, 0x1ff); |
| 661 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 660 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4); |
| 662 | 661 | } |
| 663 | 662 | |
| 664 | 663 | m_sprgen->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0800, 1024, 0x1ff); |
| 665 | 664 | |
| 666 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 665 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 667 | 666 | return 0; |
| 668 | 667 | } |
| 669 | 668 | |
| r24015 | r24016 | |
| 809 | 808 | UINT32 deco32_state::screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 810 | 809 | { |
| 811 | 810 | int alphaTilemap=0; |
| 812 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 813 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 811 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 812 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 814 | 813 | |
| 815 | 814 | /* This is not a conclusive test for deciding if tilemap needs alpha blending */ |
| 816 | 815 | if (m_ace_ram[0x17]!=0x0 && m_pri) |
| r24015 | r24016 | |
| 837 | 836 | /* Draw playfields & sprites */ |
| 838 | 837 | if (m_pri&2) |
| 839 | 838 | { |
| 840 | | deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1, 1); |
| 841 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 839 | m_deco_tilegen2->tilemap_12_combine_draw(bitmap, cliprect, 0, 1, 1); |
| 840 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4); |
| 842 | 841 | } |
| 843 | 842 | else |
| 844 | 843 | { |
| 845 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 1); |
| 844 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 1); |
| 846 | 845 | if (m_pri&1) |
| 847 | 846 | { |
| 848 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 847 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2); |
| 849 | 848 | if (alphaTilemap) |
| 850 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, *m_tilemap_alpha_bitmap, cliprect, 0, 4); |
| 849 | m_deco_tilegen2->tilemap_1_draw(*m_tilemap_alpha_bitmap, cliprect, 0, 4); |
| 851 | 850 | else |
| 852 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 851 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4); |
| 853 | 852 | } |
| 854 | 853 | else |
| 855 | 854 | { |
| 856 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 855 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 857 | 856 | if (alphaTilemap) |
| 858 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, *m_tilemap_alpha_bitmap, cliprect, 0, 4); |
| 857 | m_deco_tilegen1->tilemap_2_draw(*m_tilemap_alpha_bitmap, cliprect, 0, 4); |
| 859 | 858 | else |
| 860 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 859 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4); |
| 861 | 860 | } |
| 862 | 861 | } |
| 863 | 862 | |
| 864 | 863 | mixDualAlphaSprites(bitmap, cliprect, machine().gfx[3], machine().gfx[4], alphaTilemap); |
| 865 | 864 | |
| 866 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 865 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 867 | 866 | return 0; |
| 868 | 867 | } |
trunk/src/mame/video/rohga.c
| r24015 | r24016 | |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "includes/rohga.h" |
| 9 | | #include "video/deco16ic.h" |
| 10 | 9 | |
| 11 | 10 | |
| 12 | 11 | WRITE16_MEMBER(rohga_state::rohga_buffer_spriteram16_w) |
| r24015 | r24016 | |
| 64 | 63 | UINT32 rohga_state::screen_update_rohga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 65 | 64 | { |
| 66 | 65 | address_space &space = machine().driver_data()->generic_space(); |
| 67 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 66 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 68 | 67 | UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff); |
| 69 | 68 | |
| 70 | 69 | /* Update playfields */ |
| 71 | 70 | flip_screen_set(BIT(flip, 7)); |
| 72 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 73 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 71 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 72 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 74 | 73 | |
| 75 | 74 | /* Draw playfields */ |
| 76 | 75 | machine().priority_bitmap.fill(0, cliprect); |
| r24015 | r24016 | |
| 82 | 81 | if (priority & 4) |
| 83 | 82 | { |
| 84 | 83 | // Draw as 1 8BPP layer |
| 85 | | deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 3); |
| 84 | m_deco_tilegen2->tilemap_12_combine_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 3); |
| 86 | 85 | } |
| 87 | 86 | else |
| 88 | 87 | { |
| 89 | 88 | // Draw as 2 4BPP layers |
| 90 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 91 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 89 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 90 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 2); |
| 92 | 91 | } |
| 93 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 4); |
| 92 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 4); |
| 94 | 93 | break; |
| 95 | 94 | case 1: |
| 96 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 97 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 98 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 95 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 96 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 2); |
| 97 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4); |
| 99 | 98 | break; |
| 100 | 99 | case 2: |
| 101 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 102 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, 0, 2); |
| 103 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 100 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 1); |
| 101 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, 0, 2); |
| 102 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 4); |
| 104 | 103 | break; |
| 105 | 104 | } |
| 106 | 105 | |
| 107 | 106 | m_sprgen1->draw_sprites(bitmap, cliprect, m_spriteram->buffer(), 0x400, true); |
| 108 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 107 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 109 | 108 | |
| 110 | 109 | return 0; |
| 111 | 110 | } |
| r24015 | r24016 | |
| 167 | 166 | UINT32 rohga_state::screen_update_wizdfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 168 | 167 | { |
| 169 | 168 | address_space &space = machine().driver_data()->generic_space(); |
| 170 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 169 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 171 | 170 | UINT16 priority = decocomn_priority_r(m_decocomn, space, 0, 0xffff); |
| 172 | 171 | |
| 173 | 172 | /* draw sprite gfx to temp bitmaps */ |
| r24015 | r24016 | |
| 176 | 175 | |
| 177 | 176 | /* Update playfields */ |
| 178 | 177 | flip_screen_set(BIT(flip, 7)); |
| 179 | | deco16ic_pf_update(m_deco_tilegen1, 0, 0); |
| 180 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 178 | m_deco_tilegen1->pf_update(0, 0); |
| 179 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 181 | 180 | |
| 182 | 181 | /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ |
| 183 | 182 | bitmap.fill(machine().pens[512], cliprect); |
| 184 | 183 | |
| 185 | | deco16ic_tilemap_2_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 184 | m_deco_tilegen2->tilemap_2_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 186 | 185 | m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0600, 0x0600, 0x400, 0x1ff); |
| 187 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 186 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 0); |
| 188 | 187 | m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0400, 0x0600, 0x400, 0x1ff); |
| 189 | 188 | |
| 190 | 189 | if ((priority & 0x1f) == 0x1f) /* Wizdfire has bit 0x40 always set, Dark Seal 2 doesn't?! */ |
| 191 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0); |
| 190 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, TILEMAP_DRAW_ALPHA(0x80), 0); |
| 192 | 191 | else |
| 193 | | deco16ic_tilemap_1_draw(m_deco_tilegen2, bitmap, cliprect, 0, 0); |
| 192 | m_deco_tilegen2->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 194 | 193 | |
| 195 | 194 | m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0400, 0x400, 0x1ff); // 0x000 and 0x200 of 0x600 |
| 196 | 195 | |
| 197 | 196 | mixwizdfirelayer(bitmap, cliprect, 4, 0x000, 0x000); |
| 198 | 197 | |
| 199 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 198 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 200 | 199 | return 0; |
| 201 | 200 | } |
| 202 | 201 | |
| 203 | 202 | UINT32 rohga_state::screen_update_nitrobal(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 204 | 203 | { |
| 205 | 204 | address_space &space = machine().driver_data()->generic_space(); |
| 206 | | UINT16 flip = deco16ic_pf_control_r(m_deco_tilegen1, space, 0, 0xffff); |
| 205 | UINT16 flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); |
| 207 | 206 | |
| 208 | 207 | /* draw sprite gfx to temp bitmaps */ |
| 209 | 208 | m_sprgen1->set_alt_format(true); |
| r24015 | r24016 | |
| 213 | 212 | |
| 214 | 213 | /* Update playfields */ |
| 215 | 214 | flip_screen_set(BIT(flip, 7)); |
| 216 | | deco16ic_pf_update(m_deco_tilegen1, m_pf1_rowscroll, m_pf2_rowscroll); |
| 217 | | deco16ic_pf_update(m_deco_tilegen2, m_pf3_rowscroll, m_pf4_rowscroll); |
| 215 | m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); |
| 216 | m_deco_tilegen2->pf_update(m_pf3_rowscroll, m_pf4_rowscroll); |
| 218 | 217 | |
| 219 | 218 | /* Draw playfields - Palette of 2nd playfield chip visible if playfields turned off */ |
| 220 | 219 | bitmap.fill(machine().pens[512], cliprect); |
| 221 | 220 | machine().priority_bitmap.fill(0); |
| 222 | 221 | |
| 223 | 222 | /* pf3 and pf4 are combined into a single 8bpp bitmap */ |
| 224 | | deco16ic_tilemap_12_combine_draw(m_deco_tilegen2, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 223 | m_deco_tilegen2->tilemap_12_combine_draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 225 | 224 | |
| 226 | | deco16ic_tilemap_2_draw(m_deco_tilegen1, bitmap, cliprect, 0, 16); |
| 225 | m_deco_tilegen1->tilemap_2_draw(bitmap, cliprect, 0, 16); |
| 227 | 226 | |
| 228 | 227 | /* ToDo reimplement priorities + mixing / alpha, it was busted worse than this before anyway, so no big loss that we don't do it for now ;-) */ |
| 229 | 228 | m_sprgen2->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x600, 0xff); |
| 230 | 229 | m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x0000, 0x0000, 0x400, 0x1ff); |
| 231 | 230 | |
| 232 | 231 | |
| 233 | | deco16ic_tilemap_1_draw(m_deco_tilegen1, bitmap, cliprect, 0, 0); |
| 232 | m_deco_tilegen1->tilemap_1_draw(bitmap, cliprect, 0, 0); |
| 234 | 233 | return 0; |
| 235 | 234 | } |
trunk/src/mame/video/deco16ic.c
| r24015 | r24016 | |
| 164 | 164 | #include "ui.h" |
| 165 | 165 | |
| 166 | 166 | |
| 167 | | struct deco16ic_state |
| 167 | const device_type DECO16IC = &device_creator<deco16ic_device>; |
| 168 | |
| 169 | deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 170 | : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock, "deco16ic", __FILE__), |
| 171 | m_screen(NULL), |
| 172 | m_pf1_data(NULL), |
| 173 | m_pf2_data(NULL), |
| 174 | m_pf12_control(NULL), |
| 175 | m_pf1_rowscroll_ptr(NULL), |
| 176 | m_pf2_rowscroll_ptr(NULL), |
| 177 | m_use_custom_pf1(0), |
| 178 | m_use_custom_pf2(0), |
| 179 | m_pf1_bank(0), |
| 180 | m_pf2_bank(0), |
| 181 | m_pf12_last_small(0), |
| 182 | m_pf12_last_big(0), |
| 183 | m_pf1_8bpp_mode(0) |
| 168 | 184 | { |
| 169 | | screen_device *screen; |
| 170 | 185 | |
| 171 | | UINT16 *pf1_data, *pf2_data; |
| 172 | | UINT16 *pf12_control; |
| 186 | } |
| 173 | 187 | |
| 174 | | const UINT16 *pf1_rowscroll_ptr, *pf2_rowscroll_ptr; |
| 188 | //------------------------------------------------- |
| 189 | // device_config_complete - perform any |
| 190 | // operations now that the configuration is |
| 191 | // complete |
| 192 | //------------------------------------------------- |
| 175 | 193 | |
| 176 | | tilemap_t *pf1_tilemap_16x16, *pf2_tilemap_16x16; |
| 177 | | tilemap_t *pf1_tilemap_8x8, *pf2_tilemap_8x8; |
| 194 | void deco16ic_device::device_config_complete() |
| 195 | { |
| 196 | // inherit a copy of the static data |
| 197 | const deco16ic_interface *intf = reinterpret_cast<const deco16ic_interface *>(static_config()); |
| 198 | if (intf != NULL) |
| 199 | *static_cast<deco16ic_interface *>(this) = *intf; |
| 200 | |
| 201 | // or initialize to defaults if none provided |
| 202 | else |
| 203 | { |
| 204 | m_screen_tag = ""; |
| 205 | m_bank_cb0 = NULL; |
| 206 | m_bank_cb1 = NULL; |
| 207 | } |
| 208 | } |
| 178 | 209 | |
| 179 | | deco16_bank_cb bank_cb[2]; |
| 210 | //------------------------------------------------- |
| 211 | // device_start - device-specific startup |
| 212 | //------------------------------------------------- |
| 180 | 213 | |
| 181 | | int use_custom_pf1, use_custom_pf2; |
| 214 | void deco16ic_device::device_start() |
| 215 | { |
| 216 | m_bank_cb_func[0] = m_bank_cb0; |
| 217 | m_bank_cb_func[1] = m_bank_cb1; |
| 182 | 218 | |
| 183 | | int pf1_bank, pf2_bank; |
| 184 | | int pf12_16x16_gfx_bank, pf12_8x8_gfx_bank; |
| 185 | | int pf1_colourmask, pf2_colourmask; |
| 186 | | int pf1_colour_bank, pf2_colour_bank; |
| 187 | | int pf1_trans_mask, pf2_trans_mask; |
| 219 | int fullheight = 0; |
| 220 | int fullwidth = 0; |
| 188 | 221 | |
| 189 | | int pf12_last_small, pf12_last_big; |
| 222 | if (m_full_width12&2) |
| 223 | fullheight = 1; |
| 190 | 224 | |
| 191 | | int pf1_8bpp_mode; |
| 192 | | }; |
| 225 | if (m_full_width12&1) |
| 226 | fullwidth = 1; |
| 193 | 227 | |
| 194 | | /***************************************************************************** |
| 195 | | INLINE FUNCTIONS |
| 196 | | *****************************************************************************/ |
| 228 | m_pf1_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32); |
| 229 | // m_pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, m_full_width12 ? 64 : 32, 32); |
| 230 | m_pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball |
| 197 | 231 | |
| 198 | | INLINE deco16ic_state *get_safe_token( device_t *device ) |
| 199 | | { |
| 200 | | assert(device != NULL); |
| 201 | | assert(device->type() == DECO16IC); |
| 232 | if (m_split) |
| 233 | m_pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32); |
| 234 | else |
| 235 | m_pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32); |
| 202 | 236 | |
| 203 | | return (deco16ic_state *)downcast<deco16ic_device *>(device)->token(); |
| 237 | m_pf2_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32); |
| 238 | |
| 239 | m_pf1_tilemap_8x8->set_transparent_pen(0); |
| 240 | m_pf2_tilemap_8x8->set_transparent_pen(0); |
| 241 | m_pf1_tilemap_16x16->set_transparent_pen(0); |
| 242 | m_pf2_tilemap_16x16->set_transparent_pen(0); |
| 243 | |
| 244 | if (m_split) /* Caveman Ninja only */ |
| 245 | m_pf2_tilemap_16x16->set_transmask(0, 0x00ff, 0xff01); |
| 246 | |
| 247 | m_pf1_8bpp_mode = 0; |
| 248 | |
| 249 | m_pf1_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2); |
| 250 | m_pf2_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2); |
| 251 | m_pf12_control = auto_alloc_array_clear(machine(), UINT16, 0x10 / 2); |
| 252 | |
| 253 | |
| 254 | save_item(NAME(m_use_custom_pf1)); |
| 255 | save_item(NAME(m_use_custom_pf2)); |
| 256 | save_item(NAME(m_pf1_bank)); |
| 257 | save_item(NAME(m_pf2_bank)); |
| 258 | save_item(NAME(m_pf12_8x8_gfx_bank)); |
| 259 | save_item(NAME(m_pf12_16x16_gfx_bank)); |
| 260 | save_item(NAME(m_pf12_last_small)); |
| 261 | save_item(NAME(m_pf12_last_big)); |
| 262 | |
| 263 | save_item(NAME(m_pf1_8bpp_mode)); |
| 264 | |
| 265 | save_pointer(NAME(m_pf1_data), 0x2000 / 2); |
| 266 | save_pointer(NAME(m_pf2_data), 0x2000 / 2); |
| 267 | save_pointer(NAME(m_pf12_control), 0x10 / 2); |
| 204 | 268 | } |
| 205 | 269 | |
| 206 | | INLINE const deco16ic_interface *get_interface( device_t *device ) |
| 270 | //------------------------------------------------- |
| 271 | // device_reset - device-specific reset |
| 272 | //------------------------------------------------- |
| 273 | |
| 274 | void deco16ic_device::device_reset() |
| 207 | 275 | { |
| 208 | | assert(device != NULL); |
| 209 | | assert((device->type() == DECO16IC)); |
| 210 | | return (const deco16ic_interface *) device->static_config(); |
| 276 | m_pf1_bank = m_pf2_bank = 0; |
| 277 | m_pf12_last_small = m_pf12_last_big = -1; |
| 278 | m_use_custom_pf1 = m_use_custom_pf2 = 0; |
| 279 | m_pf1_rowscroll_ptr = 0; |
| 280 | m_pf2_rowscroll_ptr = 0; |
| 211 | 281 | } |
| 212 | 282 | |
| 213 | 283 | /*****************************************************************************************/ |
| r24015 | r24016 | |
| 220 | 290 | |
| 221 | 291 | TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info) |
| 222 | 292 | { |
| 223 | | deco16ic_state *deco16ic = get_safe_token(this); |
| 224 | | UINT16 tile = deco16ic->pf2_data[tile_index]; |
| 293 | UINT16 tile = m_pf2_data[tile_index]; |
| 225 | 294 | UINT8 colour = (tile >> 12) & 0xf; |
| 226 | 295 | UINT8 flags = 0; |
| 227 | 296 | |
| 228 | 297 | if (tile & 0x8000) |
| 229 | 298 | { |
| 230 | | if ((deco16ic->pf12_control[6] >> 8) & 0x01) |
| 299 | if ((m_pf12_control[6] >> 8) & 0x01) |
| 231 | 300 | { |
| 232 | 301 | flags |= TILE_FLIPX; |
| 233 | 302 | colour &= 0x7; |
| 234 | 303 | } |
| 235 | | if ((deco16ic->pf12_control[6] >> 8) & 0x02) |
| 304 | if ((m_pf12_control[6] >> 8) & 0x02) |
| 236 | 305 | { |
| 237 | 306 | flags |= TILE_FLIPY; |
| 238 | 307 | colour &= 0x7; |
| r24015 | r24016 | |
| 240 | 309 | } |
| 241 | 310 | |
| 242 | 311 | SET_TILE_INFO_MEMBER( |
| 243 | | deco16ic->pf12_16x16_gfx_bank, |
| 244 | | (tile & 0xfff) | deco16ic->pf2_bank, |
| 245 | | (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank, |
| 312 | m_pf12_16x16_gfx_bank, |
| 313 | (tile & 0xfff) | m_pf2_bank, |
| 314 | (colour & m_pf2_colourmask) + m_pf2_colour_bank, |
| 246 | 315 | flags); |
| 247 | 316 | } |
| 248 | 317 | |
| 249 | 318 | TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info) |
| 250 | 319 | { |
| 251 | | deco16ic_state *deco16ic = get_safe_token(this); |
| 252 | | UINT16 tile = deco16ic->pf1_data[tile_index]; |
| 320 | UINT16 tile = m_pf1_data[tile_index]; |
| 253 | 321 | UINT8 colour = (tile >> 12) & 0xf; |
| 254 | 322 | UINT8 flags = 0; |
| 255 | 323 | |
| 256 | 324 | if (tile & 0x8000) |
| 257 | 325 | { |
| 258 | | if ((deco16ic->pf12_control[6] >> 0) & 0x01) |
| 326 | if ((m_pf12_control[6] >> 0) & 0x01) |
| 259 | 327 | { |
| 260 | 328 | flags |= TILE_FLIPX; |
| 261 | 329 | colour &= 0x7; |
| 262 | 330 | } |
| 263 | | if ((deco16ic->pf12_control[6] >> 0) & 0x02) |
| 331 | if ((m_pf12_control[6] >> 0) & 0x02) |
| 264 | 332 | { |
| 265 | 333 | flags |= TILE_FLIPY; |
| 266 | 334 | colour &= 0x7; |
| 267 | 335 | } |
| 268 | 336 | } |
| 269 | 337 | |
| 270 | | if (deco16ic->pf1_8bpp_mode) |
| 338 | if (m_pf1_8bpp_mode) |
| 271 | 339 | { |
| 272 | 340 | // Captain America operates this chip in 8bpp mode. |
| 273 | 341 | // In 8bpp mode you appear to only get 1 layer, not 2, but you also |
| 274 | 342 | // have an extra 2 tile bits, and 2 less colour bits. |
| 275 | 343 | SET_TILE_INFO_MEMBER( |
| 276 | | deco16ic->pf12_16x16_gfx_bank, |
| 277 | | (tile & 0x3fff) | deco16ic->pf1_bank, |
| 278 | | ((colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank)>>2, |
| 344 | m_pf12_16x16_gfx_bank, |
| 345 | (tile & 0x3fff) | m_pf1_bank, |
| 346 | ((colour & m_pf1_colourmask) + m_pf1_colour_bank)>>2, |
| 279 | 347 | flags); |
| 280 | 348 | } |
| 281 | 349 | else |
| 282 | 350 | { |
| 283 | 351 | SET_TILE_INFO_MEMBER( |
| 284 | | deco16ic->pf12_16x16_gfx_bank, |
| 285 | | (tile & 0xfff) | deco16ic->pf1_bank, |
| 286 | | (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank, |
| 352 | m_pf12_16x16_gfx_bank, |
| 353 | (tile & 0xfff) | m_pf1_bank, |
| 354 | (colour & m_pf1_colourmask) + m_pf1_colour_bank, |
| 287 | 355 | flags); |
| 288 | 356 | } |
| 289 | 357 | } |
| 290 | 358 | |
| 291 | 359 | TILE_GET_INFO_MEMBER(deco16ic_device::get_pf2_tile_info_b) |
| 292 | 360 | { |
| 293 | | deco16ic_state *deco16ic = get_safe_token(this); |
| 294 | | UINT16 tile = deco16ic->pf2_data[tile_index]; |
| 361 | UINT16 tile = m_pf2_data[tile_index]; |
| 295 | 362 | UINT8 colour = (tile >> 12) & 0xf; |
| 296 | 363 | UINT8 flags = 0; |
| 297 | 364 | |
| 298 | 365 | if (tile & 0x8000) |
| 299 | 366 | { |
| 300 | | if ((deco16ic->pf12_control[6] >> 8) & 0x01) |
| 367 | if ((m_pf12_control[6] >> 8) & 0x01) |
| 301 | 368 | { |
| 302 | 369 | flags |= TILE_FLIPX; |
| 303 | 370 | colour &= 0x7; |
| 304 | 371 | } |
| 305 | | if ((deco16ic->pf12_control[6] >> 8) & 0x02) |
| 372 | if ((m_pf12_control[6] >> 8) & 0x02) |
| 306 | 373 | { |
| 307 | 374 | flags |= TILE_FLIPY; |
| 308 | 375 | colour &= 0x7; |
| r24015 | r24016 | |
| 310 | 377 | } |
| 311 | 378 | |
| 312 | 379 | SET_TILE_INFO_MEMBER( |
| 313 | | deco16ic->pf12_8x8_gfx_bank, |
| 314 | | (tile & 0xfff) | deco16ic->pf2_bank, |
| 315 | | (colour & deco16ic->pf2_colourmask) + deco16ic->pf2_colour_bank, |
| 380 | m_pf12_8x8_gfx_bank, |
| 381 | (tile & 0xfff) | m_pf2_bank, |
| 382 | (colour & m_pf2_colourmask) + m_pf2_colour_bank, |
| 316 | 383 | flags); |
| 317 | 384 | } |
| 318 | 385 | |
| 319 | 386 | TILE_GET_INFO_MEMBER(deco16ic_device::get_pf1_tile_info_b) |
| 320 | 387 | { |
| 321 | | deco16ic_state *deco16ic = get_safe_token(this); |
| 322 | | UINT16 tile = deco16ic->pf1_data[tile_index]; |
| 388 | UINT16 tile = m_pf1_data[tile_index]; |
| 323 | 389 | UINT8 colour = (tile >> 12) & 0xf; |
| 324 | 390 | UINT8 flags = 0; |
| 325 | 391 | |
| 326 | 392 | if (tile & 0x8000) |
| 327 | 393 | { |
| 328 | | if ((deco16ic->pf12_control[6] >> 0) & 0x01) |
| 394 | if ((m_pf12_control[6] >> 0) & 0x01) |
| 329 | 395 | { |
| 330 | 396 | flags |= TILE_FLIPX; |
| 331 | 397 | colour &= 0x7; |
| 332 | 398 | } |
| 333 | | if ((deco16ic->pf12_control[6] >> 0) & 0x02) |
| 399 | if ((m_pf12_control[6] >> 0) & 0x02) |
| 334 | 400 | { |
| 335 | 401 | flags |= TILE_FLIPY; |
| 336 | 402 | colour &= 0x7; |
| r24015 | r24016 | |
| 338 | 404 | } |
| 339 | 405 | |
| 340 | 406 | SET_TILE_INFO_MEMBER( |
| 341 | | deco16ic->pf12_8x8_gfx_bank, |
| 342 | | (tile & 0xfff) | deco16ic->pf1_bank, |
| 343 | | (colour & deco16ic->pf1_colourmask) + deco16ic->pf1_colour_bank, |
| 407 | m_pf12_8x8_gfx_bank, |
| 408 | (tile & 0xfff) | m_pf1_bank, |
| 409 | (colour & m_pf1_colourmask) + m_pf1_colour_bank, |
| 344 | 410 | flags); |
| 345 | 411 | } |
| 346 | 412 | |
| r24015 | r24016 | |
| 351 | 417 | Consider this the 'reference rasterizer' for the 56/74/141 tilemap chips - it implements |
| 352 | 418 | simultaneous row & column scroll which the Mame tilemap core cannot do. It also |
| 353 | 419 | implements combining the 4BPP output of two tilemaps into 8BPP output. This function |
| 354 | | is automatically called when the tilemap is in a state the cannot be properly rendered |
| 420 | is automatically called when the tilemap is in a state that cannot be properly rendered |
| 355 | 421 | by the Mame core. |
| 356 | 422 | */ |
| 357 | 423 | |
| 358 | 424 | template<class _BitmapClass> |
| 359 | | static void custom_tilemap_draw( |
| 360 | | device_t *device, |
| 425 | void deco16ic_device::custom_tilemap_draw( |
| 361 | 426 | _BitmapClass &bitmap, |
| 362 | 427 | const rectangle &cliprect, |
| 363 | 428 | tilemap_t *tilemap0_8x8, |
| r24015 | r24016 | |
| 377 | 442 | int is_tattoo |
| 378 | 443 | ) |
| 379 | 444 | { |
| 380 | | running_machine &machine = device->machine(); |
| 381 | 445 | tilemap_t *tilemap0 = BIT(control1, 7) ? tilemap0_8x8 : tilemap0_16x16; |
| 382 | 446 | tilemap_t *tilemap1 = BIT(control1, 7) ? tilemap1_8x8 : tilemap1_16x16; |
| 383 | 447 | const bitmap_ind16 *src_bitmap0 = tilemap0 ? &tilemap0->pixmap() : NULL; |
| r24015 | r24016 | |
| 438 | 502 | |
| 439 | 503 | if ((flags & TILEMAP_DRAW_OPAQUE) || (p & trans_mask)) |
| 440 | 504 | { |
| 441 | | bitmap.pix(y, x) = machine.pens[p]; |
| 442 | | if (machine.priority_bitmap.valid()) |
| 505 | bitmap.pix(y, x) = machine().pens[p]; |
| 506 | if (machine().priority_bitmap.valid()) |
| 443 | 507 | { |
| 444 | | UINT8 *pri = &machine.priority_bitmap.pix8(y); |
| 508 | UINT8 *pri = &machine().priority_bitmap.pix8(y); |
| 445 | 509 | pri[x] |= priority; |
| 446 | 510 | } |
| 447 | 511 | } |
| r24015 | r24016 | |
| 454 | 518 | /******************************************************************************/ |
| 455 | 519 | |
| 456 | 520 | /* captain america seems to have a similar 8bpp feature to robocop2, investigate merging */ |
| 457 | | void deco16ic_set_pf1_8bpp_mode(device_t *device, int mode) |
| 521 | void deco16ic_device::set_pf1_8bpp_mode(int mode) |
| 458 | 522 | { |
| 459 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 460 | | deco16ic->pf1_8bpp_mode = mode; |
| 523 | m_pf1_8bpp_mode = mode; |
| 461 | 524 | } |
| 462 | 525 | |
| 463 | 526 | /* robocop 2 can switch between 2 tilemaps at 4bpp, or 1 at 8bpp */ |
| 464 | | void deco16ic_set_tilemap_colour_mask( device_t *device, int tmap, int mask ) |
| 527 | void deco16ic_device::set_tilemap_colour_mask( int tmap, int mask ) |
| 465 | 528 | { |
| 466 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 467 | | |
| 468 | 529 | switch (tmap) |
| 469 | 530 | { |
| 470 | | case 0: deco16ic->pf1_colourmask = mask; break; |
| 471 | | case 1: deco16ic->pf2_colourmask = mask; break; |
| 531 | case 0: m_pf1_colourmask = mask; break; |
| 532 | case 1: m_pf2_colourmask = mask; break; |
| 472 | 533 | } |
| 473 | 534 | } |
| 474 | 535 | |
| 475 | | void deco16ic_pf12_set_gfxbank( device_t *device, int small, int big ) |
| 536 | void deco16ic_device::pf12_set_gfxbank( int small, int big ) |
| 476 | 537 | { |
| 477 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 478 | | |
| 479 | | if (deco16ic->pf12_last_big != big) |
| 538 | if (m_pf12_last_big != big) |
| 480 | 539 | { |
| 481 | | if (deco16ic->pf1_tilemap_16x16) |
| 482 | | deco16ic->pf1_tilemap_16x16->mark_all_dirty(); |
| 483 | | if (deco16ic->pf2_tilemap_16x16) |
| 484 | | deco16ic->pf2_tilemap_16x16->mark_all_dirty(); |
| 540 | if (m_pf1_tilemap_16x16) |
| 541 | m_pf1_tilemap_16x16->mark_all_dirty(); |
| 542 | if (m_pf2_tilemap_16x16) |
| 543 | m_pf2_tilemap_16x16->mark_all_dirty(); |
| 485 | 544 | |
| 486 | | deco16ic->pf12_last_big = big; |
| 545 | m_pf12_last_big = big; |
| 487 | 546 | } |
| 488 | | deco16ic->pf12_16x16_gfx_bank = big; |
| 547 | m_pf12_16x16_gfx_bank = big; |
| 489 | 548 | |
| 490 | | if (deco16ic->pf12_last_small != small) |
| 549 | if (m_pf12_last_small != small) |
| 491 | 550 | { |
| 492 | | if (deco16ic->pf1_tilemap_8x8) |
| 493 | | deco16ic->pf1_tilemap_8x8->mark_all_dirty(); |
| 494 | | if (deco16ic->pf2_tilemap_8x8) |
| 495 | | deco16ic->pf2_tilemap_8x8->mark_all_dirty(); |
| 551 | if (m_pf1_tilemap_8x8) |
| 552 | m_pf1_tilemap_8x8->mark_all_dirty(); |
| 553 | if (m_pf2_tilemap_8x8) |
| 554 | m_pf2_tilemap_8x8->mark_all_dirty(); |
| 496 | 555 | |
| 497 | | deco16ic->pf12_last_small = small; |
| 556 | m_pf12_last_small = small; |
| 498 | 557 | } |
| 499 | | deco16ic->pf12_8x8_gfx_bank = small; |
| 558 | m_pf12_8x8_gfx_bank = small; |
| 500 | 559 | } |
| 501 | 560 | |
| 502 | 561 | /* stoneage has broken scroll registers */ |
| 503 | | void deco16ic_set_scrolldx( device_t *device, int tmap, int size, int dx, int dx_if_flipped ) |
| 562 | void deco16ic_device::set_scrolldx( int tmap, int size, int dx, int dx_if_flipped ) |
| 504 | 563 | { |
| 505 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 506 | | |
| 507 | 564 | switch (tmap) |
| 508 | 565 | { |
| 509 | 566 | case 0: |
| 510 | 567 | if (!size) |
| 511 | | deco16ic->pf1_tilemap_16x16->set_scrolldx(dx, dx_if_flipped); |
| 568 | m_pf1_tilemap_16x16->set_scrolldx(dx, dx_if_flipped); |
| 512 | 569 | else |
| 513 | | deco16ic->pf1_tilemap_8x8->set_scrolldx(dx, dx_if_flipped); |
| 570 | m_pf1_tilemap_8x8->set_scrolldx(dx, dx_if_flipped); |
| 514 | 571 | break; |
| 515 | 572 | case 1: |
| 516 | 573 | if (!size) |
| 517 | | deco16ic->pf2_tilemap_16x16->set_scrolldx(dx, dx_if_flipped); |
| 574 | m_pf2_tilemap_16x16->set_scrolldx(dx, dx_if_flipped); |
| 518 | 575 | else |
| 519 | | deco16ic->pf2_tilemap_8x8->set_scrolldx(dx, dx_if_flipped); |
| 576 | m_pf2_tilemap_8x8->set_scrolldx(dx, dx_if_flipped); |
| 520 | 577 | break; |
| 521 | 578 | } |
| 522 | 579 | } |
| 523 | 580 | |
| 524 | 581 | /* cninjabl does not enable background layers */ |
| 525 | | void deco16ic_set_enable( device_t *device, int tmap, int enable ) |
| 582 | void deco16ic_device::set_enable( int tmap, int enable ) |
| 526 | 583 | { |
| 527 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 528 | | |
| 529 | 584 | int shift = (tmap & 1) ? 15 : 7; |
| 530 | | deco16ic->pf12_control[5] &= ~(1 << shift); |
| 531 | | deco16ic->pf12_control[5] |= (enable & 1) << shift; |
| 585 | m_pf12_control[5] &= ~(1 << shift); |
| 586 | m_pf12_control[5] |= (enable & 1) << shift; |
| 532 | 587 | } |
| 533 | 588 | |
| 534 | 589 | |
| 535 | 590 | /******************************************************************************/ |
| 536 | 591 | |
| 537 | | WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w ) |
| 592 | WRITE16_MEMBER( deco16ic_device::pf1_data_w ) |
| 538 | 593 | { |
| 539 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 594 | COMBINE_DATA(&m_pf1_data[offset]); |
| 540 | 595 | |
| 541 | | COMBINE_DATA(&deco16ic->pf1_data[offset]); |
| 542 | | |
| 543 | | deco16ic->pf1_tilemap_8x8->mark_tile_dirty(offset); |
| 596 | m_pf1_tilemap_8x8->mark_tile_dirty(offset); |
| 544 | 597 | // if (offset < 0x800) |
| 545 | | deco16ic->pf1_tilemap_16x16->mark_tile_dirty(offset); |
| 598 | m_pf1_tilemap_16x16->mark_tile_dirty(offset); |
| 546 | 599 | } |
| 547 | 600 | |
| 548 | | WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w ) |
| 601 | WRITE16_MEMBER( deco16ic_device::pf2_data_w ) |
| 549 | 602 | { |
| 550 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 603 | COMBINE_DATA(&m_pf2_data[offset]); |
| 551 | 604 | |
| 552 | | COMBINE_DATA(&deco16ic->pf2_data[offset]); |
| 553 | | |
| 554 | | deco16ic->pf2_tilemap_8x8->mark_tile_dirty(offset); |
| 605 | m_pf2_tilemap_8x8->mark_tile_dirty(offset); |
| 555 | 606 | // if (offset < 0x800) |
| 556 | | deco16ic->pf2_tilemap_16x16->mark_tile_dirty(offset); |
| 607 | m_pf2_tilemap_16x16->mark_tile_dirty(offset); |
| 557 | 608 | } |
| 558 | 609 | |
| 559 | | READ16_DEVICE_HANDLER( deco16ic_pf1_data_r ) |
| 610 | READ16_MEMBER( deco16ic_device::pf1_data_r ) |
| 560 | 611 | { |
| 561 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 562 | | return deco16ic->pf1_data[offset]; |
| 612 | return m_pf1_data[offset]; |
| 563 | 613 | } |
| 564 | 614 | |
| 565 | | READ16_DEVICE_HANDLER( deco16ic_pf2_data_r ) |
| 615 | READ16_MEMBER( deco16ic_device::pf2_data_r ) |
| 566 | 616 | { |
| 567 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 568 | | return deco16ic->pf2_data[offset]; |
| 617 | return m_pf2_data[offset]; |
| 569 | 618 | } |
| 570 | 619 | |
| 571 | | WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w ) |
| 620 | WRITE16_MEMBER( deco16ic_device::pf_control_w ) |
| 572 | 621 | { |
| 573 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 574 | 622 | space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos()); |
| 575 | 623 | |
| 576 | | COMBINE_DATA(&deco16ic->pf12_control[offset]); |
| 624 | COMBINE_DATA(&m_pf12_control[offset]); |
| 577 | 625 | } |
| 578 | 626 | |
| 579 | | READ16_DEVICE_HANDLER( deco16ic_pf_control_r ) |
| 627 | READ16_MEMBER( deco16ic_device::pf_control_r ) |
| 580 | 628 | { |
| 581 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 582 | | return deco16ic->pf12_control[offset]; |
| 629 | return m_pf12_control[offset]; |
| 583 | 630 | } |
| 584 | 631 | |
| 585 | 632 | |
| 586 | | READ32_DEVICE_HANDLER ( deco16ic_pf_control_dword_r ) |
| 633 | READ32_MEMBER( deco16ic_device::pf_control_dword_r ) |
| 587 | 634 | { |
| 588 | | return deco16ic_pf_control_r(device, space, offset, 0xffff)^0xffff0000; |
| 635 | return pf_control_r(space, offset, 0xffff)^0xffff0000; |
| 589 | 636 | } |
| 590 | 637 | |
| 591 | | WRITE32_DEVICE_HANDLER( deco16ic_pf_control_dword_w ) |
| 638 | WRITE32_MEMBER( deco16ic_device::pf_control_dword_w ) |
| 592 | 639 | { |
| 593 | | deco16ic_pf_control_w(device, space, offset, data & 0xffff, mem_mask & 0xffff); |
| 640 | pf_control_w(space, offset, data & 0xffff, mem_mask & 0xffff); |
| 594 | 641 | } |
| 595 | 642 | |
| 596 | | READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r ) |
| 643 | READ32_MEMBER( deco16ic_device::pf1_data_dword_r ) |
| 597 | 644 | { |
| 598 | | return deco16ic_pf1_data_r(device, space, offset, 0xffff)^0xffff0000; |
| 645 | return pf1_data_r(space, offset, 0xffff)^0xffff0000; |
| 599 | 646 | } |
| 600 | 647 | |
| 601 | | WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w ) |
| 648 | WRITE32_MEMBER( deco16ic_device::pf1_data_dword_w ) |
| 602 | 649 | { |
| 603 | | deco16ic_pf1_data_w(device, space, offset, data & 0xffff, mem_mask & 0xffff); |
| 650 | pf1_data_w(space, offset, data & 0xffff, mem_mask & 0xffff); |
| 604 | 651 | } |
| 605 | 652 | |
| 606 | | READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r ) |
| 653 | READ32_MEMBER( deco16ic_device::pf2_data_dword_r ) |
| 607 | 654 | { |
| 608 | | return deco16ic_pf2_data_r(device, space, offset, 0xffff)^0xffff0000; |
| 655 | return pf2_data_r(space, offset, 0xffff)^0xffff0000; |
| 609 | 656 | } |
| 610 | 657 | |
| 611 | | WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w ) |
| 658 | WRITE32_MEMBER( deco16ic_device::pf2_data_dword_w ) |
| 612 | 659 | { |
| 613 | | deco16ic_pf2_data_w(device, space, offset, data & 0xffff, mem_mask & 0xffff); |
| 660 | pf2_data_w(space, offset, data & 0xffff, mem_mask & 0xffff); |
| 614 | 661 | } |
| 615 | 662 | |
| 616 | 663 | |
| r24015 | r24016 | |
| 765 | 812 | return use_custom; |
| 766 | 813 | } |
| 767 | 814 | |
| 768 | | void deco16ic_pf_update( device_t *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr ) |
| 815 | void deco16ic_device::pf_update( const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr ) |
| 769 | 816 | { |
| 770 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 771 | 817 | int bank1, bank2; |
| 772 | 818 | |
| 773 | 819 | /* Update scrolling and tilemap enable */ |
| 774 | | deco16ic->pf1_rowscroll_ptr = rowscroll_1_ptr; |
| 775 | | deco16ic->pf2_rowscroll_ptr = rowscroll_2_ptr; |
| 776 | | deco16ic->use_custom_pf2 = deco16_pf_update(deco16ic->pf2_tilemap_8x8, deco16ic->pf2_tilemap_16x16, rowscroll_2_ptr, deco16ic->pf12_control[3], deco16ic->pf12_control[4], deco16ic->pf12_control[5] >> 8, deco16ic->pf12_control[6] >> 8); |
| 777 | | deco16ic->use_custom_pf1 = deco16_pf_update(deco16ic->pf1_tilemap_8x8, deco16ic->pf1_tilemap_16x16, rowscroll_1_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff); |
| 820 | m_pf1_rowscroll_ptr = rowscroll_1_ptr; |
| 821 | m_pf2_rowscroll_ptr = rowscroll_2_ptr; |
| 822 | m_use_custom_pf2 = deco16_pf_update(m_pf2_tilemap_8x8, m_pf2_tilemap_16x16, rowscroll_2_ptr, m_pf12_control[3], m_pf12_control[4], m_pf12_control[5] >> 8, m_pf12_control[6] >> 8); |
| 823 | m_use_custom_pf1 = deco16_pf_update(m_pf1_tilemap_8x8, m_pf1_tilemap_16x16, rowscroll_1_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff); |
| 778 | 824 | |
| 779 | 825 | /* Update banking and global flip state */ |
| 780 | | if (deco16ic->bank_cb[0]) |
| 826 | if (m_bank_cb_func[0]) |
| 781 | 827 | { |
| 782 | | bank1 = deco16ic->bank_cb[0](deco16ic->pf12_control[7] & 0xff); |
| 828 | bank1 = m_bank_cb_func[0](m_pf12_control[7] & 0xff); |
| 783 | 829 | |
| 784 | | if (bank1 != deco16ic->pf1_bank) |
| 830 | if (bank1 != m_pf1_bank) |
| 785 | 831 | { |
| 786 | | if (deco16ic->pf1_tilemap_8x8) |
| 787 | | deco16ic->pf1_tilemap_8x8->mark_all_dirty(); |
| 788 | | if (deco16ic->pf1_tilemap_16x16) |
| 789 | | deco16ic->pf1_tilemap_16x16->mark_all_dirty(); |
| 832 | if (m_pf1_tilemap_8x8) |
| 833 | m_pf1_tilemap_8x8->mark_all_dirty(); |
| 834 | if (m_pf1_tilemap_16x16) |
| 835 | m_pf1_tilemap_16x16->mark_all_dirty(); |
| 790 | 836 | |
| 791 | | deco16ic->pf1_bank = bank1; |
| 837 | m_pf1_bank = bank1; |
| 792 | 838 | } |
| 793 | 839 | } |
| 794 | 840 | |
| 795 | | if (deco16ic->bank_cb[1]) |
| 841 | if (m_bank_cb_func[1]) |
| 796 | 842 | { |
| 797 | | bank2 = deco16ic->bank_cb[1](deco16ic->pf12_control[7] >> 8); |
| 843 | bank2 = m_bank_cb_func[1](m_pf12_control[7] >> 8); |
| 798 | 844 | |
| 799 | | if (bank2 != deco16ic->pf2_bank) |
| 845 | if (bank2 != m_pf2_bank) |
| 800 | 846 | { |
| 801 | | if (deco16ic->pf2_tilemap_8x8) |
| 802 | | deco16ic->pf2_tilemap_8x8->mark_all_dirty(); |
| 803 | | if (deco16ic->pf2_tilemap_16x16) |
| 804 | | deco16ic->pf2_tilemap_16x16->mark_all_dirty(); |
| 847 | if (m_pf2_tilemap_8x8) |
| 848 | m_pf2_tilemap_8x8->mark_all_dirty(); |
| 849 | if (m_pf2_tilemap_16x16) |
| 850 | m_pf2_tilemap_16x16->mark_all_dirty(); |
| 805 | 851 | |
| 806 | | deco16ic->pf2_bank = bank2; |
| 852 | m_pf2_bank = bank2; |
| 807 | 853 | } |
| 808 | 854 | } |
| 809 | 855 | } |
| 810 | 856 | |
| 811 | 857 | /*****************************************************************************************/ |
| 812 | 858 | |
| 813 | | void deco16ic_print_debug_info(device_t *device, bitmap_ind16 &bitmap) |
| 859 | void deco16ic_device::print_debug_info(bitmap_ind16 &bitmap) |
| 814 | 860 | { |
| 815 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 816 | 861 | char buf[64*5]; |
| 817 | 862 | |
| 818 | | if (device->machine().input().code_pressed(KEYCODE_O)) |
| 863 | if (machine().input().code_pressed(KEYCODE_O)) |
| 819 | 864 | return; |
| 820 | 865 | |
| 821 | | if (deco16ic->pf12_control) |
| 866 | if (m_pf12_control) |
| 822 | 867 | { |
| 823 | | sprintf(buf,"%04X %04X %04X %04X\n", deco16ic->pf12_control[0], deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[3]); |
| 824 | | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n", deco16ic->pf12_control[4], deco16ic->pf12_control[5], deco16ic->pf12_control[6], deco16ic->pf12_control[7]); |
| 868 | sprintf(buf,"%04X %04X %04X %04X\n", m_pf12_control[0], m_pf12_control[1], m_pf12_control[2], m_pf12_control[3]); |
| 869 | sprintf(&buf[strlen(buf)],"%04X %04X %04X %04X\n", m_pf12_control[4], m_pf12_control[5], m_pf12_control[6], m_pf12_control[7]); |
| 825 | 870 | } |
| 826 | 871 | else |
| 827 | 872 | sprintf(buf, "\n\n"); |
| 828 | 873 | |
| 829 | | ui_draw_text(&device->machine().render().ui_container(), buf, 60, 40); |
| 874 | ui_draw_text(&machine().render().ui_container(), buf, 60, 40); |
| 830 | 875 | } |
| 831 | 876 | |
| 832 | 877 | /*****************************************************************************************/ |
| 833 | 878 | |
| 834 | 879 | template<class _BitmapClass> |
| 835 | | void deco16ic_tilemap_1_draw_common( device_t *device, _BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 880 | void deco16ic_device::tilemap_1_draw_common( _BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 836 | 881 | { |
| 837 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 838 | | |
| 839 | | if (deco16ic->use_custom_pf1) |
| 882 | if (m_use_custom_pf1) |
| 840 | 883 | { |
| 841 | | custom_tilemap_draw(device, bitmap, cliprect, deco16ic->pf1_tilemap_8x8, deco16ic->pf1_tilemap_16x16, 0, 0, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0, 0, deco16ic->pf1_trans_mask, flags, priority, 0); |
| 884 | custom_tilemap_draw(bitmap, cliprect, m_pf1_tilemap_8x8, m_pf1_tilemap_16x16, 0, 0, m_pf1_rowscroll_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, 0, 0, m_pf1_trans_mask, flags, priority, 0); |
| 842 | 885 | } |
| 843 | 886 | else |
| 844 | 887 | { |
| 845 | | if (deco16ic->pf1_tilemap_8x8) |
| 846 | | deco16ic->pf1_tilemap_8x8->draw(bitmap, cliprect, flags, priority); |
| 847 | | if (deco16ic->pf1_tilemap_16x16) |
| 848 | | deco16ic->pf1_tilemap_16x16->draw(bitmap, cliprect, flags, priority); |
| 888 | if (m_pf1_tilemap_8x8) |
| 889 | m_pf1_tilemap_8x8->draw(bitmap, cliprect, flags, priority); |
| 890 | if (m_pf1_tilemap_16x16) |
| 891 | m_pf1_tilemap_16x16->draw(bitmap, cliprect, flags, priority); |
| 849 | 892 | } |
| 850 | 893 | } |
| 851 | 894 | |
| 852 | | void deco16ic_tilemap_1_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 853 | | { deco16ic_tilemap_1_draw_common(device, bitmap, cliprect, flags, priority); } |
| 895 | void deco16ic_device::tilemap_1_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 896 | { tilemap_1_draw_common(bitmap, cliprect, flags, priority); } |
| 854 | 897 | |
| 855 | | void deco16ic_tilemap_1_draw( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 856 | | { deco16ic_tilemap_1_draw_common(device, bitmap, cliprect, flags, priority); } |
| 898 | void deco16ic_device::tilemap_1_draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 899 | { tilemap_1_draw_common(bitmap, cliprect, flags, priority); } |
| 857 | 900 | |
| 858 | 901 | |
| 859 | 902 | template<class _BitmapClass> |
| 860 | | void deco16ic_tilemap_2_draw_common(device_t *device, _BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority) |
| 903 | void deco16ic_device::tilemap_2_draw_common(_BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority) |
| 861 | 904 | { |
| 862 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 863 | | |
| 864 | | if (deco16ic->use_custom_pf2) |
| 905 | if (m_use_custom_pf2) |
| 865 | 906 | { |
| 866 | | custom_tilemap_draw(device, bitmap, cliprect, deco16ic->pf2_tilemap_8x8, deco16ic->pf2_tilemap_16x16, 0, 0, deco16ic->pf2_rowscroll_ptr, deco16ic->pf12_control[3], deco16ic->pf12_control[4], deco16ic->pf12_control[5] >> 8, deco16ic->pf12_control[6] >> 8, 0, 0, deco16ic->pf2_trans_mask, flags, priority, 0); |
| 907 | custom_tilemap_draw(bitmap, cliprect, m_pf2_tilemap_8x8, m_pf2_tilemap_16x16, 0, 0, m_pf2_rowscroll_ptr, m_pf12_control[3], m_pf12_control[4], m_pf12_control[5] >> 8, m_pf12_control[6] >> 8, 0, 0, m_pf2_trans_mask, flags, priority, 0); |
| 867 | 908 | } |
| 868 | 909 | else |
| 869 | 910 | { |
| 870 | | if (deco16ic->pf2_tilemap_8x8) |
| 871 | | deco16ic->pf2_tilemap_8x8->draw(bitmap, cliprect, flags, priority); |
| 872 | | if (deco16ic->pf2_tilemap_16x16) |
| 873 | | deco16ic->pf2_tilemap_16x16->draw(bitmap, cliprect, flags, priority); |
| 911 | if (m_pf2_tilemap_8x8) |
| 912 | m_pf2_tilemap_8x8->draw(bitmap, cliprect, flags, priority); |
| 913 | if (m_pf2_tilemap_16x16) |
| 914 | m_pf2_tilemap_16x16->draw(bitmap, cliprect, flags, priority); |
| 874 | 915 | } |
| 875 | 916 | } |
| 876 | 917 | |
| 877 | | void deco16ic_tilemap_2_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 878 | | { deco16ic_tilemap_2_draw_common(device, bitmap, cliprect, flags, priority); } |
| 918 | void deco16ic_device::tilemap_2_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 919 | { tilemap_2_draw_common(bitmap, cliprect, flags, priority); } |
| 879 | 920 | |
| 880 | | void deco16ic_tilemap_2_draw( device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 881 | | { deco16ic_tilemap_2_draw_common(device, bitmap, cliprect, flags, priority); } |
| 921 | void deco16ic_device::tilemap_2_draw( bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 922 | { tilemap_2_draw_common(bitmap, cliprect, flags, priority); } |
| 882 | 923 | |
| 883 | 924 | |
| 884 | 925 | /*****************************************************************************************/ |
| 885 | 926 | |
| 886 | 927 | // Combines the output of two 4BPP tilemaps into an 8BPP tilemap |
| 887 | | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo) |
| 928 | void deco16ic_device::tilemap_12_combine_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo) |
| 888 | 929 | { |
| 889 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 890 | | custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo); |
| 930 | custom_tilemap_draw(bitmap, cliprect, 0, m_pf1_tilemap_16x16, 0, m_pf2_tilemap_16x16, m_pf1_rowscroll_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo); |
| 891 | 931 | } |
| 892 | 932 | |
| 893 | | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo) |
| 933 | void deco16ic_device::tilemap_12_combine_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo) |
| 894 | 934 | { |
| 895 | | deco16ic_state *deco16ic = get_safe_token(device); |
| 896 | | custom_tilemap_draw(device, bitmap, cliprect, 0, deco16ic->pf1_tilemap_16x16, 0, deco16ic->pf2_tilemap_16x16, deco16ic->pf1_rowscroll_ptr, deco16ic->pf12_control[1], deco16ic->pf12_control[2], deco16ic->pf12_control[5] & 0xff, deco16ic->pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo); |
| 935 | custom_tilemap_draw(bitmap, cliprect, 0, m_pf1_tilemap_16x16, 0, m_pf2_tilemap_16x16, m_pf1_rowscroll_ptr, m_pf12_control[1], m_pf12_control[2], m_pf12_control[5] & 0xff, m_pf12_control[6] & 0xff, 0xf, 4, 0xff, flags, priority, is_tattoo); |
| 897 | 936 | } |
| 898 | | |
| 899 | | const device_type DECO16IC = &device_creator<deco16ic_device>; |
| 900 | | |
| 901 | | deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 902 | | : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock, "deco16ic", __FILE__) |
| 903 | | { |
| 904 | | m_token = global_alloc_clear(deco16ic_state); |
| 905 | | } |
| 906 | | |
| 907 | | //------------------------------------------------- |
| 908 | | // device_config_complete - perform any |
| 909 | | // operations now that the configuration is |
| 910 | | // complete |
| 911 | | //------------------------------------------------- |
| 912 | | |
| 913 | | void deco16ic_device::device_config_complete() |
| 914 | | { |
| 915 | | } |
| 916 | | |
| 917 | | //------------------------------------------------- |
| 918 | | // device_start - device-specific startup |
| 919 | | //------------------------------------------------- |
| 920 | | |
| 921 | | void deco16ic_device::device_start() |
| 922 | | { |
| 923 | | deco16ic_state *deco16ic = get_safe_token(this); |
| 924 | | const deco16ic_interface *intf = get_interface(this); |
| 925 | | |
| 926 | | deco16ic->bank_cb[0] = intf->bank_cb0; |
| 927 | | deco16ic->bank_cb[1] = intf->bank_cb1; |
| 928 | | |
| 929 | | deco16ic->pf1_trans_mask = intf->trans_mask1; |
| 930 | | deco16ic->pf2_trans_mask = intf->trans_mask2; |
| 931 | | |
| 932 | | deco16ic->pf1_colour_bank = intf->col_base1; |
| 933 | | deco16ic->pf2_colour_bank = intf->col_base2; |
| 934 | | |
| 935 | | deco16ic->pf1_colourmask = intf->col_mask1; |
| 936 | | deco16ic->pf2_colourmask = intf->col_mask2; |
| 937 | | |
| 938 | | int fullheight = 0; |
| 939 | | int fullwidth = 0; |
| 940 | | |
| 941 | | if (intf->full_width12&2) |
| 942 | | fullheight = 1; |
| 943 | | |
| 944 | | if (intf->full_width12&1) |
| 945 | | fullwidth = 1; |
| 946 | | |
| 947 | | deco16ic->pf1_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ?64 : 32); |
| 948 | | // deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, intf->full_width12 ? 64 : 32, 32); |
| 949 | | deco16ic->pf1_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf1_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, 64 , 32); // nitroball |
| 950 | | |
| 951 | | deco16ic->pf12_8x8_gfx_bank = intf->_8x8_gfxregion; |
| 952 | | deco16ic->pf12_16x16_gfx_bank = intf->_16x16_gfxregion; |
| 953 | | |
| 954 | | if (intf->split) |
| 955 | | deco16ic->pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32); |
| 956 | | else |
| 957 | | deco16ic->pf2_tilemap_16x16 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info),this), tilemap_mapper_delegate(FUNC(deco16ic_device::deco16_scan_rows),this), 16, 16, fullwidth ? 64 : 32, fullheight ? 64 : 32); |
| 958 | | |
| 959 | | deco16ic->pf2_tilemap_8x8 = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(deco16ic_device::get_pf2_tile_info_b),this), TILEMAP_SCAN_ROWS, 8, 8, fullwidth ? 64 : 32, fullheight ? 64 : 32); |
| 960 | | |
| 961 | | deco16ic->pf1_tilemap_8x8->set_transparent_pen(0); |
| 962 | | deco16ic->pf2_tilemap_8x8->set_transparent_pen(0); |
| 963 | | deco16ic->pf1_tilemap_16x16->set_transparent_pen(0); |
| 964 | | deco16ic->pf2_tilemap_16x16->set_transparent_pen(0); |
| 965 | | |
| 966 | | if (intf->split) /* Caveman Ninja only */ |
| 967 | | deco16ic->pf2_tilemap_16x16->set_transmask(0, 0x00ff, 0xff01); |
| 968 | | |
| 969 | | deco16ic->pf1_8bpp_mode = 0; |
| 970 | | |
| 971 | | deco16ic->pf1_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2); |
| 972 | | deco16ic->pf2_data = auto_alloc_array_clear(machine(), UINT16, 0x2000 / 2); |
| 973 | | deco16ic->pf12_control = auto_alloc_array_clear(machine(), UINT16, 0x10 / 2); |
| 974 | | |
| 975 | | |
| 976 | | save_item(NAME(deco16ic->use_custom_pf1)); |
| 977 | | save_item(NAME(deco16ic->use_custom_pf2)); |
| 978 | | save_item(NAME(deco16ic->pf1_bank)); |
| 979 | | save_item(NAME(deco16ic->pf2_bank)); |
| 980 | | save_item(NAME(deco16ic->pf12_8x8_gfx_bank)); |
| 981 | | save_item(NAME(deco16ic->pf12_16x16_gfx_bank)); |
| 982 | | save_item(NAME(deco16ic->pf12_last_small)); |
| 983 | | save_item(NAME(deco16ic->pf12_last_big)); |
| 984 | | |
| 985 | | save_item(NAME(deco16ic->pf1_8bpp_mode)); |
| 986 | | |
| 987 | | save_pointer(NAME(deco16ic->pf1_data), 0x2000 / 2); |
| 988 | | save_pointer(NAME(deco16ic->pf2_data), 0x2000 / 2); |
| 989 | | save_pointer(NAME(deco16ic->pf12_control), 0x10 / 2); |
| 990 | | } |
| 991 | | |
| 992 | | //------------------------------------------------- |
| 993 | | // device_reset - device-specific reset |
| 994 | | //------------------------------------------------- |
| 995 | | |
| 996 | | void deco16ic_device::device_reset() |
| 997 | | { |
| 998 | | deco16ic_state *deco16ic = get_safe_token(this); |
| 999 | | |
| 1000 | | deco16ic->pf1_bank = deco16ic->pf2_bank = 0; |
| 1001 | | deco16ic->pf12_last_small = deco16ic->pf12_last_big = -1; |
| 1002 | | deco16ic->use_custom_pf1 = deco16ic->use_custom_pf2 = 0; |
| 1003 | | deco16ic->pf1_rowscroll_ptr = 0; |
| 1004 | | deco16ic->pf2_rowscroll_ptr = 0; |
| 1005 | | } |
trunk/src/mame/video/deco16ic.h
| r24015 | r24016 | |
| 23 | 23 | |
| 24 | 24 | struct deco16ic_interface |
| 25 | 25 | { |
| 26 | | const char *screen; |
| 27 | | int split; |
| 28 | | int full_width12; |
| 26 | const char *m_screen_tag; |
| 27 | int m_split; |
| 28 | int m_full_width12; |
| 29 | 29 | |
| 30 | | int trans_mask1, trans_mask2; |
| 31 | | int col_base1, col_base2; |
| 32 | | int col_mask1, col_mask2; |
| 33 | | deco16_bank_cb bank_cb0, bank_cb1; |
| 34 | | int _8x8_gfxregion, _16x16_gfxregion; |
| 30 | int m_pf1_trans_mask, m_pf2_trans_mask; |
| 31 | int m_pf1_colour_bank, m_pf2_colour_bank; |
| 32 | int m_pf1_colourmask, m_pf2_colourmask; |
| 33 | deco16_bank_cb m_bank_cb0, m_bank_cb1; |
| 34 | int m_pf12_8x8_gfx_bank, m_pf12_16x16_gfx_bank; |
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | | class deco16ic_device : public device_t |
| 37 | class deco16ic_device : public device_t, |
| 38 | public deco16ic_interface |
| 38 | 39 | { |
| 39 | 40 | public: |
| 40 | 41 | deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 41 | | ~deco16ic_device() { global_free(m_token); } |
| 42 | ~deco16ic_device() {} |
| 43 | |
| 44 | DECLARE_WRITE16_MEMBER( pf1_data_w ); |
| 45 | DECLARE_WRITE16_MEMBER( pf2_data_w ); |
| 42 | 46 | |
| 43 | | // access to legacy token |
| 44 | | void *token() const { assert(m_token != NULL); return m_token; } |
| 47 | DECLARE_READ16_MEMBER( pf1_data_r ); |
| 48 | DECLARE_READ16_MEMBER( pf2_data_r ); |
| 49 | |
| 50 | DECLARE_WRITE16_MEMBER( pf_control_w ); |
| 51 | |
| 52 | DECLARE_READ16_MEMBER( pf_control_r ); |
| 53 | |
| 54 | DECLARE_WRITE32_MEMBER( pf1_data_dword_w ); |
| 55 | DECLARE_WRITE32_MEMBER( pf2_data_dword_w ); |
| 56 | |
| 57 | DECLARE_READ32_MEMBER( pf1_data_dword_r ); |
| 58 | DECLARE_READ32_MEMBER( pf2_data_dword_r ); |
| 59 | |
| 60 | DECLARE_WRITE32_MEMBER( pf_control_dword_w ); |
| 61 | |
| 62 | DECLARE_READ32_MEMBER( pf_control_dword_r ); |
| 63 | |
| 64 | void print_debug_info(bitmap_ind16 &bitmap); |
| 65 | |
| 66 | void pf_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr); |
| 67 | |
| 68 | template<class _BitmapClass> |
| 69 | void tilemap_1_draw_common(_BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 70 | template<class _BitmapClass> |
| 71 | void tilemap_2_draw_common(_BitmapClass &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 72 | void tilemap_1_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 73 | void tilemap_1_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 74 | void tilemap_2_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 75 | void tilemap_2_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 76 | |
| 77 | /* used by boogwing, nitrobal */ |
| 78 | void tilemap_12_combine_draw(bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false); |
| 79 | void tilemap_12_combine_draw(bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false); |
| 80 | |
| 81 | /* used by robocop2 */ |
| 82 | void set_tilemap_colour_mask(int tmap, int mask); |
| 83 | void pf12_set_gfxbank(int small, int big); |
| 84 | |
| 85 | /* used by captaven */ |
| 86 | void set_pf1_8bpp_mode(int mode); |
| 87 | |
| 88 | /* used by stoneage */ |
| 89 | void set_scrolldx(int tmap, int size, int dx, int dx_if_flipped); |
| 90 | |
| 91 | /* used by cninjabl */ |
| 92 | void set_enable(int tmap, int enable ); |
| 93 | |
| 94 | template<class _BitmapClass> |
| 95 | void custom_tilemap_draw( |
| 96 | _BitmapClass &bitmap, |
| 97 | const rectangle &cliprect, |
| 98 | tilemap_t *tilemap0_8x8, |
| 99 | tilemap_t *tilemap0_16x16, |
| 100 | tilemap_t *tilemap1_8x8, |
| 101 | tilemap_t *tilemap1_16x16, |
| 102 | const UINT16 *rowscroll_ptr, |
| 103 | const UINT16 scrollx, |
| 104 | const UINT16 scrolly, |
| 105 | const UINT16 control0, |
| 106 | const UINT16 control1, |
| 107 | int combine_mask, |
| 108 | int combine_shift, |
| 109 | int trans_mask, |
| 110 | int flags, |
| 111 | UINT32 priority, |
| 112 | int is_tattoo |
| 113 | ); |
| 114 | |
| 45 | 115 | protected: |
| 46 | 116 | // device-level overrides |
| 47 | 117 | virtual void device_config_complete(); |
| 48 | 118 | virtual void device_start(); |
| 49 | 119 | virtual void device_reset(); |
| 120 | |
| 50 | 121 | private: |
| 51 | 122 | // internal state |
| 52 | | void *m_token; |
| 123 | screen_device *m_screen; |
| 53 | 124 | |
| 125 | UINT16 *m_pf1_data, *m_pf2_data; |
| 126 | UINT16 *m_pf12_control; |
| 127 | |
| 128 | const UINT16 *m_pf1_rowscroll_ptr, *m_pf2_rowscroll_ptr; |
| 129 | |
| 130 | tilemap_t *m_pf1_tilemap_16x16, *m_pf2_tilemap_16x16; |
| 131 | tilemap_t *m_pf1_tilemap_8x8, *m_pf2_tilemap_8x8; |
| 132 | |
| 133 | deco16_bank_cb m_bank_cb_func[2]; |
| 134 | |
| 135 | int m_use_custom_pf1, m_use_custom_pf2; |
| 136 | |
| 137 | int m_pf1_bank, m_pf2_bank; |
| 138 | |
| 139 | int m_pf12_last_small, m_pf12_last_big; |
| 140 | |
| 141 | int m_pf1_8bpp_mode; |
| 142 | |
| 54 | 143 | TILEMAP_MAPPER_MEMBER(deco16_scan_rows); |
| 55 | 144 | TILE_GET_INFO_MEMBER(get_pf2_tile_info); |
| 56 | 145 | TILE_GET_INFO_MEMBER(get_pf1_tile_info); |
| r24015 | r24016 | |
| 70 | 159 | MCFG_DEVICE_ADD(_tag, DECO16IC, 0) \ |
| 71 | 160 | MCFG_DEVICE_CONFIG(_interface) |
| 72 | 161 | |
| 73 | | /*************************************************************************** |
| 74 | | DEVICE I/O FUNCTIONS |
| 75 | | ***************************************************************************/ |
| 76 | 162 | |
| 77 | | DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf1_data_w ); |
| 78 | | DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf2_data_w ); |
| 79 | | |
| 80 | | DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf1_data_r ); |
| 81 | | DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf2_data_r ); |
| 82 | | |
| 83 | | DECLARE_WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w ); |
| 84 | | |
| 85 | | DECLARE_READ16_DEVICE_HANDLER( deco16ic_pf_control_r ); |
| 86 | | |
| 87 | | DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf1_data_dword_w ); |
| 88 | | DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf2_data_dword_w ); |
| 89 | | |
| 90 | | DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf1_data_dword_r ); |
| 91 | | DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf2_data_dword_r ); |
| 92 | | |
| 93 | | DECLARE_WRITE32_DEVICE_HANDLER( deco16ic_pf_control_dword_w ); |
| 94 | | |
| 95 | | DECLARE_READ32_DEVICE_HANDLER( deco16ic_pf_control_dword_r ); |
| 96 | | |
| 97 | | void deco16ic_print_debug_info(device_t *device, bitmap_ind16 &bitmap); |
| 98 | | |
| 99 | | void deco16ic_pf_update(device_t *device, const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr); |
| 100 | | |
| 101 | | void deco16ic_tilemap_1_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 102 | | void deco16ic_tilemap_1_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 103 | | void deco16ic_tilemap_2_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 104 | | void deco16ic_tilemap_2_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority); |
| 105 | | |
| 106 | | /* used by boogwing, nitrobal */ |
| 107 | | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false); |
| 108 | | void deco16ic_tilemap_12_combine_draw(device_t *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, int flags, UINT32 priority, int is_tattoo = false); |
| 109 | | |
| 110 | | /* used by robocop2 */ |
| 111 | | void deco16ic_set_tilemap_colour_mask(device_t *device, int tmap, int mask); |
| 112 | | void deco16ic_pf12_set_gfxbank(device_t *device, int small, int big); |
| 113 | | |
| 114 | | /* used by captaven */ |
| 115 | | void deco16ic_set_pf1_8bpp_mode(device_t *device, int mode); |
| 116 | | |
| 117 | | /* used by stoneage */ |
| 118 | | void deco16ic_set_scrolldx(device_t *device, int tmap, int size, int dx, int dx_if_flipped); |
| 119 | | |
| 120 | | /* used by cninjabl */ |
| 121 | | void deco16ic_set_enable( device_t *device, int tmap, int enable ); |
| 122 | | |
| 123 | 163 | #endif |