trunk/src/mame/drivers/taito_f2.c
| r23805 | r23806 | |
| 693 | 693 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff) |
| 694 | 694 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff) |
| 695 | 695 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 696 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 696 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 697 | 697 | AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP /* error in game init code ? */ |
| 698 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 698 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 699 | 699 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 700 | 700 | AM_RANGE(0xb00002, 0xb00003) AM_WRITENOP /* ?? */ |
| 701 | 701 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 707 | 707 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff) |
| 708 | 708 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 709 | 709 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 710 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 711 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 710 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 711 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 712 | 712 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 713 | 713 | AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE_LEGACY("tc0280grd", tc0280grd_word_r, tc0280grd_word_w) /* ROZ tilemap */ |
| 714 | 714 | AM_RANGE(0xa02000, 0xa0200f) AM_DEVWRITE_LEGACY("tc0280grd", tc0280grd_ctrl_word_w) |
| r23805 | r23806 | |
| 724 | 724 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 725 | 725 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| 726 | 726 | AM_RANGE(0x400000, 0x40001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 727 | | AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 727 | AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 728 | 728 | AM_RANGE(0x610000, 0x61ffff) AM_RAM /* unused? */ |
| 729 | | AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 729 | AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 730 | 730 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram") |
| 731 | 731 | ADDRESS_MAP_END |
| 732 | 732 | |
| r23805 | r23806 | |
| 737 | 737 | AM_RANGE(0x220000, 0x220001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 738 | 738 | AM_RANGE(0x220002, 0x220003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 739 | 739 | AM_RANGE(0x300000, 0x30ffff) AM_RAM |
| 740 | | AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE_LEGACY("tc0100scn_1", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 741 | | AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE_LEGACY("tc0100scn_1", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 742 | | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE_LEGACY("tc0100scn_2", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 743 | | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE_LEGACY("tc0100scn_2", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 740 | AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 741 | AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_device, ctrl_word_r, word_w) |
| 742 | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 743 | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 744 | 744 | AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram") |
| 745 | 745 | AM_RANGE(0x800000, 0x80001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0xff00) |
| 746 | 746 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 753 | 753 | AM_RANGE(0x300018, 0x30001f) AM_READ(cameltry_paddle_r) |
| 754 | 754 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 755 | 755 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 756 | | AM_RANGE(0x800000, 0x813fff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 757 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 756 | AM_RANGE(0x800000, 0x813fff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 757 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 758 | 758 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 759 | 759 | AM_RANGE(0xa00000, 0xa01fff) AM_DEVREADWRITE_LEGACY("tc0280grd", tc0280grd_word_r, tc0280grd_word_w) /* ROZ tilemap */ |
| 760 | 760 | AM_RANGE(0xa02000, 0xa0200f) AM_DEVWRITE_LEGACY("tc0280grd", tc0280grd_ctrl_word_w) |
| r23805 | r23806 | |
| 768 | 768 | AM_RANGE(0x500000, 0x50000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff) |
| 769 | 769 | AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 770 | 770 | AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 771 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 772 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 771 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 772 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 773 | 773 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 774 | 774 | AM_RANGE(0x910000, 0x9120ff) AM_WRITENOP /* error in init code ? */ |
| 775 | 775 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 781 | 781 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_device, read, write, 0x00ff) |
| 782 | 782 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff) |
| 783 | 783 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 784 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 785 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 784 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 785 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 786 | 786 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 787 | 787 | AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 788 | 788 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 802 | 802 | AM_RANGE(0x600000, 0x600001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0x00ff) |
| 803 | 803 | AM_RANGE(0x600002, 0x600003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0x00ff) |
| 804 | 804 | AM_RANGE(0x680000, 0x680001) AM_WRITENOP /* ??? */ |
| 805 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 805 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 806 | 806 | AM_RANGE(0x810000, 0x81ffff) AM_WRITENOP /* error in init code ? */ |
| 807 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 807 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 808 | 808 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 809 | 809 | ADDRESS_MAP_END |
| 810 | 810 | |
| r23805 | r23806 | |
| 816 | 816 | AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 817 | 817 | AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 818 | 818 | // AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* ?? */ |
| 819 | | AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (not used) */ |
| 820 | | AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 819 | AM_RANGE(0x600000, 0x60ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps (not used) */ |
| 820 | AM_RANGE(0x620000, 0x62000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 821 | 821 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram") /* sprite ram */ |
| 822 | 822 | ADDRESS_MAP_END |
| 823 | 823 | |
| r23805 | r23806 | |
| 828 | 828 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_wordswap_r, halfword_wordswap_w) |
| 829 | 829 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 830 | 830 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 831 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 832 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 831 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 832 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 833 | 833 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 834 | 834 | // AM_RANGE(0xa00000, 0xa00001) AM_WRITENOP /* ?? */ |
| 835 | 835 | AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| r23805 | r23806 | |
| 852 | 852 | AM_RANGE(0x504000, 0x504001) AM_WRITENOP /* unknown... various values */ |
| 853 | 853 | AM_RANGE(0x508000, 0x50800f) AM_READ_PORT("IN3") |
| 854 | 854 | AM_RANGE(0x50c000, 0x50c00f) AM_READ_PORT("IN4") |
| 855 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 856 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 855 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 856 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 857 | 857 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 858 | 858 | AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 859 | 859 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 870 | 870 | AM_RANGE(0x350000, 0x350001) AM_WRITENOP /* watchdog ? */ |
| 871 | 871 | AM_RANGE(0x360000, 0x360001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 872 | 872 | AM_RANGE(0x360002, 0x360003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 873 | | AM_RANGE(0x380000, 0x380001) AM_DEVWRITE_LEGACY("tc0100scn", tc0100scn_gfxbank_w) /* scr gfx bank select */ |
| 874 | | AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 875 | | AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 873 | AM_RANGE(0x380000, 0x380001) AM_DEVWRITE("tc0100scn", tc0100scn_device, gfxbank_w) /* scr gfx bank select */ |
| 874 | AM_RANGE(0x400000, 0x40ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 875 | AM_RANGE(0x420000, 0x42000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 876 | 876 | AM_RANGE(0x500000, 0x50ffff) AM_RAM AM_SHARE("spriteram") |
| 877 | 877 | ADDRESS_MAP_END |
| 878 | 878 | |
| r23805 | r23806 | |
| 905 | 905 | AM_RANGE(0x300000, 0x30000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
| 906 | 906 | AM_RANGE(0x320000, 0x320001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 907 | 907 | AM_RANGE(0x320002, 0x320003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 908 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 909 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 908 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 909 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 910 | 910 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 911 | 911 | AM_RANGE(0xa20000, 0xa20001) AM_WRITE(koshien_spritebank_w) |
| 912 | 912 | AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0xff00) |
| r23805 | r23806 | |
| 917 | 917 | AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
| 918 | 918 | AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 919 | 919 | AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 920 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 921 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 920 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 921 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 922 | 922 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 923 | 923 | AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| 924 | 924 | AM_RANGE(0xb00000, 0xb10fff) AM_RAM /* deliberate writes to $b10xxx, I think */ |
| r23805 | r23806 | |
| 936 | 936 | AM_RANGE(0x400000, 0x400001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 937 | 937 | AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 938 | 938 | AM_RANGE(0x600000, 0x60000f) AM_WRITE(taitof2_spritebank_w) |
| 939 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 940 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 939 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 940 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 941 | 941 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 942 | 942 | AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* b00002 written like a watchdog?! */ |
| 943 | 943 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 957 | 957 | AM_RANGE(0x400002, 0x400003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 958 | 958 | AM_RANGE(0x500000, 0x50000f) AM_WRITE(taitof2_spritebank_w) |
| 959 | 959 | AM_RANGE(0x504000, 0x504001) AM_WRITENOP /* unknown... various values */ |
| 960 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 961 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 960 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 961 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 962 | 962 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 963 | 963 | AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 964 | 964 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 971 | 971 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") |
| 972 | 972 | AM_RANGE(0x500000, 0x50ffff) AM_RAM |
| 973 | 973 | AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram") |
| 974 | | AM_RANGE(0x700000, 0x70ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 975 | | AM_RANGE(0x720000, 0x72000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 974 | AM_RANGE(0x700000, 0x70ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 975 | AM_RANGE(0x720000, 0x72000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 976 | 976 | ADDRESS_MAP_END |
| 977 | 977 | |
| 978 | 978 | static ADDRESS_MAP_START( pulirula_map, AS_PROGRAM, 16, taitof2_state ) |
| r23805 | r23806 | |
| 985 | 985 | // AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* ??? */ |
| 986 | 986 | AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext") |
| 987 | 987 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") |
| 988 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 989 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 988 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 989 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 990 | 990 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 991 | 991 | AM_RANGE(0xa00000, 0xa0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0xff00) |
| 992 | 992 | AM_RANGE(0xb00000, 0xb0000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
| r23805 | r23806 | |
| 1015 | 1015 | AM_RANGE(0x400000, 0x401fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") |
| 1016 | 1016 | AM_RANGE(0x500000, 0x50ffff) AM_RAM |
| 1017 | 1017 | AM_RANGE(0x600000, 0x60ffff) AM_RAM AM_SHARE("spriteram") |
| 1018 | | AM_RANGE(0x700000, 0x70ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1019 | | AM_RANGE(0x720000, 0x72000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1018 | AM_RANGE(0x700000, 0x70ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1019 | AM_RANGE(0x720000, 0x72000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1020 | 1020 | ADDRESS_MAP_END |
| 1021 | 1021 | |
| 1022 | 1022 | static ADDRESS_MAP_START( yesnoj_map, AS_PROGRAM, 16, taitof2_state ) |
| 1023 | 1023 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 1024 | 1024 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 1025 | 1025 | AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_SHARE("spriteram") |
| 1026 | | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1027 | | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1026 | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1027 | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1028 | 1028 | AM_RANGE(0x600000, 0x601fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| 1029 | 1029 | // AM_RANGE(0x700000, 0x70000b) AM_READ(yesnoj_unknown_r) /* what's this? */ |
| 1030 | 1030 | AM_RANGE(0x800000, 0x800001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| r23805 | r23806 | |
| 1067 | 1067 | AM_RANGE(0x600000, 0x60ffff) AM_RAM |
| 1068 | 1068 | AM_RANGE(0x700000, 0x70001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 1069 | 1069 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram") |
| 1070 | | AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1071 | | AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1070 | AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1071 | AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1072 | 1072 | AM_RANGE(0xa00000, 0xa00001) AM_DEVWRITE8("tc0140syt", tc0140syt_device, tc0140syt_port_w, 0xff00) |
| 1073 | 1073 | AM_RANGE(0xa00002, 0xa00003) AM_DEVREADWRITE8("tc0140syt", tc0140syt_device, tc0140syt_comm_r, tc0140syt_comm_w, 0xff00) |
| 1074 | 1074 | AM_RANGE(0xb00000, 0xb00001) AM_WRITENOP /* watchdog? */ |
| r23805 | r23806 | |
| 1082 | 1082 | AM_RANGE(0x500000, 0x500001) AM_WRITENOP /* watchdog ? */ |
| 1083 | 1083 | AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext") |
| 1084 | 1084 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| 1085 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1086 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1085 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1086 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1087 | 1087 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 1088 | 1088 | AM_RANGE(0xa00000, 0xa0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 1089 | 1089 | AM_RANGE(0xb00000, 0xb0000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
| r23805 | r23806 | |
| 1099 | 1099 | AM_RANGE(0x600000, 0x603fff) AM_WRITE(taitof2_sprite_extension_w) AM_SHARE("sprite_ext") |
| 1100 | 1100 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| 1101 | 1101 | AM_RANGE(0x800000, 0x80ffff) AM_RAM AM_SHARE("spriteram") |
| 1102 | | AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1103 | | AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1102 | AM_RANGE(0x900000, 0x90ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1103 | AM_RANGE(0x920000, 0x92000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1104 | 1104 | AM_RANGE(0xa00000, 0xa0000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
| 1105 | 1105 | AM_RANGE(0xb00000, 0xb0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| 1106 | 1106 | ADDRESS_MAP_END |
| r23805 | r23806 | |
| 1110 | 1110 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 1111 | 1111 | AM_RANGE(0x300000, 0x301fff) AM_RAM_WRITE(paletteram_RRRRGGGGBBBBxxxx_word_w) AM_SHARE("paletteram") |
| 1112 | 1112 | AM_RANGE(0x400000, 0x40ffff) AM_RAM AM_SHARE("spriteram") |
| 1113 | | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1114 | | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1113 | AM_RANGE(0x500000, 0x50ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1114 | AM_RANGE(0x520000, 0x52000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1115 | 1115 | AM_RANGE(0x600000, 0x67ffff) AM_ROM AM_REGION("extra", 0) /* extra data rom */ |
| 1116 | 1116 | AM_RANGE(0x700000, 0x70000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
| 1117 | 1117 | AM_RANGE(0x900000, 0x90001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0x00ff) /* ?? */ |
| r23805 | r23806 | |
| 1128 | 1128 | AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE_LEGACY("tc0430grw", tc0430grw_word_r, tc0430grw_word_w) /* ROZ tilemap */ |
| 1129 | 1129 | AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE_LEGACY("tc0430grw", tc0430grw_ctrl_word_w) |
| 1130 | 1130 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") |
| 1131 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1132 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1131 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1132 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1133 | 1133 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 1134 | 1134 | AM_RANGE(0xa00000, 0xa0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0xff00) |
| 1135 | 1135 | AM_RANGE(0xb00000, 0xb0000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
| r23805 | r23806 | |
| 1145 | 1145 | AM_RANGE(0x400000, 0x401fff) AM_DEVREADWRITE_LEGACY("tc0430grw", tc0430grw_word_r, tc0430grw_word_w) /* ROZ tilemap */ |
| 1146 | 1146 | AM_RANGE(0x402000, 0x40200f) AM_DEVWRITE_LEGACY("tc0430grw", tc0430grw_ctrl_word_w) |
| 1147 | 1147 | AM_RANGE(0x700000, 0x701fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") |
| 1148 | | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps */ |
| 1149 | | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE_LEGACY("tc0100scn", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w) |
| 1148 | AM_RANGE(0x800000, 0x80ffff) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, word_r, word_w) /* tilemaps */ |
| 1149 | AM_RANGE(0x820000, 0x82000f) AM_DEVREADWRITE("tc0100scn", tc0100scn_device, ctrl_word_r, ctrl_word_w) |
| 1150 | 1150 | AM_RANGE(0x900000, 0x90ffff) AM_RAM AM_SHARE("spriteram") |
| 1151 | 1151 | AM_RANGE(0xa00000, 0xa0001f) AM_DEVWRITE8_LEGACY("tc0360pri", tc0360pri_w, 0xff00) |
| 1152 | 1152 | AM_RANGE(0xb00000, 0xb0000f) AM_DEVREADWRITE("tc0510nio", tc0510nio_device, halfword_r, halfword_w) |
trunk/src/mame/video/taitoic.c
| r23805 | r23806 | |
| 1163 | 1163 | /* */ |
| 1164 | 1164 | /***************************************************************************/ |
| 1165 | 1165 | |
| 1166 | | struct tc0080vco_state |
| 1167 | | { |
| 1168 | | UINT16 * ram; |
| 1169 | | UINT16 * bg0_ram_0; |
| 1170 | | UINT16 * bg0_ram_1; |
| 1171 | | UINT16 * bg1_ram_0; |
| 1172 | | UINT16 * bg1_ram_1; |
| 1173 | | UINT16 * tx_ram_0; |
| 1174 | | UINT16 * tx_ram_1; |
| 1175 | | UINT16 * char_ram; |
| 1176 | | UINT16 * bgscroll_ram; |
| 1177 | | |
| 1178 | | /* FIXME: This sprite related stuff still needs to be accessed in |
| 1179 | | video/taito_h */ |
| 1180 | | UINT16 * chain_ram_0; |
| 1181 | | UINT16 * chain_ram_1; |
| 1182 | | UINT16 * spriteram; |
| 1183 | | UINT16 * scroll_ram; |
| 1184 | | |
| 1185 | | UINT16 bg0_scrollx; |
| 1186 | | UINT16 bg0_scrolly; |
| 1187 | | UINT16 bg1_scrollx; |
| 1188 | | UINT16 bg1_scrolly; |
| 1189 | | |
| 1190 | | tilemap_t *tilemap[3]; |
| 1191 | | |
| 1192 | | int bg_gfx, tx_gfx; |
| 1193 | | int bg_xoffs, bg_yoffs; |
| 1194 | | int bg_flip_yoffs; |
| 1195 | | |
| 1196 | | INT32 flipscreen; |
| 1197 | | int has_tx; |
| 1198 | | }; |
| 1199 | | |
| 1200 | 1166 | #define TC0080VCO_RAM_SIZE 0x21000 |
| 1201 | 1167 | #define TC0080VCO_CHAR_RAM_SIZE 0x2000 |
| 1202 | 1168 | #define TC0080VCO_TOTAL_CHARS 256 |
| 1203 | 1169 | |
| 1170 | |
| 1204 | 1171 | /***************************************************************************** |
| 1205 | | INLINE FUNCTIONS |
| 1172 | DEVICE INTERFACE |
| 1206 | 1173 | *****************************************************************************/ |
| 1207 | 1174 | |
| 1208 | | INLINE tc0080vco_state *tc0080vco_get_safe_token( device_t *device ) |
| 1175 | |
| 1176 | const device_type TC0080VCO = &device_creator<tc0080vco_device>; |
| 1177 | |
| 1178 | tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1179 | : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock) |
| 1209 | 1180 | { |
| 1210 | | assert(device != NULL); |
| 1211 | | assert(device->type() == TC0080VCO); |
| 1181 | } |
| 1212 | 1182 | |
| 1213 | | return (tc0080vco_state *)downcast<tc0080vco_device *>(device)->token(); |
| 1183 | //------------------------------------------------- |
| 1184 | // device_config_complete - perform any |
| 1185 | // operations now that the configuration is |
| 1186 | // complete |
| 1187 | //------------------------------------------------- |
| 1188 | |
| 1189 | void tc0080vco_device::device_config_complete() |
| 1190 | { |
| 1191 | // inherit a copy of the static data |
| 1192 | const tc0080vco_interface *intf = reinterpret_cast<const tc0080vco_interface *>(static_config()); |
| 1193 | if (intf != NULL) |
| 1194 | *static_cast<tc0080vco_interface *>(this) = *intf; |
| 1195 | |
| 1196 | // or initialize to defaults if none provided |
| 1197 | else |
| 1198 | { |
| 1199 | } |
| 1214 | 1200 | } |
| 1215 | 1201 | |
| 1216 | | INLINE const tc0080vco_interface *tc0080vco_get_interface( device_t *device ) |
| 1202 | //------------------------------------------------- |
| 1203 | // device_start - device-specific startup |
| 1204 | //------------------------------------------------- |
| 1205 | |
| 1206 | void tc0080vco_device::device_start() |
| 1217 | 1207 | { |
| 1218 | | assert(device != NULL); |
| 1219 | | assert((device->type() == TC0080VCO)); |
| 1220 | | return (const tc0080vco_interface *) device->static_config(); |
| 1208 | /* Is this endian-correct ??? */ |
| 1209 | |
| 1210 | #define XOR(a) WORD_XOR_BE(a) |
| 1211 | |
| 1212 | static const gfx_layout charlayout = |
| 1213 | { |
| 1214 | 8, 8, /* 8x8 pixels */ |
| 1215 | 256, /* 256 chars */ |
| 1216 | 3, /* 3 bits per pixel */ |
| 1217 | { 0x10000*8 + XOR(2)*4, XOR(0)*4, XOR(2)*4 }, |
| 1218 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 1219 | { 16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7 }, |
| 1220 | 16*8 |
| 1221 | }; |
| 1222 | |
| 1223 | m_tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 1224 | m_tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 1225 | |
| 1226 | m_tilemap[0]->set_transparent_pen(0); |
| 1227 | m_tilemap[1]->set_transparent_pen(0); |
| 1228 | |
| 1229 | m_tilemap[0]->set_scrolldx(m_bg_xoffs, 512); |
| 1230 | m_tilemap[1]->set_scrolldx(m_bg_xoffs, 512); |
| 1231 | m_tilemap[0]->set_scrolldy(m_bg_yoffs, m_bg_flip_yoffs); |
| 1232 | m_tilemap[1]->set_scrolldy(m_bg_yoffs, m_bg_flip_yoffs); |
| 1233 | |
| 1234 | /* bg0 tilemap scrollable per pixel row */ |
| 1235 | m_tilemap[0]->set_scroll_rows(512); |
| 1236 | |
| 1237 | /* Perform extra initialisations for text layer */ |
| 1238 | m_tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 1239 | |
| 1240 | m_tilemap[2]->set_scrolldx(0, 0); |
| 1241 | m_tilemap[2]->set_scrolldy(48, -448); |
| 1242 | |
| 1243 | m_tilemap[2]->set_transparent_pen(0); |
| 1244 | |
| 1245 | m_ram = auto_alloc_array_clear(machine(), UINT16, TC0080VCO_RAM_SIZE / 2); |
| 1246 | |
| 1247 | m_char_ram = m_ram + 0x00000 / 2; /* continues at +0x10000 */ |
| 1248 | m_tx_ram_0 = m_ram + 0x01000 / 2; |
| 1249 | m_chain_ram_0 = m_ram + 0x00000 / 2; /* only used from +0x2000 */ |
| 1250 | |
| 1251 | m_bg0_ram_0 = m_ram + 0x0c000 / 2; |
| 1252 | m_bg1_ram_0 = m_ram + 0x0e000 / 2; |
| 1253 | |
| 1254 | m_tx_ram_1 = m_ram + 0x11000 / 2; |
| 1255 | m_chain_ram_1 = m_ram + 0x10000 / 2; /* only used from +0x12000 */ |
| 1256 | |
| 1257 | m_bg0_ram_1 = m_ram + 0x1c000 / 2; |
| 1258 | m_bg1_ram_1 = m_ram + 0x1e000 / 2; |
| 1259 | m_bgscroll_ram = m_ram + 0x20000 / 2; |
| 1260 | m_spriteram = m_ram + 0x20400 / 2; |
| 1261 | m_scroll_ram = m_ram + 0x20800 / 2; |
| 1262 | |
| 1263 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 1264 | machine().gfx[m_txnum] = auto_alloc(machine(), gfx_element(machine(), charlayout, (UINT8 *)m_char_ram, 64, 0)); |
| 1265 | |
| 1266 | save_pointer(NAME(m_ram), TC0080VCO_RAM_SIZE / 2); |
| 1267 | machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_device::postload), this)); |
| 1221 | 1268 | } |
| 1222 | 1269 | |
| 1270 | |
| 1223 | 1271 | /***************************************************************************** |
| 1224 | 1272 | DEVICE HANDLERS |
| 1225 | 1273 | *****************************************************************************/ |
| r23805 | r23806 | |
| 1242 | 1290 | #endif |
| 1243 | 1291 | |
| 1244 | 1292 | |
| 1245 | | TILE_GET_INFO_MEMBER(tc0080vco_device::tc0080vco_get_bg0_tile_info) |
| 1293 | TILE_GET_INFO_MEMBER(tc0080vco_device::get_bg0_tile_info) |
| 1246 | 1294 | { |
| 1247 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this); |
| 1248 | 1295 | int color, tile; |
| 1249 | 1296 | |
| 1250 | | color = tc0080vco->bg0_ram_1[tile_index] & 0x001f; |
| 1251 | | tile = tc0080vco->bg0_ram_0[tile_index] & 0x7fff; |
| 1297 | color = m_bg0_ram_1[tile_index] & 0x001f; |
| 1298 | tile = m_bg0_ram_0[tile_index] & 0x7fff; |
| 1252 | 1299 | |
| 1253 | 1300 | tileinfo.category = 0; |
| 1254 | 1301 | |
| 1255 | 1302 | SET_TILE_INFO_MEMBER( |
| 1256 | | tc0080vco->bg_gfx, |
| 1303 | m_gfxnum, |
| 1257 | 1304 | tile, |
| 1258 | 1305 | color, |
| 1259 | | TILE_FLIPYX((tc0080vco->bg0_ram_1[tile_index] & 0x00c0) >> 6)); |
| 1306 | TILE_FLIPYX((m_bg0_ram_1[tile_index] & 0x00c0) >> 6)); |
| 1260 | 1307 | } |
| 1261 | 1308 | |
| 1262 | | TILE_GET_INFO_MEMBER(tc0080vco_device::tc0080vco_get_bg1_tile_info) |
| 1309 | TILE_GET_INFO_MEMBER(tc0080vco_device::get_bg1_tile_info) |
| 1263 | 1310 | { |
| 1264 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this); |
| 1265 | 1311 | int color, tile; |
| 1266 | 1312 | |
| 1267 | | color = tc0080vco->bg1_ram_1[tile_index] & 0x001f; |
| 1268 | | tile = tc0080vco->bg1_ram_0[tile_index] & 0x7fff; |
| 1313 | color = m_bg1_ram_1[tile_index] & 0x001f; |
| 1314 | tile = m_bg1_ram_0[tile_index] & 0x7fff; |
| 1269 | 1315 | |
| 1270 | 1316 | tileinfo.category = 0; |
| 1271 | 1317 | |
| 1272 | 1318 | SET_TILE_INFO_MEMBER( |
| 1273 | | tc0080vco->bg_gfx, |
| 1319 | m_gfxnum, |
| 1274 | 1320 | tile, |
| 1275 | 1321 | color, |
| 1276 | | TILE_FLIPYX((tc0080vco->bg1_ram_1[tile_index] & 0x00c0) >> 6)); |
| 1322 | TILE_FLIPYX((m_bg1_ram_1[tile_index] & 0x00c0) >> 6)); |
| 1277 | 1323 | } |
| 1278 | 1324 | |
| 1279 | | TILE_GET_INFO_MEMBER(tc0080vco_device::tc0080vco_get_tx_tile_info) |
| 1325 | TILE_GET_INFO_MEMBER(tc0080vco_device::get_tx_tile_info) |
| 1280 | 1326 | { |
| 1281 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this); |
| 1282 | 1327 | int tile; |
| 1283 | 1328 | |
| 1284 | | if (!tc0080vco->flipscreen) |
| 1329 | if (!m_flipscreen) |
| 1285 | 1330 | { |
| 1286 | 1331 | if ((tile_index & 1)) |
| 1287 | | tile = (tc0080vco->tx_ram_0[tile_index >> 1] & 0x00ff); |
| 1332 | tile = (m_tx_ram_0[tile_index >> 1] & 0x00ff); |
| 1288 | 1333 | else |
| 1289 | | tile = (tc0080vco->tx_ram_0[tile_index >> 1] & 0xff00) >> 8; |
| 1334 | tile = (m_tx_ram_0[tile_index >> 1] & 0xff00) >> 8; |
| 1290 | 1335 | tileinfo.category = 0; |
| 1291 | 1336 | } |
| 1292 | 1337 | else |
| 1293 | 1338 | { |
| 1294 | 1339 | if ((tile_index & 1)) |
| 1295 | | tile = (tc0080vco->tx_ram_0[tile_index >> 1] & 0xff00) >> 8; |
| 1340 | tile = (m_tx_ram_0[tile_index >> 1] & 0xff00) >> 8; |
| 1296 | 1341 | else |
| 1297 | | tile = (tc0080vco->tx_ram_0[tile_index >> 1] & 0x00ff); |
| 1342 | tile = (m_tx_ram_0[tile_index >> 1] & 0x00ff); |
| 1298 | 1343 | tileinfo.category = 0; |
| 1299 | 1344 | } |
| 1300 | 1345 | |
| 1301 | 1346 | SET_TILE_INFO_MEMBER( |
| 1302 | | tc0080vco->tx_gfx, |
| 1347 | m_txnum, |
| 1303 | 1348 | tile, |
| 1304 | 1349 | 0x40, |
| 1305 | 1350 | 0); /* 0x20<<1 as 3bpp */ |
| 1306 | 1351 | } |
| 1307 | 1352 | |
| 1308 | 1353 | |
| 1309 | | /* Is this endian-correct ??? */ |
| 1310 | | |
| 1311 | | #define XOR(a) WORD_XOR_BE(a) |
| 1312 | | |
| 1313 | | static const gfx_layout tc0080vco_charlayout = |
| 1354 | WRITE16_MEMBER( tc0080vco_device::scrollram_w ) |
| 1314 | 1355 | { |
| 1315 | | 8, 8, /* 8x8 pixels */ |
| 1316 | | 256, /* 256 chars */ |
| 1317 | | 3, /* 3 bits per pixel */ |
| 1318 | | { 0x10000*8 + XOR(2)*4, XOR(0)*4, XOR(2)*4 }, |
| 1319 | | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 1320 | | { 16*0, 16*1, 16*2, 16*3, 16*4, 16*5, 16*6, 16*7 }, |
| 1321 | | 16*8 |
| 1322 | | }; |
| 1323 | | |
| 1324 | | static WRITE16_DEVICE_HANDLER( tc0080vco_scrollram_w ) |
| 1325 | | { |
| 1326 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1327 | | |
| 1328 | 1356 | switch (offset) |
| 1329 | 1357 | { |
| 1330 | 1358 | case 0x00: /* screen invert control */ |
| 1331 | | tc0080vco->flipscreen = tc0080vco->scroll_ram[0] & 0x0c00; |
| 1359 | m_flipscreen = m_scroll_ram[0] & 0x0c00; |
| 1332 | 1360 | |
| 1333 | | tc0080vco->tilemap[0]->set_flip(tc0080vco->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1334 | | tc0080vco->tilemap[1]->set_flip(tc0080vco->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1335 | | tc0080vco->tilemap[2]->set_flip(tc0080vco->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1361 | m_tilemap[0]->set_flip(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1362 | m_tilemap[1]->set_flip(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1363 | m_tilemap[2]->set_flip(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1336 | 1364 | |
| 1337 | | tc0080vco->bg0_scrollx = tc0080vco->scroll_ram[1] & 0x03ff; |
| 1338 | | tc0080vco->bg1_scrollx = tc0080vco->scroll_ram[2] & 0x03ff; |
| 1339 | | tc0080vco->bg0_scrolly = tc0080vco->scroll_ram[3] & 0x03ff; |
| 1340 | | tc0080vco->bg1_scrolly = tc0080vco->scroll_ram[4] & 0x03ff; |
| 1365 | m_bg0_scrollx = m_scroll_ram[1] & 0x03ff; |
| 1366 | m_bg1_scrollx = m_scroll_ram[2] & 0x03ff; |
| 1367 | m_bg0_scrolly = m_scroll_ram[3] & 0x03ff; |
| 1368 | m_bg1_scrolly = m_scroll_ram[4] & 0x03ff; |
| 1341 | 1369 | break; |
| 1342 | 1370 | |
| 1343 | 1371 | case 0x01: /* BG0 scroll X */ |
| 1344 | | tc0080vco->bg0_scrollx = data & 0x03ff; |
| 1372 | m_bg0_scrollx = data & 0x03ff; |
| 1345 | 1373 | break; |
| 1346 | 1374 | |
| 1347 | 1375 | case 0x02: /* BG1 scroll X */ |
| 1348 | | tc0080vco->bg1_scrollx = data & 0x03ff; |
| 1376 | m_bg1_scrollx = data & 0x03ff; |
| 1349 | 1377 | break; |
| 1350 | 1378 | |
| 1351 | 1379 | case 0x03: /* BG0 scroll Y */ |
| 1352 | | tc0080vco->bg0_scrolly = data & 0x03ff; |
| 1380 | m_bg0_scrolly = data & 0x03ff; |
| 1353 | 1381 | break; |
| 1354 | 1382 | |
| 1355 | 1383 | case 0x04: /* BG1 scroll Y */ |
| 1356 | | tc0080vco->bg1_scrolly = data & 0x03ff; |
| 1384 | m_bg1_scrolly = data & 0x03ff; |
| 1357 | 1385 | break; |
| 1358 | 1386 | |
| 1359 | 1387 | default: |
| r23805 | r23806 | |
| 1361 | 1389 | } |
| 1362 | 1390 | } |
| 1363 | 1391 | |
| 1364 | | READ16_DEVICE_HANDLER( tc0080vco_word_r ) |
| 1392 | READ16_MEMBER( tc0080vco_device::word_r ) |
| 1365 | 1393 | { |
| 1366 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1367 | | return tc0080vco->ram[offset]; |
| 1394 | return m_ram[offset]; |
| 1368 | 1395 | } |
| 1369 | 1396 | |
| 1370 | | WRITE16_DEVICE_HANDLER( tc0080vco_word_w ) |
| 1397 | WRITE16_MEMBER( tc0080vco_device::word_w ) |
| 1371 | 1398 | { |
| 1372 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1399 | COMBINE_DATA(&m_ram[offset]); |
| 1373 | 1400 | |
| 1374 | | COMBINE_DATA(&tc0080vco->ram[offset]); |
| 1375 | | |
| 1376 | 1401 | /* A lot of tc0080vco writes require no action... */ |
| 1377 | 1402 | |
| 1378 | 1403 | if (offset < 0x1000 / 2) |
| 1379 | 1404 | { |
| 1380 | | space.machine().gfx[tc0080vco->tx_gfx]->mark_dirty(offset / 8); |
| 1405 | space.machine().gfx[m_txnum]->mark_dirty(offset / 8); |
| 1381 | 1406 | #if 0 |
| 1382 | | if (!tc0080vco->has_tx) |
| 1407 | if (!m_has_fg0) |
| 1383 | 1408 | { |
| 1384 | | if (tc0080vco->ram[offset]) |
| 1409 | if (m_ram[offset]) |
| 1385 | 1410 | popmessage("Write non-zero to tc0080vco char ram\nPlease report to MAMEDEV"); |
| 1386 | 1411 | } |
| 1387 | 1412 | #endif |
| 1388 | 1413 | } |
| 1389 | 1414 | else if (offset < 0x2000 / 2) /* fg0 (text layer) */ |
| 1390 | 1415 | { |
| 1391 | | tc0080vco->tilemap[2]->mark_tile_dirty((offset & 0x07ff) * 2); |
| 1392 | | tc0080vco->tilemap[2]->mark_tile_dirty((offset & 0x07ff) * 2 + 1); |
| 1416 | m_tilemap[2]->mark_tile_dirty((offset & 0x07ff) * 2); |
| 1417 | m_tilemap[2]->mark_tile_dirty((offset & 0x07ff) * 2 + 1); |
| 1393 | 1418 | #if 0 |
| 1394 | | if (!tc0080vco->has_tx) |
| 1419 | if (!m_has_fg0) |
| 1395 | 1420 | { |
| 1396 | | if (tc0080vco->ram[offset]) |
| 1421 | if (m_ram[offset]) |
| 1397 | 1422 | popmessage("Write non-zero to tc0080vco fg0\nPlease report to MAMEDEV"); |
| 1398 | 1423 | } |
| 1399 | 1424 | #endif |
| r23805 | r23806 | |
| 1401 | 1426 | else if (offset < 0xc000 / 2) /* chain ram */ |
| 1402 | 1427 | {} |
| 1403 | 1428 | else if (offset < 0xe000 / 2) /* bg0 (0) */ |
| 1404 | | tc0080vco->tilemap[0]->mark_tile_dirty((offset & 0xfff)); |
| 1429 | m_tilemap[0]->mark_tile_dirty((offset & 0xfff)); |
| 1405 | 1430 | |
| 1406 | 1431 | else if (offset < 0x10000 / 2) /* bg1 (0) */ |
| 1407 | | tc0080vco->tilemap[1]->mark_tile_dirty((offset & 0xfff)); |
| 1432 | m_tilemap[1]->mark_tile_dirty((offset & 0xfff)); |
| 1408 | 1433 | |
| 1409 | 1434 | else if (offset < 0x11000 / 2) |
| 1410 | 1435 | { |
| 1411 | | space.machine().gfx[tc0080vco->tx_gfx]->mark_dirty((offset - 0x10000 / 2) / 8); |
| 1436 | space.machine().gfx[m_txnum]->mark_dirty((offset - 0x10000 / 2) / 8); |
| 1412 | 1437 | #if 0 |
| 1413 | | if (!tc0080vco->has_tx) |
| 1438 | if (!m_has_fg0) |
| 1414 | 1439 | { |
| 1415 | | if (tc0080vco->ram[offset]) |
| 1440 | if (m_ram[offset]) |
| 1416 | 1441 | popmessage("Write non-zero to tc0080vco char-hi ram\nPlease report to MAMEDEV"); |
| 1417 | 1442 | } |
| 1418 | 1443 | #endif |
| r23805 | r23806 | |
| 1420 | 1445 | else if (offset < 0x12000 / 2) /* unknown/unused */ |
| 1421 | 1446 | { |
| 1422 | 1447 | #if 1 |
| 1423 | | if (tc0080vco->ram[offset]) |
| 1448 | if (m_ram[offset]) |
| 1424 | 1449 | popmessage("Write non-zero to mystery tc0080vco area\nPlease report to MAMEDEV"); |
| 1425 | 1450 | #endif |
| 1426 | 1451 | } |
| 1427 | 1452 | else if (offset < 0x1c000 / 2) /* chain ram */ |
| 1428 | 1453 | {} |
| 1429 | 1454 | else if (offset < 0x1e000 / 2) /* bg0 (1) */ |
| 1430 | | tc0080vco->tilemap[0]->mark_tile_dirty((offset & 0xfff)); |
| 1455 | m_tilemap[0]->mark_tile_dirty((offset & 0xfff)); |
| 1431 | 1456 | |
| 1432 | 1457 | else if (offset < 0x20000 / 2) /* bg1 (1) */ |
| 1433 | | tc0080vco->tilemap[1]->mark_tile_dirty((offset & 0xfff)); |
| 1458 | m_tilemap[1]->mark_tile_dirty((offset & 0xfff)); |
| 1434 | 1459 | |
| 1435 | 1460 | else if (offset < 0x20400 / 2) /* bg0 rowscroll */ |
| 1436 | 1461 | {} |
| 1437 | 1462 | else if (offset < 0x20800 / 2) /* sprite ram */ |
| 1438 | 1463 | {} |
| 1439 | 1464 | else if (offset < 0x20fff / 2) |
| 1440 | | tc0080vco_scrollram_w(device, space, offset - (0x20800 / 2), tc0080vco->ram[offset], mem_mask); |
| 1465 | scrollram_w(space, offset - (0x20800 / 2), m_ram[offset], mem_mask); |
| 1441 | 1466 | } |
| 1442 | 1467 | |
| 1443 | | void tc0080vco_tilemap_update( device_t *device ) |
| 1468 | void tc0080vco_device::tilemap_update( ) |
| 1444 | 1469 | { |
| 1445 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1446 | 1470 | int j; |
| 1447 | 1471 | |
| 1448 | | if (!tc0080vco->flipscreen) |
| 1472 | if (!m_flipscreen) |
| 1449 | 1473 | { |
| 1450 | 1474 | for (j = 0; j < 0x400; j++) |
| 1451 | | tc0080vco->tilemap[0]->set_scrollx((j + 0) & 0x3ff, -tc0080vco->bg0_scrollx - tc0080vco->bgscroll_ram[j & 0x1ff]); |
| 1475 | m_tilemap[0]->set_scrollx((j + 0) & 0x3ff, -m_bg0_scrollx - m_bgscroll_ram[j & 0x1ff]); |
| 1452 | 1476 | } |
| 1453 | 1477 | else |
| 1454 | 1478 | { |
| 1455 | 1479 | for (j = 0; j < 0x400; j++) |
| 1456 | | tc0080vco->tilemap[0]->set_scrollx((j + 0) & 0x3ff, -tc0080vco->bg0_scrollx + tc0080vco->bgscroll_ram[j & 0x1ff]); |
| 1480 | m_tilemap[0]->set_scrollx((j + 0) & 0x3ff, -m_bg0_scrollx + m_bgscroll_ram[j & 0x1ff]); |
| 1457 | 1481 | } |
| 1458 | 1482 | |
| 1459 | | tc0080vco->tilemap[0]->set_scrolly(0, tc0080vco->bg0_scrolly); |
| 1460 | | tc0080vco->tilemap[1]->set_scrollx(0, -tc0080vco->bg1_scrollx); |
| 1461 | | tc0080vco->tilemap[1]->set_scrolly(0, tc0080vco->bg1_scrolly); |
| 1462 | | tc0080vco->tilemap[2]->set_scrollx(0, 0); /* no scroll (maybe) */ |
| 1463 | | tc0080vco->tilemap[2]->set_scrolly(0, 0); |
| 1483 | m_tilemap[0]->set_scrolly(0, m_bg0_scrolly); |
| 1484 | m_tilemap[1]->set_scrollx(0, -m_bg1_scrollx); |
| 1485 | m_tilemap[1]->set_scrolly(0, m_bg1_scrolly); |
| 1486 | m_tilemap[2]->set_scrollx(0, 0); /* no scroll (maybe) */ |
| 1487 | m_tilemap[2]->set_scrolly(0, 0); |
| 1464 | 1488 | } |
| 1465 | 1489 | |
| 1466 | 1490 | |
| 1467 | 1491 | /* NB: orientation_flipx code in following routine has not been tested */ |
| 1468 | 1492 | |
| 1469 | | static void tc0080vco_bg0_tilemap_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 1493 | void tc0080vco_device::bg0_tilemap_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 1470 | 1494 | { |
| 1471 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1472 | | UINT16 zoom = tc0080vco->scroll_ram[6]; |
| 1495 | UINT16 zoom = m_scroll_ram[6]; |
| 1473 | 1496 | int zx, zy; |
| 1474 | 1497 | |
| 1475 | 1498 | zx = (zoom & 0xff00) >> 8; |
| r23805 | r23806 | |
| 1477 | 1500 | |
| 1478 | 1501 | if (zx == 0x3f && zy == 0x7f) /* normal size */ |
| 1479 | 1502 | { |
| 1480 | | tc0080vco->tilemap[0]->draw(bitmap, cliprect, flags, priority); |
| 1503 | m_tilemap[0]->draw(bitmap, cliprect, flags, priority); |
| 1481 | 1504 | } |
| 1482 | 1505 | else /* zoom + rowscroll = custom draw routine */ |
| 1483 | 1506 | { |
| 1484 | 1507 | UINT16 *dst16, *src16; |
| 1485 | 1508 | UINT8 *tsrc; |
| 1486 | 1509 | UINT16 scanline[512]; |
| 1487 | | bitmap_ind16 &srcbitmap = tc0080vco->tilemap[0]->pixmap(); |
| 1488 | | bitmap_ind8 &flagsbitmap = tc0080vco->tilemap[0]->flagsmap(); |
| 1510 | bitmap_ind16 &srcbitmap = m_tilemap[0]->pixmap(); |
| 1511 | bitmap_ind8 &flagsbitmap = m_tilemap[0]->flagsmap(); |
| 1489 | 1512 | |
| 1490 | 1513 | int sx, zoomx, zoomy; |
| 1491 | 1514 | int dx, ex, dy, ey; |
| 1492 | 1515 | int i, y, y_index, src_y_index, row_index; |
| 1493 | 1516 | int x_index, x_step; |
| 1494 | 1517 | |
| 1495 | | int flip = tc0080vco->flipscreen; |
| 1518 | int flip = m_flipscreen; |
| 1496 | 1519 | int machine_flip = 0; /* for ROT 180 ? */ |
| 1497 | 1520 | |
| 1498 | 1521 | int min_x = cliprect.min_x; |
| r23805 | r23806 | |
| 1539 | 1562 | |
| 1540 | 1563 | if (!flip) |
| 1541 | 1564 | { |
| 1542 | | sx = (-tc0080vco->scroll_ram[1] - 1) << 16; |
| 1543 | | y_index = (( tc0080vco->scroll_ram[3] - 1) << 16) + min_y * zoomy; |
| 1565 | sx = (-m_scroll_ram[1] - 1) << 16; |
| 1566 | y_index = (( m_scroll_ram[3] - 1) << 16) + min_y * zoomy; |
| 1544 | 1567 | } |
| 1545 | 1568 | else |
| 1546 | 1569 | { |
| 1547 | 1570 | /* adjustment for zx is entirely speculative */ |
| 1548 | | sx = (( 0x200 + tc0080vco->scroll_ram[1]) << 16) - (max_x + min_x) * (zoomx - 0x10000); |
| 1571 | sx = (( 0x200 + m_scroll_ram[1]) << 16) - (max_x + min_x) * (zoomx - 0x10000); |
| 1549 | 1572 | |
| 1550 | 1573 | /* 0x130 correct for Dleague. Syvalion correct with 0x1f0. min_y is 0x20 and 0x30; max_y is 0x10f and 0x1bf; max_y + min_y seems a good bet... */ |
| 1551 | | y_index = ((-tc0080vco->scroll_ram[3] - 2) << 16) + min_y * zoomy - (max_y + min_y) * (zoomy - 0x10000); |
| 1574 | y_index = ((-m_scroll_ram[3] - 2) << 16) + min_y * zoomy - (max_y + min_y) * (zoomy - 0x10000); |
| 1552 | 1575 | } |
| 1553 | 1576 | |
| 1554 | 1577 | if (!machine_flip) |
| r23805 | r23806 | |
| 1565 | 1588 | if (flip) |
| 1566 | 1589 | row_index = 0x1ff - row_index; |
| 1567 | 1590 | |
| 1568 | | x_index = sx - ((tc0080vco->bgscroll_ram[row_index] << 16)); |
| 1591 | x_index = sx - ((m_bgscroll_ram[row_index] << 16)); |
| 1569 | 1592 | |
| 1570 | 1593 | src16 = &srcbitmap.pix16(src_y_index); |
| 1571 | 1594 | tsrc = &flagsbitmap.pix8(src_y_index); |
| r23805 | r23806 | |
| 1593 | 1616 | } |
| 1594 | 1617 | } |
| 1595 | 1618 | |
| 1596 | | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, device->machine().priority_bitmap, priority); |
| 1619 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, machine().priority_bitmap, priority); |
| 1597 | 1620 | |
| 1598 | 1621 | y_index += zoomy; |
| 1599 | 1622 | |
| r23805 | r23806 | |
| 1618 | 1641 | } \ |
| 1619 | 1642 | } \ |
| 1620 | 1643 | while (0) |
| 1621 | | static void tc0080vco_bg1_tilemap_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 1644 | void tc0080vco_device::bg1_tilemap_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int flags, UINT32 priority ) |
| 1622 | 1645 | { |
| 1623 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1624 | 1646 | UINT8 layer = 1; |
| 1625 | | UINT16 zoom = tc0080vco->scroll_ram[6 + layer]; |
| 1647 | UINT16 zoom = m_scroll_ram[6 + layer]; |
| 1626 | 1648 | int min_x = cliprect.min_x; |
| 1627 | 1649 | int max_x = cliprect.max_x; |
| 1628 | 1650 | int min_y = cliprect.min_y; |
| r23805 | r23806 | |
| 1634 | 1656 | |
| 1635 | 1657 | if (zoomx == 0x3f && zoomy == 0x7f) /* normal size */ |
| 1636 | 1658 | { |
| 1637 | | tc0080vco->tilemap[layer]->draw(bitmap, cliprect, flags, priority); |
| 1659 | m_tilemap[layer]->draw(bitmap, cliprect, flags, priority); |
| 1638 | 1660 | } |
| 1639 | 1661 | else /* zoomed */ |
| 1640 | 1662 | { |
| r23805 | r23806 | |
| 1642 | 1664 | int sx,sy; |
| 1643 | 1665 | |
| 1644 | 1666 | /* shouldn't we set no_clip before doing this (see TC0480SCP) ? */ |
| 1645 | | bitmap_ind16 &srcbitmap = tc0080vco->tilemap[layer]->pixmap(); |
| 1667 | bitmap_ind16 &srcbitmap = m_tilemap[layer]->pixmap(); |
| 1646 | 1668 | |
| 1647 | 1669 | if (zoomx < 63) |
| 1648 | 1670 | { |
| r23805 | r23806 | |
| 1670 | 1692 | zy = 0x10000 - ((zoomy - 0x7f) * 512); |
| 1671 | 1693 | } |
| 1672 | 1694 | |
| 1673 | | if (!tc0080vco->flipscreen) |
| 1695 | if (!m_flipscreen) |
| 1674 | 1696 | { |
| 1675 | | sx = (-tc0080vco->scroll_ram[layer + 1] - 1) << 16; |
| 1676 | | sy = ( tc0080vco->scroll_ram[layer + 3] - 1) << 16; |
| 1697 | sx = (-m_scroll_ram[layer + 1] - 1) << 16; |
| 1698 | sy = ( m_scroll_ram[layer + 3] - 1) << 16; |
| 1677 | 1699 | } |
| 1678 | 1700 | else |
| 1679 | 1701 | { |
| 1680 | 1702 | /* adjustment for zx is entirely speculative */ |
| 1681 | | sx = (( 0x200 + tc0080vco->scroll_ram[layer + 1]) << 16) - (max_x + min_x) * (zx - 0x10000); |
| 1682 | | sy = (( 0x3fe - tc0080vco->scroll_ram[layer + 3]) << 16) - (max_y + min_y) * (zy - 0x10000); |
| 1703 | sx = (( 0x200 + m_scroll_ram[layer + 1]) << 16) - (max_x + min_x) * (zx - 0x10000); |
| 1704 | sy = (( 0x3fe - m_scroll_ram[layer + 3]) << 16) - (max_y + min_y) * (zy - 0x10000); |
| 1683 | 1705 | } |
| 1684 | 1706 | |
| 1685 | 1707 | { |
| r23805 | r23806 | |
| 1693 | 1715 | INT32 incyy = zy; |
| 1694 | 1716 | int wraparound = 0; |
| 1695 | 1717 | UINT32 privalue = priority; |
| 1696 | | bitmap_ind8 &priority = device->machine().priority_bitmap; |
| 1718 | bitmap_ind8 &priority = machine().priority_bitmap; |
| 1697 | 1719 | |
| 1698 | 1720 | if (dest.bpp() == 16) |
| 1699 | 1721 | COPYROZBITMAP_CORE(UINT16, PIXEL_OP_COPY_TRANS0_SET_PRIORITY, UINT8); |
| r23805 | r23806 | |
| 1704 | 1726 | } |
| 1705 | 1727 | |
| 1706 | 1728 | |
| 1707 | | void tc0080vco_tilemap_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
| 1729 | void tc0080vco_device::tilemap_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
| 1708 | 1730 | { |
| 1709 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1710 | 1731 | int disable = 0x00; /* possibly layer disable bits do exist ?? */ |
| 1711 | 1732 | |
| 1712 | 1733 | #if 0 |
| r23805 | r23806 | |
| 1718 | 1739 | case 0: |
| 1719 | 1740 | if (disable & 0x01) |
| 1720 | 1741 | return; |
| 1721 | | tc0080vco_bg0_tilemap_draw(device, bitmap, cliprect, flags, priority); |
| 1742 | bg0_tilemap_draw(bitmap, cliprect, flags, priority); |
| 1722 | 1743 | break; |
| 1723 | 1744 | case 1: |
| 1724 | 1745 | if (disable & 0x02) |
| 1725 | 1746 | return; |
| 1726 | | tc0080vco_bg1_tilemap_draw(device, bitmap, cliprect, flags, priority); |
| 1747 | bg1_tilemap_draw(bitmap, cliprect, flags, priority); |
| 1727 | 1748 | break; |
| 1728 | 1749 | case 2: |
| 1729 | 1750 | if (disable & 0x04) |
| 1730 | 1751 | return; |
| 1731 | | tc0080vco->tilemap[2]->draw(bitmap, cliprect, flags, priority); |
| 1752 | m_tilemap[2]->draw(bitmap, cliprect, flags, priority); |
| 1732 | 1753 | break; |
| 1733 | 1754 | } |
| 1734 | 1755 | } |
| 1735 | 1756 | |
| 1736 | 1757 | /* FIXME: maybe it would be better to provide pointers to these RAM regions |
| 1737 | 1758 | which can be accessed directly by the drivers... */ |
| 1738 | | READ16_DEVICE_HANDLER( tc0080vco_cram_0_r ) |
| 1759 | READ16_MEMBER( tc0080vco_device::cram_0_r ) |
| 1739 | 1760 | { |
| 1740 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1741 | | return tc0080vco->chain_ram_0[offset]; |
| 1761 | return m_chain_ram_0[offset]; |
| 1742 | 1762 | } |
| 1743 | 1763 | |
| 1744 | | READ16_DEVICE_HANDLER( tc0080vco_cram_1_r ) |
| 1764 | READ16_MEMBER( tc0080vco_device::cram_1_r ) |
| 1745 | 1765 | { |
| 1746 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1747 | | return tc0080vco->chain_ram_1[offset]; |
| 1766 | return m_chain_ram_1[offset]; |
| 1748 | 1767 | } |
| 1749 | 1768 | |
| 1750 | | READ16_DEVICE_HANDLER( tc0080vco_sprram_r ) |
| 1769 | READ16_MEMBER( tc0080vco_device::sprram_r ) |
| 1751 | 1770 | { |
| 1752 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1753 | | return tc0080vco->spriteram[offset]; |
| 1771 | return m_spriteram[offset]; |
| 1754 | 1772 | } |
| 1755 | 1773 | |
| 1756 | | READ16_DEVICE_HANDLER( tc0080vco_scrram_r ) |
| 1774 | READ16_MEMBER( tc0080vco_device::scrram_r ) |
| 1757 | 1775 | { |
| 1758 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1759 | | return tc0080vco->scroll_ram[offset]; |
| 1776 | return m_scroll_ram[offset]; |
| 1760 | 1777 | } |
| 1761 | 1778 | |
| 1762 | | READ_LINE_DEVICE_HANDLER( tc0080vco_flipscreen_r ) |
| 1779 | READ_LINE_MEMBER( tc0080vco_device::flipscreen_r ) |
| 1763 | 1780 | { |
| 1764 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(device); |
| 1765 | | return tc0080vco->flipscreen; |
| 1781 | return m_flipscreen; |
| 1766 | 1782 | } |
| 1767 | 1783 | |
| 1768 | 1784 | |
| 1769 | | void tc0080vco_device::tc0080vco_postload() |
| 1785 | void tc0080vco_device::postload() |
| 1770 | 1786 | { |
| 1771 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this); |
| 1787 | m_flipscreen = m_scroll_ram[0] & 0x0c00; |
| 1772 | 1788 | |
| 1773 | | tc0080vco->flipscreen = tc0080vco->scroll_ram[0] & 0x0c00; |
| 1789 | m_tilemap[0]->set_flip(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1790 | m_tilemap[1]->set_flip(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1791 | m_tilemap[2]->set_flip(m_flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1774 | 1792 | |
| 1775 | | tc0080vco->tilemap[0]->set_flip(tc0080vco->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1776 | | tc0080vco->tilemap[1]->set_flip(tc0080vco->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1777 | | tc0080vco->tilemap[2]->set_flip(tc0080vco->flipscreen ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); |
| 1778 | | |
| 1779 | | tc0080vco->bg0_scrollx = tc0080vco->scroll_ram[1] & 0x03ff; |
| 1780 | | tc0080vco->bg1_scrollx = tc0080vco->scroll_ram[2] & 0x03ff; |
| 1781 | | tc0080vco->bg0_scrolly = tc0080vco->scroll_ram[3] & 0x03ff; |
| 1782 | | tc0080vco->bg1_scrolly = tc0080vco->scroll_ram[4] & 0x03ff; |
| 1793 | m_bg0_scrollx = m_scroll_ram[1] & 0x03ff; |
| 1794 | m_bg1_scrollx = m_scroll_ram[2] & 0x03ff; |
| 1795 | m_bg0_scrolly = m_scroll_ram[3] & 0x03ff; |
| 1796 | m_bg1_scrolly = m_scroll_ram[4] & 0x03ff; |
| 1783 | 1797 | } |
| 1784 | 1798 | |
| 1785 | | /***************************************************************************** |
| 1786 | | DEVICE INTERFACE |
| 1787 | | *****************************************************************************/ |
| 1788 | 1799 | |
| 1800 | /***************************************************************************/ |
| 1801 | /* */ |
| 1802 | /* TC0100SCN */ |
| 1803 | /* */ |
| 1804 | /***************************************************************************/ |
| 1789 | 1805 | |
| 1790 | | const device_type TC0080VCO = &device_creator<tc0080vco_device>; |
| 1791 | 1806 | |
| 1792 | | tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1793 | | : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock) |
| 1807 | #define TC0100SCN_RAM_SIZE 0x14000 /* enough for double-width tilemaps */ |
| 1808 | #define TC0100SCN_TOTAL_CHARS 256 |
| 1809 | |
| 1810 | const device_type TC0100SCN = &device_creator<tc0100scn_device>; |
| 1811 | |
| 1812 | tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1813 | : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock) |
| 1794 | 1814 | { |
| 1795 | | m_token = global_alloc_clear(tc0080vco_state); |
| 1796 | 1815 | } |
| 1797 | 1816 | |
| 1798 | 1817 | //------------------------------------------------- |
| r23805 | r23806 | |
| 1801 | 1820 | // complete |
| 1802 | 1821 | //------------------------------------------------- |
| 1803 | 1822 | |
| 1804 | | void tc0080vco_device::device_config_complete() |
| 1823 | void tc0100scn_device::device_config_complete() |
| 1805 | 1824 | { |
| 1825 | // inherit a copy of the static data |
| 1826 | const tc0100scn_interface *intf = reinterpret_cast<const tc0100scn_interface *>(static_config()); |
| 1827 | if (intf != NULL) |
| 1828 | *static_cast<tc0100scn_interface *>(this) = *intf; |
| 1829 | |
| 1830 | // or initialize to defaults if none provided |
| 1831 | else |
| 1832 | { |
| 1833 | } |
| 1806 | 1834 | } |
| 1807 | 1835 | |
| 1808 | 1836 | //------------------------------------------------- |
| 1809 | 1837 | // device_start - device-specific startup |
| 1810 | 1838 | //------------------------------------------------- |
| 1811 | 1839 | |
| 1812 | | void tc0080vco_device::device_start() |
| 1840 | void tc0100scn_device::device_start() |
| 1813 | 1841 | { |
| 1814 | | tc0080vco_state *tc0080vco = tc0080vco_get_safe_token(this); |
| 1815 | | const tc0080vco_interface *intf = tc0080vco_get_interface(this); |
| 1842 | static const gfx_layout tc0100scn_charlayout = |
| 1843 | { |
| 1844 | 8,8, /* 8*8 characters */ |
| 1845 | 256, /* 256 characters */ |
| 1846 | 2, /* 2 bits per pixel */ |
| 1847 | { XOR(0)*4, XOR(2)*4 }, |
| 1848 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 1849 | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, |
| 1850 | 16*8 /* every sprite takes 16 consecutive bytes */ |
| 1851 | }; |
| 1852 | |
| 1853 | int xd, yd; |
| 1816 | 1854 | |
| 1817 | | /* use the given gfx sets for bg/tx tiles*/ |
| 1818 | | tc0080vco->bg_gfx = intf->gfxnum; |
| 1819 | | tc0080vco->tx_gfx = intf->txnum; |
| 1855 | m_screen = machine().device<screen_device>(m_screen_tag); |
| 1820 | 1856 | |
| 1821 | | tc0080vco->bg_xoffs = intf->bg_xoffs; /* usually 1 */ |
| 1822 | | tc0080vco->bg_yoffs = intf->bg_yoffs; /* usually 1 */ |
| 1823 | | tc0080vco->bg_flip_yoffs = intf->bg_flip_yoffs; /* usually -2 */ |
| 1824 | | tc0080vco->has_tx = intf->has_fg0; /* for debugging only */ |
| 1857 | /* Set up clipping for multi-TC0100SCN games. We assume |
| 1858 | this code won't ever affect single screen games: |
| 1859 | Thundfox is the only one of those with two chips, and |
| 1860 | we're safe as it uses single width tilemaps. */ |
| 1825 | 1861 | |
| 1826 | | tc0080vco->tilemap[0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::tc0080vco_get_bg0_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 1827 | | tc0080vco->tilemap[1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::tc0080vco_get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 64); |
| 1862 | m_cliprect = m_screen->visible_area(); |
| 1828 | 1863 | |
| 1829 | | tc0080vco->tilemap[0]->set_transparent_pen(0); |
| 1830 | | tc0080vco->tilemap[1]->set_transparent_pen(0); |
| 1864 | /* Single width versions */ |
| 1865 | m_tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 1866 | m_tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 1867 | m_tilemap[2][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 1831 | 1868 | |
| 1832 | | tc0080vco->tilemap[0]->set_scrolldx(tc0080vco->bg_xoffs, 512); |
| 1833 | | tc0080vco->tilemap[1]->set_scrolldx(tc0080vco->bg_xoffs, 512); |
| 1834 | | tc0080vco->tilemap[0]->set_scrolldy(tc0080vco->bg_yoffs, tc0080vco->bg_flip_yoffs); |
| 1835 | | tc0080vco->tilemap[1]->set_scrolldy(tc0080vco->bg_yoffs, tc0080vco->bg_flip_yoffs); |
| 1869 | /* Double width versions */ |
| 1870 | m_tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); |
| 1871 | m_tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); |
| 1872 | m_tilemap[2][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 32); |
| 1836 | 1873 | |
| 1837 | | /* bg0 tilemap scrollable per pixel row */ |
| 1838 | | tc0080vco->tilemap[0]->set_scroll_rows(512); |
| 1874 | m_tilemap[0][0]->set_transparent_pen(0); |
| 1875 | m_tilemap[1][0]->set_transparent_pen(0); |
| 1876 | m_tilemap[2][0]->set_transparent_pen(0); |
| 1839 | 1877 | |
| 1840 | | /* Perform extra initialisations for text layer */ |
| 1841 | | tc0080vco->tilemap[2] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0080vco_device::tc0080vco_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 1878 | m_tilemap[0][1]->set_transparent_pen(0); |
| 1879 | m_tilemap[1][1]->set_transparent_pen(0); |
| 1880 | m_tilemap[2][1]->set_transparent_pen(0); |
| 1842 | 1881 | |
| 1843 | | tc0080vco->tilemap[2]->set_scrolldx(0, 0); |
| 1844 | | tc0080vco->tilemap[2]->set_scrolldy(48, -448); |
| 1882 | /* Standard width tilemaps. I'm setting the optional chip #2 |
| 1883 | 7 bits higher and 2 pixels to the left than chip #1 because |
| 1884 | that's how thundfox wants it. */ |
| 1845 | 1885 | |
| 1846 | | tc0080vco->tilemap[2]->set_transparent_pen(0); |
| 1886 | xd = (m_multiscrn_hack == 0) ? (-m_x_offset) : (-m_x_offset - 2); |
| 1887 | yd = (m_multiscrn_hack == 0) ? (8 - m_y_offset) : (1 - m_y_offset); |
| 1847 | 1888 | |
| 1848 | | tc0080vco->ram = auto_alloc_array_clear(machine(), UINT16, TC0080VCO_RAM_SIZE / 2); |
| 1889 | m_tilemap[0][0]->set_scrolldx(xd - 16, -m_flip_xoffs - xd - 16); |
| 1890 | m_tilemap[0][0]->set_scrolldy(yd, -m_flip_yoffs - yd); |
| 1891 | m_tilemap[1][0]->set_scrolldx(xd - 16, -m_flip_xoffs - xd - 16); |
| 1892 | m_tilemap[1][0]->set_scrolldy(yd, -m_flip_yoffs - yd); |
| 1893 | m_tilemap[2][0]->set_scrolldx(xd - 16, -m_flip_text_xoffs - xd - 16 - 7); |
| 1894 | m_tilemap[2][0]->set_scrolldy(yd, -m_flip_text_yoffs - yd); |
| 1849 | 1895 | |
| 1850 | | tc0080vco->char_ram = tc0080vco->ram + 0x00000 / 2; /* continues at +0x10000 */ |
| 1851 | | tc0080vco->tx_ram_0 = tc0080vco->ram + 0x01000 / 2; |
| 1852 | | tc0080vco->chain_ram_0 = tc0080vco->ram + 0x00000 / 2; /* only used from +0x2000 */ |
| 1896 | /* Double width tilemaps. We must correct offsets for |
| 1897 | extra chips, as MAME sees offsets from LHS of whole |
| 1898 | display not from the edges of individual screens. |
| 1899 | NB flipscreen tilemap offsets are based on Cameltry */ |
| 1853 | 1900 | |
| 1854 | | tc0080vco->bg0_ram_0 = tc0080vco->ram + 0x0c000 / 2; |
| 1855 | | tc0080vco->bg1_ram_0 = tc0080vco->ram + 0x0e000 / 2; |
| 1901 | xd = -m_x_offset - m_multiscrn_xoffs; |
| 1902 | yd = 8 - m_y_offset; |
| 1856 | 1903 | |
| 1857 | | tc0080vco->tx_ram_1 = tc0080vco->ram + 0x11000 / 2; |
| 1858 | | tc0080vco->chain_ram_1 = tc0080vco->ram + 0x10000 / 2; /* only used from +0x12000 */ |
| 1904 | m_tilemap[0][1]->set_scrolldx(xd - 16, -m_flip_xoffs - xd - 16); |
| 1905 | m_tilemap[0][1]->set_scrolldy(yd, -m_flip_yoffs - yd); |
| 1906 | m_tilemap[1][1]->set_scrolldx(xd - 16, -m_flip_xoffs - xd - 16); |
| 1907 | m_tilemap[1][1]->set_scrolldy(yd, -m_flip_yoffs - yd); |
| 1908 | m_tilemap[2][1]->set_scrolldx(xd - 16, -m_flip_text_xoffs - xd - 16 - 7); |
| 1909 | m_tilemap[2][1]->set_scrolldy(yd, -m_flip_text_yoffs - yd); |
| 1859 | 1910 | |
| 1860 | | tc0080vco->bg0_ram_1 = tc0080vco->ram + 0x1c000 / 2; |
| 1861 | | tc0080vco->bg1_ram_1 = tc0080vco->ram + 0x1e000 / 2; |
| 1862 | | tc0080vco->bgscroll_ram = tc0080vco->ram + 0x20000 / 2; |
| 1863 | | tc0080vco->spriteram = tc0080vco->ram + 0x20400 / 2; |
| 1864 | | tc0080vco->scroll_ram = tc0080vco->ram + 0x20800 / 2; |
| 1911 | m_tilemap[0][0]->set_scroll_rows(512); |
| 1912 | m_tilemap[1][0]->set_scroll_rows(512); |
| 1913 | m_tilemap[0][1]->set_scroll_rows(512); |
| 1914 | m_tilemap[1][1]->set_scroll_rows(512); |
| 1865 | 1915 | |
| 1866 | | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 1867 | | machine().gfx[tc0080vco->tx_gfx] = auto_alloc(machine(), gfx_element(machine(), tc0080vco_charlayout, (UINT8 *)tc0080vco->char_ram, 64, 0)); |
| 1916 | m_bg_tilemask = 0xffff; /* Mjnquest has 0x7fff tilemask */ |
| 1868 | 1917 | |
| 1869 | | save_pointer(NAME(tc0080vco->ram), TC0080VCO_RAM_SIZE / 2); |
| 1870 | | machine().save().register_postload(save_prepost_delegate(FUNC(tc0080vco_device::tc0080vco_postload), this)); |
| 1871 | | } |
| 1918 | m_bg_col_mult = 1; /* multiplier for when bg gfx != 4bpp */ |
| 1919 | m_tx_col_mult = 1; /* multiplier needed when bg gfx is 6bpp */ |
| 1872 | 1920 | |
| 1873 | | /***************************************************************************/ |
| 1874 | | /* */ |
| 1875 | | /* TC0100SCN */ |
| 1876 | | /* */ |
| 1877 | | /***************************************************************************/ |
| 1921 | if (machine().gfx[m_gfxnum]->granularity() == 2) /* Yuyugogo, Yesnoj */ |
| 1922 | m_bg_col_mult = 8; |
| 1878 | 1923 | |
| 1879 | | struct tc0100scn_state |
| 1880 | | { |
| 1881 | | UINT16 ctrl[8]; |
| 1924 | if (machine().gfx[m_gfxnum]->granularity() == 0x40) /* Undrfire */ |
| 1925 | m_tx_col_mult = 4; |
| 1882 | 1926 | |
| 1883 | | UINT16 * ram; |
| 1884 | | UINT16 * bg_ram; |
| 1885 | | UINT16 * fg_ram; |
| 1886 | | UINT16 * tx_ram; |
| 1887 | | UINT16 * char_ram; |
| 1888 | | UINT16 * bgscroll_ram; |
| 1889 | | UINT16 * fgscroll_ram; |
| 1890 | | UINT16 * colscroll_ram; |
| 1927 | //logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", machine().gfx[m_gfxnum]->granularity(), m_tx_col_mult); |
| 1891 | 1928 | |
| 1892 | | int bgscrollx, bgscrolly, fgscrollx, fgscrolly; |
| 1929 | m_ram = auto_alloc_array_clear(machine(), UINT16, TC0100SCN_RAM_SIZE / 2); |
| 1893 | 1930 | |
| 1894 | | /* We keep two tilemaps for each of the 3 actual tilemaps: one at standard width, one double */ |
| 1895 | | tilemap_t *tilemap[3][2]; |
| 1896 | | rectangle cliprect; |
| 1931 | set_layer_ptrs(); |
| 1897 | 1932 | |
| 1898 | | int bg_gfx, tx_gfx; |
| 1899 | | int bg_col_mult, bg_tilemask, tx_col_mult; |
| 1900 | | INT32 gfxbank, colbank; |
| 1901 | | INT32 bg0_colbank, bg1_colbank, tx_colbank; |
| 1902 | | int dblwidth; |
| 1933 | set_colbanks(0, 0, 0); /* standard values, only Wgp & multiscreen games change them */ |
| 1934 | /* we call this here, so that they can be modified at VIDEO_START*/ |
| 1903 | 1935 | |
| 1904 | | screen_device *screen; |
| 1905 | | }; |
| 1936 | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 1937 | machine().gfx[m_txnum] = auto_alloc(machine(), gfx_element(machine(), tc0100scn_charlayout, (UINT8 *)m_char_ram, 64, 0)); |
| 1906 | 1938 | |
| 1907 | | #define TC0100SCN_RAM_SIZE 0x14000 /* enough for double-width tilemaps */ |
| 1908 | | #define TC0100SCN_TOTAL_CHARS 256 |
| 1939 | save_pointer(NAME(m_ram), TC0100SCN_RAM_SIZE / 2); |
| 1940 | save_item(NAME(m_ctrl)); |
| 1941 | save_item(NAME(m_dblwidth)); |
| 1942 | save_item(NAME(m_gfxbank)); |
| 1943 | machine().save().register_postload(save_prepost_delegate(FUNC(tc0100scn_device::postload), this)); |
| 1944 | } |
| 1909 | 1945 | |
| 1910 | | /***************************************************************************** |
| 1911 | | INLINE FUNCTIONS |
| 1912 | | *****************************************************************************/ |
| 1946 | //------------------------------------------------- |
| 1947 | // device_reset - device-specific reset |
| 1948 | //------------------------------------------------- |
| 1913 | 1949 | |
| 1914 | | INLINE tc0100scn_state *tc0100scn_get_safe_token( device_t *device ) |
| 1950 | void tc0100scn_device::device_reset() |
| 1915 | 1951 | { |
| 1916 | | assert(device != NULL); |
| 1917 | | assert(device->type() == TC0100SCN); |
| 1952 | int i; |
| 1918 | 1953 | |
| 1919 | | return (tc0100scn_state *)downcast<tc0100scn_device *>(device)->token(); |
| 1920 | | } |
| 1954 | m_dblwidth = 0; |
| 1955 | m_colbank = 0; |
| 1956 | m_gfxbank = 0; /* Mjnquest uniquely banks tiles */ |
| 1921 | 1957 | |
| 1922 | | INLINE const tc0100scn_interface *tc0100scn_get_interface( device_t *device ) |
| 1923 | | { |
| 1924 | | assert(device != NULL); |
| 1925 | | assert((device->type() == TC0100SCN)); |
| 1926 | | return (const tc0100scn_interface *) device->static_config(); |
| 1958 | for (i = 0; i < 8; i++) |
| 1959 | m_ctrl[i] = 0; |
| 1927 | 1960 | } |
| 1928 | 1961 | |
| 1962 | |
| 1929 | 1963 | /***************************************************************************** |
| 1930 | 1964 | DEVICE HANDLERS |
| 1931 | 1965 | *****************************************************************************/ |
| 1932 | 1966 | |
| 1933 | | INLINE void common_get_bg0_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) |
| 1967 | void tc0100scn_device::common_get_bg0_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) |
| 1934 | 1968 | { |
| 1935 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 1936 | 1969 | int code, attr; |
| 1937 | 1970 | |
| 1938 | 1971 | if (!dblwidth) |
| 1939 | 1972 | { |
| 1940 | 1973 | /* Mahjong Quest (F2 system) inexplicably has a banking feature */ |
| 1941 | | code = (ram[2 * tile_index + 1] & tc0100scn->bg_tilemask) + (tc0100scn->gfxbank << 15); |
| 1974 | code = (ram[2 * tile_index + 1] & m_bg_tilemask) + (m_gfxbank << 15); |
| 1942 | 1975 | attr = ram[2 * tile_index]; |
| 1943 | 1976 | } |
| 1944 | 1977 | else |
| 1945 | 1978 | { |
| 1946 | | code = ram[2 * tile_index + 1] & tc0100scn->bg_tilemask; |
| 1979 | code = ram[2 * tile_index + 1] & m_bg_tilemask; |
| 1947 | 1980 | attr = ram[2 * tile_index]; |
| 1948 | 1981 | } |
| 1949 | 1982 | |
| 1950 | | SET_TILE_INFO( |
| 1983 | SET_TILE_INFO_MEMBER( |
| 1951 | 1984 | gfxnum, |
| 1952 | 1985 | code, |
| 1953 | | (((attr * tc0100scn->bg_col_mult) + tc0100scn->bg0_colbank) & 0xff) + colbank, |
| 1986 | (((attr * m_bg_col_mult) + m_bg0_colbank) & 0xff) + colbank, |
| 1954 | 1987 | TILE_FLIPYX((attr & 0xc000) >> 14)); |
| 1955 | 1988 | } |
| 1956 | 1989 | |
| 1957 | | INLINE void common_get_bg1_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) |
| 1990 | void tc0100scn_device::common_get_bg1_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) |
| 1958 | 1991 | { |
| 1959 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 1960 | 1992 | int code, attr; |
| 1961 | 1993 | |
| 1962 | 1994 | if (!dblwidth) |
| 1963 | 1995 | { |
| 1964 | 1996 | /* Mahjong Quest (F2 system) inexplicably has a banking feature */ |
| 1965 | | code = (ram[2 * tile_index + 1] & tc0100scn->bg_tilemask) + (tc0100scn->gfxbank << 15); |
| 1997 | code = (ram[2 * tile_index + 1] & m_bg_tilemask) + (m_gfxbank << 15); |
| 1966 | 1998 | attr = ram[2 * tile_index]; |
| 1967 | 1999 | } |
| 1968 | 2000 | else |
| 1969 | 2001 | { |
| 1970 | | code = ram[2 * tile_index + 1] & tc0100scn->bg_tilemask; |
| 2002 | code = ram[2 * tile_index + 1] & m_bg_tilemask; |
| 1971 | 2003 | attr = ram[2 * tile_index]; |
| 1972 | 2004 | } |
| 1973 | 2005 | |
| 1974 | | SET_TILE_INFO( |
| 2006 | SET_TILE_INFO_MEMBER( |
| 1975 | 2007 | gfxnum, |
| 1976 | 2008 | code, |
| 1977 | | (((attr * tc0100scn->bg_col_mult) + tc0100scn->bg1_colbank) & 0xff) + colbank, |
| 2009 | (((attr * m_bg_col_mult) + m_bg1_colbank) & 0xff) + colbank, |
| 1978 | 2010 | TILE_FLIPYX((attr & 0xc000) >> 14)); |
| 1979 | 2011 | } |
| 1980 | 2012 | |
| 1981 | | INLINE void common_get_tx_tile_info( running_machine &machine, device_t *device, tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) |
| 2013 | void tc0100scn_device::common_get_tx_tile_info( tile_data &tileinfo, int tile_index, UINT16 *ram, int gfxnum, int colbank, int dblwidth ) |
| 1982 | 2014 | { |
| 1983 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 1984 | 2015 | int attr = ram[tile_index]; |
| 1985 | 2016 | |
| 1986 | | SET_TILE_INFO( |
| 2017 | SET_TILE_INFO_MEMBER( |
| 1987 | 2018 | gfxnum, |
| 1988 | 2019 | attr & 0xff, |
| 1989 | | ((((attr >> 6) & 0xfc) * tc0100scn->tx_col_mult + (tc0100scn->tx_colbank << 2)) & 0x3ff) + colbank * 4, |
| 2020 | ((((attr >> 6) & 0xfc) * m_tx_col_mult + (m_tx_colbank << 2)) & 0x3ff) + colbank * 4, |
| 1990 | 2021 | TILE_FLIPYX((attr & 0xc000) >> 14)); |
| 1991 | 2022 | } |
| 1992 | 2023 | |
| 1993 | | TILE_GET_INFO_MEMBER(tc0100scn_device::tc0100scn_get_bg_tile_info) |
| 2024 | TILE_GET_INFO_MEMBER(tc0100scn_device::get_bg_tile_info) |
| 1994 | 2025 | { |
| 1995 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this); |
| 1996 | | common_get_bg0_tile_info(machine(), this, tileinfo, tile_index, tc0100scn->bg_ram, tc0100scn->bg_gfx, tc0100scn->colbank, tc0100scn->dblwidth); |
| 2026 | common_get_bg0_tile_info(tileinfo, tile_index, m_bg_ram, m_gfxnum, m_colbank, m_dblwidth); |
| 1997 | 2027 | } |
| 1998 | 2028 | |
| 1999 | | TILE_GET_INFO_MEMBER(tc0100scn_device::tc0100scn_get_fg_tile_info) |
| 2029 | TILE_GET_INFO_MEMBER(tc0100scn_device::get_fg_tile_info) |
| 2000 | 2030 | { |
| 2001 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this); |
| 2002 | | common_get_bg1_tile_info(machine(), this, tileinfo, tile_index, tc0100scn->fg_ram, tc0100scn->bg_gfx, tc0100scn->colbank, tc0100scn->dblwidth); |
| 2031 | common_get_bg1_tile_info(tileinfo, tile_index, m_fg_ram, m_gfxnum, m_colbank, m_dblwidth); |
| 2003 | 2032 | } |
| 2004 | 2033 | |
| 2005 | | TILE_GET_INFO_MEMBER(tc0100scn_device::tc0100scn_get_tx_tile_info) |
| 2034 | TILE_GET_INFO_MEMBER(tc0100scn_device::get_tx_tile_info) |
| 2006 | 2035 | { |
| 2007 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this); |
| 2008 | | common_get_tx_tile_info(machine(), this, tileinfo, tile_index, tc0100scn->tx_ram, tc0100scn->tx_gfx, tc0100scn->colbank, tc0100scn->dblwidth); |
| 2036 | common_get_tx_tile_info(tileinfo, tile_index, m_tx_ram, m_txnum, m_colbank, m_dblwidth); |
| 2009 | 2037 | } |
| 2010 | 2038 | |
| 2011 | | static const gfx_layout tc0100scn_charlayout = |
| 2039 | void tc0100scn_device::set_colbank( int col ) |
| 2012 | 2040 | { |
| 2013 | | 8,8, /* 8*8 characters */ |
| 2014 | | 256, /* 256 characters */ |
| 2015 | | 2, /* 2 bits per pixel */ |
| 2016 | | { XOR(0)*4, XOR(2)*4 }, |
| 2017 | | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 2018 | | { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, |
| 2019 | | 16*8 /* every sprite takes 16 consecutive bytes */ |
| 2020 | | }; |
| 2021 | | |
| 2022 | | |
| 2023 | | void tc0100scn_set_colbank( device_t *device, int col ) |
| 2024 | | { |
| 2025 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2026 | | tc0100scn->colbank = col; |
| 2041 | m_colbank = col; |
| 2027 | 2042 | } |
| 2028 | 2043 | |
| 2029 | | void tc0100scn_set_colbanks( device_t *device, int bg0, int bg1, int tx ) |
| 2044 | void tc0100scn_device::set_colbanks( int bg0, int bg1, int tx ) |
| 2030 | 2045 | { |
| 2031 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2032 | | tc0100scn->bg0_colbank = bg0; |
| 2033 | | tc0100scn->bg1_colbank = bg1; |
| 2034 | | tc0100scn->tx_colbank = tx; |
| 2046 | m_bg0_colbank = bg0; |
| 2047 | m_bg1_colbank = bg1; |
| 2048 | m_tx_colbank = tx; |
| 2035 | 2049 | } |
| 2036 | 2050 | |
| 2037 | | void tc0100scn_set_bg_tilemask( device_t *device, int mask ) |
| 2051 | void tc0100scn_device::set_bg_tilemask( int mask ) |
| 2038 | 2052 | { |
| 2039 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2040 | | tc0100scn->bg_tilemask = mask; |
| 2053 | m_bg_tilemask = mask; |
| 2041 | 2054 | } |
| 2042 | 2055 | |
| 2043 | | WRITE16_DEVICE_HANDLER( tc0100scn_gfxbank_w ) /* Mjnquest banks its 2 sets of scr tiles */ |
| 2056 | WRITE16_MEMBER( tc0100scn_device::gfxbank_w ) /* Mjnquest banks its 2 sets of scr tiles */ |
| 2044 | 2057 | { |
| 2045 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2046 | | tc0100scn->gfxbank = (data & 0x1); |
| 2058 | m_gfxbank = (data & 0x1); |
| 2047 | 2059 | } |
| 2048 | 2060 | |
| 2049 | | static void tc0100scn_set_layer_ptrs( tc0100scn_state *tc0100scn ) |
| 2061 | void tc0100scn_device::set_layer_ptrs() |
| 2050 | 2062 | { |
| 2051 | | if (!tc0100scn->dblwidth) |
| 2063 | if (!m_dblwidth) |
| 2052 | 2064 | { |
| 2053 | | tc0100scn->bg_ram = tc0100scn->ram + 0x0; |
| 2054 | | tc0100scn->tx_ram = tc0100scn->ram + 0x4000 /2; |
| 2055 | | tc0100scn->char_ram = tc0100scn->ram + 0x6000 /2; |
| 2056 | | tc0100scn->fg_ram = tc0100scn->ram + 0x8000 /2; |
| 2057 | | tc0100scn->bgscroll_ram = tc0100scn->ram + 0xc000 /2; |
| 2058 | | tc0100scn->fgscroll_ram = tc0100scn->ram + 0xc400 /2; |
| 2059 | | tc0100scn->colscroll_ram = tc0100scn->ram + 0xe000 /2; |
| 2065 | m_bg_ram = m_ram + 0x0; |
| 2066 | m_tx_ram = m_ram + 0x4000 /2; |
| 2067 | m_char_ram = m_ram + 0x6000 /2; |
| 2068 | m_fg_ram = m_ram + 0x8000 /2; |
| 2069 | m_bgscroll_ram = m_ram + 0xc000 /2; |
| 2070 | m_fgscroll_ram = m_ram + 0xc400 /2; |
| 2071 | m_colscroll_ram = m_ram + 0xe000 /2; |
| 2060 | 2072 | } |
| 2061 | 2073 | else |
| 2062 | 2074 | { |
| 2063 | | tc0100scn->bg_ram = tc0100scn->ram + 0x0; |
| 2064 | | tc0100scn->fg_ram = tc0100scn->ram + 0x08000 /2; |
| 2065 | | tc0100scn->bgscroll_ram = tc0100scn->ram + 0x10000 /2; |
| 2066 | | tc0100scn->fgscroll_ram = tc0100scn->ram + 0x10400 /2; |
| 2067 | | tc0100scn->colscroll_ram = tc0100scn->ram + 0x10800 /2; |
| 2068 | | tc0100scn->char_ram = tc0100scn->ram + 0x11000 /2; |
| 2069 | | tc0100scn->tx_ram = tc0100scn->ram + 0x12000 /2; |
| 2075 | m_bg_ram = m_ram + 0x0; |
| 2076 | m_fg_ram = m_ram + 0x08000 /2; |
| 2077 | m_bgscroll_ram = m_ram + 0x10000 /2; |
| 2078 | m_fgscroll_ram = m_ram + 0x10400 /2; |
| 2079 | m_colscroll_ram = m_ram + 0x10800 /2; |
| 2080 | m_char_ram = m_ram + 0x11000 /2; |
| 2081 | m_tx_ram = m_ram + 0x12000 /2; |
| 2070 | 2082 | } |
| 2071 | 2083 | } |
| 2072 | 2084 | |
| 2073 | | static void tc0100scn_dirty_tilemaps( device_t *device ) |
| 2085 | void tc0100scn_device::dirty_tilemaps() |
| 2074 | 2086 | { |
| 2075 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2076 | | |
| 2077 | | tc0100scn->tilemap[0][tc0100scn->dblwidth]->mark_all_dirty(); |
| 2078 | | tc0100scn->tilemap[1][tc0100scn->dblwidth]->mark_all_dirty(); |
| 2079 | | tc0100scn->tilemap[2][tc0100scn->dblwidth]->mark_all_dirty(); |
| 2087 | m_tilemap[0][m_dblwidth]->mark_all_dirty(); |
| 2088 | m_tilemap[1][m_dblwidth]->mark_all_dirty(); |
| 2089 | m_tilemap[2][m_dblwidth]->mark_all_dirty(); |
| 2080 | 2090 | } |
| 2081 | 2091 | |
| 2082 | | static void tc0100scn_restore_scroll( tc0100scn_state *tc0100scn ) |
| 2092 | void tc0100scn_device::restore_scroll() |
| 2083 | 2093 | { |
| 2084 | 2094 | int flip; |
| 2085 | 2095 | |
| 2086 | | tc0100scn->bgscrollx = -tc0100scn->ctrl[0]; |
| 2087 | | tc0100scn->fgscrollx = -tc0100scn->ctrl[1]; |
| 2088 | | tc0100scn->tilemap[2][0]->set_scrollx(0, -tc0100scn->ctrl[2]); |
| 2089 | | tc0100scn->tilemap[2][1]->set_scrollx(0, -tc0100scn->ctrl[2]); |
| 2096 | m_bgscrollx = -m_ctrl[0]; |
| 2097 | m_fgscrollx = -m_ctrl[1]; |
| 2098 | m_tilemap[2][0]->set_scrollx(0, -m_ctrl[2]); |
| 2099 | m_tilemap[2][1]->set_scrollx(0, -m_ctrl[2]); |
| 2090 | 2100 | |
| 2091 | | tc0100scn->bgscrolly = -tc0100scn->ctrl[3]; |
| 2092 | | tc0100scn->fgscrolly = -tc0100scn->ctrl[4]; |
| 2093 | | tc0100scn->tilemap[2][0]->set_scrolly(0, -tc0100scn->ctrl[5]); |
| 2094 | | tc0100scn->tilemap[2][1]->set_scrolly(0, -tc0100scn->ctrl[5]); |
| 2101 | m_bgscrolly = -m_ctrl[3]; |
| 2102 | m_fgscrolly = -m_ctrl[4]; |
| 2103 | m_tilemap[2][0]->set_scrolly(0, -m_ctrl[5]); |
| 2104 | m_tilemap[2][1]->set_scrolly(0, -m_ctrl[5]); |
| 2095 | 2105 | |
| 2096 | | flip = (tc0100scn->ctrl[7] & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0; |
| 2097 | | tc0100scn->tilemap[0][0]->set_flip(flip); |
| 2098 | | tc0100scn->tilemap[1][0]->set_flip(flip); |
| 2099 | | tc0100scn->tilemap[2][0]->set_flip(flip); |
| 2100 | | tc0100scn->tilemap[0][1]->set_flip(flip); |
| 2101 | | tc0100scn->tilemap[1][1]->set_flip(flip); |
| 2102 | | tc0100scn->tilemap[2][1]->set_flip(flip); |
| 2106 | flip = (m_ctrl[7] & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0; |
| 2107 | m_tilemap[0][0]->set_flip(flip); |
| 2108 | m_tilemap[1][0]->set_flip(flip); |
| 2109 | m_tilemap[2][0]->set_flip(flip); |
| 2110 | m_tilemap[0][1]->set_flip(flip); |
| 2111 | m_tilemap[1][1]->set_flip(flip); |
| 2112 | m_tilemap[2][1]->set_flip(flip); |
| 2103 | 2113 | } |
| 2104 | 2114 | |
| 2105 | 2115 | |
| 2106 | | void tc0100scn_device::tc0100scn_postload() |
| 2116 | void tc0100scn_device::postload() |
| 2107 | 2117 | { |
| 2108 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this); |
| 2118 | set_layer_ptrs(); |
| 2119 | restore_scroll(); |
| 2109 | 2120 | |
| 2110 | | tc0100scn_set_layer_ptrs(tc0100scn); |
| 2111 | | tc0100scn_restore_scroll(tc0100scn); |
| 2112 | | |
| 2113 | | tc0100scn->tilemap[0][0]->mark_all_dirty(); |
| 2114 | | tc0100scn->tilemap[1][0]->mark_all_dirty(); |
| 2115 | | tc0100scn->tilemap[2][0]->mark_all_dirty(); |
| 2116 | | tc0100scn->tilemap[0][1]->mark_all_dirty(); |
| 2117 | | tc0100scn->tilemap[1][1]->mark_all_dirty(); |
| 2118 | | tc0100scn->tilemap[2][1]->mark_all_dirty(); |
| 2121 | m_tilemap[0][0]->mark_all_dirty(); |
| 2122 | m_tilemap[1][0]->mark_all_dirty(); |
| 2123 | m_tilemap[2][0]->mark_all_dirty(); |
| 2124 | m_tilemap[0][1]->mark_all_dirty(); |
| 2125 | m_tilemap[1][1]->mark_all_dirty(); |
| 2126 | m_tilemap[2][1]->mark_all_dirty(); |
| 2119 | 2127 | } |
| 2120 | 2128 | |
| 2121 | | READ16_DEVICE_HANDLER( tc0100scn_word_r ) |
| 2129 | READ16_MEMBER( tc0100scn_device::word_r ) |
| 2122 | 2130 | { |
| 2123 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2124 | | return tc0100scn->ram[offset]; |
| 2131 | return m_ram[offset]; |
| 2125 | 2132 | } |
| 2126 | 2133 | |
| 2127 | | WRITE16_DEVICE_HANDLER( tc0100scn_word_w ) |
| 2134 | WRITE16_MEMBER( tc0100scn_device::word_w ) |
| 2128 | 2135 | { |
| 2129 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2130 | | |
| 2131 | | COMBINE_DATA(&tc0100scn->ram[offset]); |
| 2132 | | if (!tc0100scn->dblwidth) |
| 2136 | COMBINE_DATA(&m_ram[offset]); |
| 2137 | if (!m_dblwidth) |
| 2133 | 2138 | { |
| 2134 | 2139 | if (offset < 0x2000) |
| 2135 | | tc0100scn->tilemap[0][0]->mark_tile_dirty(offset / 2); |
| 2140 | m_tilemap[0][0]->mark_tile_dirty(offset / 2); |
| 2136 | 2141 | else if (offset < 0x3000) |
| 2137 | | tc0100scn->tilemap[2][0]->mark_tile_dirty((offset & 0x0fff)); |
| 2142 | m_tilemap[2][0]->mark_tile_dirty((offset & 0x0fff)); |
| 2138 | 2143 | else if (offset < 0x3800) |
| 2139 | | space.machine().gfx[tc0100scn->tx_gfx]->mark_dirty((offset - 0x3000) / 8); |
| 2144 | space.machine().gfx[m_txnum]->mark_dirty((offset - 0x3000) / 8); |
| 2140 | 2145 | else if (offset >= 0x4000 && offset < 0x6000) |
| 2141 | | tc0100scn->tilemap[1][0]->mark_tile_dirty((offset & 0x1fff) / 2); |
| 2146 | m_tilemap[1][0]->mark_tile_dirty((offset & 0x1fff) / 2); |
| 2142 | 2147 | } |
| 2143 | 2148 | else /* Double-width tilemaps have a different memory map */ |
| 2144 | 2149 | { |
| 2145 | 2150 | if (offset < 0x4000) |
| 2146 | | tc0100scn->tilemap[0][1]->mark_tile_dirty(offset / 2); |
| 2151 | m_tilemap[0][1]->mark_tile_dirty(offset / 2); |
| 2147 | 2152 | else if (offset >= 0x4000 && offset < 0x8000) |
| 2148 | | tc0100scn->tilemap[1][1]->mark_tile_dirty((offset & 0x3fff) / 2); |
| 2153 | m_tilemap[1][1]->mark_tile_dirty((offset & 0x3fff) / 2); |
| 2149 | 2154 | else if (offset >= 0x8800 && offset < 0x9000) |
| 2150 | | space.machine().gfx[tc0100scn->tx_gfx]->mark_dirty((offset - 0x8800) / 8); |
| 2155 | space.machine().gfx[m_txnum]->mark_dirty((offset - 0x8800) / 8); |
| 2151 | 2156 | else if (offset >= 0x9000) |
| 2152 | | tc0100scn->tilemap[2][1]->mark_tile_dirty((offset & 0x0fff)); |
| 2157 | m_tilemap[2][1]->mark_tile_dirty((offset & 0x0fff)); |
| 2153 | 2158 | } |
| 2154 | 2159 | } |
| 2155 | 2160 | |
| 2156 | | READ16_DEVICE_HANDLER( tc0100scn_ctrl_word_r ) |
| 2161 | READ16_MEMBER( tc0100scn_device::ctrl_word_r ) |
| 2157 | 2162 | { |
| 2158 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2159 | | return tc0100scn->ctrl[offset]; |
| 2163 | return m_ctrl[offset]; |
| 2160 | 2164 | } |
| 2161 | 2165 | |
| 2162 | | WRITE16_DEVICE_HANDLER( tc0100scn_ctrl_word_w ) |
| 2166 | WRITE16_MEMBER( tc0100scn_device::ctrl_word_w ) |
| 2163 | 2167 | { |
| 2164 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2168 | COMBINE_DATA(&m_ctrl[offset]); |
| 2165 | 2169 | |
| 2166 | | COMBINE_DATA(&tc0100scn->ctrl[offset]); |
| 2170 | data = m_ctrl[offset]; |
| 2167 | 2171 | |
| 2168 | | data = tc0100scn->ctrl[offset]; |
| 2169 | | |
| 2170 | 2172 | switch (offset) |
| 2171 | 2173 | { |
| 2172 | 2174 | case 0x00: |
| 2173 | | tc0100scn->bgscrollx = -data; |
| 2175 | m_bgscrollx = -data; |
| 2174 | 2176 | break; |
| 2175 | 2177 | |
| 2176 | 2178 | case 0x01: |
| 2177 | | tc0100scn->fgscrollx = -data; |
| 2179 | m_fgscrollx = -data; |
| 2178 | 2180 | break; |
| 2179 | 2181 | |
| 2180 | 2182 | case 0x02: |
| 2181 | | tc0100scn->tilemap[2][0]->set_scrollx(0, -data); |
| 2182 | | tc0100scn->tilemap[2][1]->set_scrollx(0, -data); |
| 2183 | m_tilemap[2][0]->set_scrollx(0, -data); |
| 2184 | m_tilemap[2][1]->set_scrollx(0, -data); |
| 2183 | 2185 | break; |
| 2184 | 2186 | |
| 2185 | 2187 | case 0x03: |
| 2186 | | tc0100scn->bgscrolly = -data; |
| 2188 | m_bgscrolly = -data; |
| 2187 | 2189 | break; |
| 2188 | 2190 | |
| 2189 | 2191 | case 0x04: |
| 2190 | | tc0100scn->fgscrolly = -data; |
| 2192 | m_fgscrolly = -data; |
| 2191 | 2193 | break; |
| 2192 | 2194 | |
| 2193 | 2195 | case 0x05: |
| 2194 | | tc0100scn->tilemap[2][0]->set_scrolly(0, -data); |
| 2195 | | tc0100scn->tilemap[2][1]->set_scrolly(0, -data); |
| 2196 | m_tilemap[2][0]->set_scrolly(0, -data); |
| 2197 | m_tilemap[2][1]->set_scrolly(0, -data); |
| 2196 | 2198 | break; |
| 2197 | 2199 | |
| 2198 | 2200 | case 0x06: |
| 2199 | 2201 | { |
| 2200 | | int old_width = tc0100scn->dblwidth; |
| 2201 | | tc0100scn->dblwidth = (data & 0x10) >> 4; |
| 2202 | int old_width = m_dblwidth; |
| 2203 | m_dblwidth = (data & 0x10) >> 4; |
| 2202 | 2204 | |
| 2203 | | if (tc0100scn->dblwidth != old_width) /* tilemap width is changing */ |
| 2205 | if (m_dblwidth != old_width) /* tilemap width is changing */ |
| 2204 | 2206 | { |
| 2205 | 2207 | /* Reinitialise layer pointers */ |
| 2206 | | tc0100scn_set_layer_ptrs(tc0100scn); |
| 2208 | set_layer_ptrs(); |
| 2207 | 2209 | |
| 2208 | 2210 | /* and ensure full redraw of the tilemaps */ |
| 2209 | | tc0100scn_dirty_tilemaps(device); |
| 2211 | dirty_tilemaps(); |
| 2210 | 2212 | |
| 2211 | 2213 | /* reset the pointer to the text characters (and dirty them all) */ |
| 2212 | | space.machine().gfx[tc0100scn->tx_gfx]->set_source((UINT8 *)tc0100scn->char_ram); |
| 2214 | space.machine().gfx[m_txnum]->set_source((UINT8 *)m_char_ram); |
| 2213 | 2215 | } |
| 2214 | 2216 | |
| 2215 | 2217 | break; |
| r23805 | r23806 | |
| 2219 | 2221 | { |
| 2220 | 2222 | int flip = (data & 0x01) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0; |
| 2221 | 2223 | |
| 2222 | | tc0100scn->tilemap[0][0]->set_flip(flip); |
| 2223 | | tc0100scn->tilemap[1][0]->set_flip(flip); |
| 2224 | | tc0100scn->tilemap[2][0]->set_flip(flip); |
| 2225 | | tc0100scn->tilemap[0][1]->set_flip(flip); |
| 2226 | | tc0100scn->tilemap[1][1]->set_flip(flip); |
| 2227 | | tc0100scn->tilemap[2][1]->set_flip(flip); |
| 2224 | m_tilemap[0][0]->set_flip(flip); |
| 2225 | m_tilemap[1][0]->set_flip(flip); |
| 2226 | m_tilemap[2][0]->set_flip(flip); |
| 2227 | m_tilemap[0][1]->set_flip(flip); |
| 2228 | m_tilemap[1][1]->set_flip(flip); |
| 2229 | m_tilemap[2][1]->set_flip(flip); |
| 2228 | 2230 | |
| 2229 | 2231 | break; |
| 2230 | 2232 | } |
| r23805 | r23806 | |
| 2232 | 2234 | } |
| 2233 | 2235 | |
| 2234 | 2236 | |
| 2235 | | READ32_DEVICE_HANDLER( tc0100scn_ctrl_long_r ) |
| 2237 | READ32_MEMBER( tc0100scn_device::ctrl_long_r ) |
| 2236 | 2238 | { |
| 2237 | | return (tc0100scn_ctrl_word_r(device, space, offset * 2, 0xffff) << 16) | tc0100scn_ctrl_word_r(device, space, offset * 2 + 1, 0xffff); |
| 2239 | return (ctrl_word_r(space, offset * 2, 0xffff) << 16) | ctrl_word_r(space, offset * 2 + 1, 0xffff); |
| 2238 | 2240 | } |
| 2239 | 2241 | |
| 2240 | | WRITE32_DEVICE_HANDLER( tc0100scn_ctrl_long_w ) |
| 2242 | WRITE32_MEMBER( tc0100scn_device::ctrl_long_w ) |
| 2241 | 2243 | { |
| 2242 | 2244 | if (ACCESSING_BITS_16_31) |
| 2243 | | tc0100scn_ctrl_word_w(device, space, offset * 2, data >> 16, mem_mask >> 16); |
| 2245 | ctrl_word_w(space, offset * 2, data >> 16, mem_mask >> 16); |
| 2244 | 2246 | if (ACCESSING_BITS_0_15) |
| 2245 | | tc0100scn_ctrl_word_w(device, space, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff); |
| 2247 | ctrl_word_w(space, (offset * 2) + 1, data & 0xffff, mem_mask & 0xffff); |
| 2246 | 2248 | } |
| 2247 | 2249 | |
| 2248 | | READ32_DEVICE_HANDLER( tc0100scn_long_r ) |
| 2250 | READ32_MEMBER( tc0100scn_device::long_r ) |
| 2249 | 2251 | { |
| 2250 | | return (tc0100scn_word_r(device, space, offset * 2, 0xffff) << 16) | tc0100scn_word_r(device, space, offset * 2 + 1, 0xffff); |
| 2252 | return (word_r(space, offset * 2, 0xffff) << 16) | word_r(space, offset * 2 + 1, 0xffff); |
| 2251 | 2253 | } |
| 2252 | 2254 | |
| 2253 | | WRITE32_DEVICE_HANDLER( tc0100scn_long_w ) |
| 2255 | WRITE32_MEMBER( tc0100scn_device::long_w ) |
| 2254 | 2256 | { |
| 2255 | 2257 | if (ACCESSING_BITS_16_31) |
| 2256 | 2258 | { |
| 2257 | | int oldword = tc0100scn_word_r(device, space, offset * 2, 0xffff); |
| 2259 | int oldword = word_r(space, offset * 2, 0xffff); |
| 2258 | 2260 | int newword = data >> 16; |
| 2259 | 2261 | if (!ACCESSING_BITS_16_23) |
| 2260 | 2262 | newword |= (oldword & 0x00ff); |
| 2261 | 2263 | if (!ACCESSING_BITS_24_31) |
| 2262 | 2264 | newword |= (oldword & 0xff00); |
| 2263 | | tc0100scn_word_w(device, space, offset * 2, newword, 0xffff); |
| 2265 | word_w(space, offset * 2, newword, 0xffff); |
| 2264 | 2266 | } |
| 2265 | 2267 | if (ACCESSING_BITS_0_15) |
| 2266 | 2268 | { |
| 2267 | | int oldword = tc0100scn_word_r(device, space, (offset * 2) + 1, 0xffff); |
| 2269 | int oldword = word_r(space, (offset * 2) + 1, 0xffff); |
| 2268 | 2270 | int newword = data& 0xffff; |
| 2269 | 2271 | if (!ACCESSING_BITS_0_7) |
| 2270 | 2272 | newword |= (oldword & 0x00ff); |
| 2271 | 2273 | if (!ACCESSING_BITS_8_15) |
| 2272 | 2274 | newword |= (oldword & 0xff00); |
| 2273 | | tc0100scn_word_w(device, space, (offset * 2) + 1, newword, 0xffff); |
| 2275 | word_w(space, (offset * 2) + 1, newword, 0xffff); |
| 2274 | 2276 | } |
| 2275 | 2277 | } |
| 2276 | 2278 | |
| 2277 | 2279 | |
| 2278 | | void tc0100scn_tilemap_update( device_t *device ) |
| 2280 | void tc0100scn_device::tilemap_update() |
| 2279 | 2281 | { |
| 2280 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2281 | 2282 | int j; |
| 2282 | 2283 | |
| 2283 | | tc0100scn->tilemap[0][tc0100scn->dblwidth]->set_scrolly(0, tc0100scn->bgscrolly); |
| 2284 | | tc0100scn->tilemap[1][tc0100scn->dblwidth]->set_scrolly(0, tc0100scn->fgscrolly); |
| 2284 | m_tilemap[0][m_dblwidth]->set_scrolly(0, m_bgscrolly); |
| 2285 | m_tilemap[1][m_dblwidth]->set_scrolly(0, m_fgscrolly); |
| 2285 | 2286 | |
| 2286 | 2287 | for (j = 0; j < 256; j++) |
| 2287 | | tc0100scn->tilemap[0][tc0100scn->dblwidth]->set_scrollx((j + tc0100scn->bgscrolly) & 0x1ff, tc0100scn->bgscrollx - tc0100scn->bgscroll_ram[j]); |
| 2288 | m_tilemap[0][m_dblwidth]->set_scrollx((j + m_bgscrolly) & 0x1ff, m_bgscrollx - m_bgscroll_ram[j]); |
| 2288 | 2289 | for (j = 0; j < 256; j++) |
| 2289 | | tc0100scn->tilemap[1][tc0100scn->dblwidth]->set_scrollx((j + tc0100scn->fgscrolly) & 0x1ff, tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[j]); |
| 2290 | m_tilemap[1][m_dblwidth]->set_scrollx((j + m_fgscrolly) & 0x1ff, m_fgscrollx - m_fgscroll_ram[j]); |
| 2290 | 2291 | } |
| 2291 | 2292 | |
| 2292 | | static void tc0100scn_tilemap_draw_fg( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t* tmap, int flags, UINT32 priority ) |
| 2293 | void tc0100scn_device::tilemap_draw_fg( bitmap_ind16 &bitmap, const rectangle &cliprect, tilemap_t* tmap, int flags, UINT32 priority ) |
| 2293 | 2294 | { |
| 2294 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2295 | 2295 | const bitmap_ind16 &src_bitmap = tmap->pixmap(); |
| 2296 | 2296 | int width_mask, height_mask, x, y, p; |
| 2297 | 2297 | int column_offset, src_x = 0, src_y = 0; |
| r23805 | r23806 | |
| 2301 | 2301 | width_mask = src_bitmap.width() - 1; |
| 2302 | 2302 | height_mask = src_bitmap.height() - 1; |
| 2303 | 2303 | |
| 2304 | | src_y = (tc0100scn->fgscrolly + scrolly_delta) & height_mask; |
| 2305 | | if (tc0100scn->ctrl[0x7] & 1) // Flipscreen |
| 2304 | src_y = (m_fgscrolly + scrolly_delta) & height_mask; |
| 2305 | if (m_ctrl[0x7] & 1) // Flipscreen |
| 2306 | 2306 | src_y = (256 - src_y) & height_mask; |
| 2307 | 2307 | |
| 2308 | 2308 | //We use cliprect.max_y and cliprect.max_x to support games which use more than 1 screen |
| r23805 | r23806 | |
| 2310 | 2310 | // Row offsets are 'screen space' 0-255 regardless of Y scroll |
| 2311 | 2311 | for (y = 0; y <= cliprect.max_y; y++) |
| 2312 | 2312 | { |
| 2313 | | src_x = (tc0100scn->fgscrollx - tc0100scn->fgscroll_ram[(y + scrolly_delta) & 0x1ff] + scrollx_delta + cliprect.min_x) & width_mask; |
| 2314 | | if (tc0100scn->ctrl[0x7] & 1) // Flipscreen |
| 2313 | src_x = (m_fgscrollx - m_fgscroll_ram[(y + scrolly_delta) & 0x1ff] + scrollx_delta + cliprect.min_x) & width_mask; |
| 2314 | if (m_ctrl[0x7] & 1) // Flipscreen |
| 2315 | 2315 | src_x = (256 - 64 - src_x) & width_mask; |
| 2316 | 2316 | |
| 2317 | 2317 | // Col offsets are 'tilemap' space 0-511, and apply to blocks of 8 pixels at once |
| 2318 | 2318 | for (x = 0; x < cliprect.width(); x++) |
| 2319 | 2319 | { |
| 2320 | | column_offset = tc0100scn->colscroll_ram[(src_x & 0x3ff) / 8]; |
| 2320 | column_offset = m_colscroll_ram[(src_x & 0x3ff) / 8]; |
| 2321 | 2321 | p = src_bitmap.pix16((src_y - column_offset) & height_mask, src_x); |
| 2322 | 2322 | |
| 2323 | 2323 | if ((p & 0xf)!= 0 || (flags & TILEMAP_DRAW_OPAQUE)) |
| 2324 | 2324 | { |
| 2325 | 2325 | bitmap.pix16(y, x + cliprect.min_x) = p; |
| 2326 | | if (device->machine().priority_bitmap.valid()) |
| 2326 | if (machine().priority_bitmap.valid()) |
| 2327 | 2327 | { |
| 2328 | | UINT8 *pri = &device->machine().priority_bitmap.pix8(y); |
| 2328 | UINT8 *pri = &machine().priority_bitmap.pix8(y); |
| 2329 | 2329 | pri[x + cliprect.min_x] |= priority; |
| 2330 | 2330 | } |
| 2331 | 2331 | } |
| r23805 | r23806 | |
| 2335 | 2335 | } |
| 2336 | 2336 | } |
| 2337 | 2337 | |
| 2338 | | int tc0100scn_tilemap_draw( device_t *device, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
| 2338 | int tc0100scn_device::tilemap_draw( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
| 2339 | 2339 | { |
| 2340 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2341 | | int disable = tc0100scn->ctrl[6] & 0xf7; |
| 2340 | int disable = m_ctrl[6] & 0xf7; |
| 2342 | 2341 | rectangle clip = cliprect; |
| 2343 | | clip &= tc0100scn->cliprect; |
| 2342 | clip &= m_cliprect; |
| 2344 | 2343 | |
| 2345 | 2344 | #if 0 |
| 2346 | 2345 | if (disable != 0 && disable != 3 && disable != 7) |
| r23805 | r23806 | |
| 2352 | 2351 | case 0: |
| 2353 | 2352 | if (disable & 0x01) |
| 2354 | 2353 | return 1; |
| 2355 | | tc0100scn->tilemap[0][tc0100scn->dblwidth]->draw(bitmap, clip, flags, priority); |
| 2354 | m_tilemap[0][m_dblwidth]->draw(bitmap, clip, flags, priority); |
| 2356 | 2355 | break; |
| 2357 | 2356 | case 1: |
| 2358 | 2357 | if (disable & 0x02) |
| 2359 | 2358 | return 1; |
| 2360 | | tc0100scn_tilemap_draw_fg(device, bitmap, clip, tc0100scn->tilemap[1][tc0100scn->dblwidth], flags, priority); |
| 2359 | tilemap_draw_fg(bitmap, clip, m_tilemap[1][m_dblwidth], flags, priority); |
| 2361 | 2360 | break; |
| 2362 | 2361 | case 2: |
| 2363 | 2362 | if (disable & 0x04) |
| 2364 | 2363 | return 1; |
| 2365 | | tc0100scn->tilemap[2][tc0100scn->dblwidth]->draw(bitmap, clip, flags, priority); |
| 2364 | m_tilemap[2][m_dblwidth]->draw(bitmap, clip, flags, priority); |
| 2366 | 2365 | break; |
| 2367 | 2366 | } |
| 2368 | 2367 | return 0; |
| 2369 | 2368 | } |
| 2370 | 2369 | |
| 2371 | | int tc0100scn_bottomlayer( device_t *device ) |
| 2370 | int tc0100scn_device::bottomlayer() |
| 2372 | 2371 | { |
| 2373 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(device); |
| 2374 | | return (tc0100scn->ctrl[6] & 0x8) >> 3; |
| 2372 | return (m_ctrl[6] & 0x8) >> 3; |
| 2375 | 2373 | } |
| 2376 | 2374 | |
| 2377 | | const device_type TC0100SCN = &device_creator<tc0100scn_device>; |
| 2378 | 2375 | |
| 2379 | | tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 2380 | | : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock) |
| 2381 | | { |
| 2382 | | m_token = global_alloc_clear(tc0100scn_state); |
| 2383 | | } |
| 2384 | | |
| 2385 | | //------------------------------------------------- |
| 2386 | | // device_config_complete - perform any |
| 2387 | | // operations now that the configuration is |
| 2388 | | // complete |
| 2389 | | //------------------------------------------------- |
| 2390 | | |
| 2391 | | void tc0100scn_device::device_config_complete() |
| 2392 | | { |
| 2393 | | } |
| 2394 | | |
| 2395 | | //------------------------------------------------- |
| 2396 | | // device_start - device-specific startup |
| 2397 | | //------------------------------------------------- |
| 2398 | | |
| 2399 | | void tc0100scn_device::device_start() |
| 2400 | | { |
| 2401 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this); |
| 2402 | | const tc0100scn_interface *intf = tc0100scn_get_interface(this); |
| 2403 | | int xd, yd; |
| 2404 | | |
| 2405 | | tc0100scn->screen = machine().device<screen_device>(intf->screen); |
| 2406 | | |
| 2407 | | /* Set up clipping for multi-TC0100SCN games. We assume |
| 2408 | | this code won't ever affect single screen games: |
| 2409 | | Thundfox is the only one of those with two chips, and |
| 2410 | | we're safe as it uses single width tilemaps. */ |
| 2411 | | |
| 2412 | | tc0100scn->cliprect = tc0100scn->screen->visible_area(); |
| 2413 | | |
| 2414 | | /* use the given gfx sets for bg/tx tiles*/ |
| 2415 | | tc0100scn->bg_gfx = intf->gfxnum; /* 2nd/3rd chips will use the same gfx set */ |
| 2416 | | tc0100scn->tx_gfx = intf->txnum; |
| 2417 | | |
| 2418 | | /* Single width versions */ |
| 2419 | | tc0100scn->tilemap[0][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 2420 | | tc0100scn->tilemap[1][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 2421 | | tc0100scn->tilemap[2][0] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 2422 | | |
| 2423 | | /* Double width versions */ |
| 2424 | | tc0100scn->tilemap[0][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); |
| 2425 | | tc0100scn->tilemap[1][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); |
| 2426 | | tc0100scn->tilemap[2][1] = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(tc0100scn_device::tc0100scn_get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 128, 32); |
| 2427 | | |
| 2428 | | tc0100scn->tilemap[0][0]->set_transparent_pen(0); |
| 2429 | | tc0100scn->tilemap[1][0]->set_transparent_pen(0); |
| 2430 | | tc0100scn->tilemap[2][0]->set_transparent_pen(0); |
| 2431 | | |
| 2432 | | tc0100scn->tilemap[0][1]->set_transparent_pen(0); |
| 2433 | | tc0100scn->tilemap[1][1]->set_transparent_pen(0); |
| 2434 | | tc0100scn->tilemap[2][1]->set_transparent_pen(0); |
| 2435 | | |
| 2436 | | /* Standard width tilemaps. I'm setting the optional chip #2 |
| 2437 | | 7 bits higher and 2 pixels to the left than chip #1 because |
| 2438 | | that's how thundfox wants it. */ |
| 2439 | | |
| 2440 | | xd = (intf->multiscrn_hack == 0) ? (-intf->x_offset) : (-intf->x_offset - 2); |
| 2441 | | yd = (intf->multiscrn_hack == 0) ? (8 - intf->y_offset) : (1 - intf->y_offset); |
| 2442 | | |
| 2443 | | tc0100scn->tilemap[0][0]->set_scrolldx(xd - 16, -intf->flip_xoffs - xd - 16); |
| 2444 | | tc0100scn->tilemap[0][0]->set_scrolldy(yd, -intf->flip_yoffs - yd); |
| 2445 | | tc0100scn->tilemap[1][0]->set_scrolldx(xd - 16, -intf->flip_xoffs - xd - 16); |
| 2446 | | tc0100scn->tilemap[1][0]->set_scrolldy(yd, -intf->flip_yoffs - yd); |
| 2447 | | tc0100scn->tilemap[2][0]->set_scrolldx(xd - 16, -intf->flip_text_xoffs - xd - 16 - 7); |
| 2448 | | tc0100scn->tilemap[2][0]->set_scrolldy(yd, -intf->flip_text_yoffs - yd); |
| 2449 | | |
| 2450 | | /* Double width tilemaps. We must correct offsets for |
| 2451 | | extra chips, as MAME sees offsets from LHS of whole |
| 2452 | | display not from the edges of individual screens. |
| 2453 | | NB flipscreen tilemap offsets are based on Cameltry */ |
| 2454 | | |
| 2455 | | xd = -intf->x_offset - intf->multiscrn_xoffs; |
| 2456 | | yd = 8 - intf->y_offset; |
| 2457 | | |
| 2458 | | tc0100scn->tilemap[0][1]->set_scrolldx(xd - 16, -intf->flip_xoffs - xd - 16); |
| 2459 | | tc0100scn->tilemap[0][1]->set_scrolldy(yd, -intf->flip_yoffs - yd); |
| 2460 | | tc0100scn->tilemap[1][1]->set_scrolldx(xd - 16, -intf->flip_xoffs - xd - 16); |
| 2461 | | tc0100scn->tilemap[1][1]->set_scrolldy(yd, -intf->flip_yoffs - yd); |
| 2462 | | tc0100scn->tilemap[2][1]->set_scrolldx(xd - 16, -intf->flip_text_xoffs - xd - 16 - 7); |
| 2463 | | tc0100scn->tilemap[2][1]->set_scrolldy(yd, -intf->flip_text_yoffs - yd); |
| 2464 | | |
| 2465 | | tc0100scn->tilemap[0][0]->set_scroll_rows(512); |
| 2466 | | tc0100scn->tilemap[1][0]->set_scroll_rows(512); |
| 2467 | | tc0100scn->tilemap[0][1]->set_scroll_rows(512); |
| 2468 | | tc0100scn->tilemap[1][1]->set_scroll_rows(512); |
| 2469 | | |
| 2470 | | tc0100scn->bg_tilemask = 0xffff; /* Mjnquest has 0x7fff tilemask */ |
| 2471 | | |
| 2472 | | tc0100scn->bg_col_mult = 1; /* multiplier for when bg gfx != 4bpp */ |
| 2473 | | tc0100scn->tx_col_mult = 1; /* multiplier needed when bg gfx is 6bpp */ |
| 2474 | | |
| 2475 | | if (machine().gfx[intf->gfxnum]->granularity() == 2) /* Yuyugogo, Yesnoj */ |
| 2476 | | tc0100scn->bg_col_mult = 8; |
| 2477 | | |
| 2478 | | if (machine().gfx[intf->gfxnum]->granularity() == 0x40) /* Undrfire */ |
| 2479 | | tc0100scn->tx_col_mult = 4; |
| 2480 | | |
| 2481 | | //logerror("TC0100SCN bg gfx granularity %04x: multiplier %04x\n", machine().gfx[intf->gfxnum]->granularity(), tc0100scn->tx_col_mult); |
| 2482 | | |
| 2483 | | tc0100scn->ram = auto_alloc_array_clear(machine(), UINT16, TC0100SCN_RAM_SIZE / 2); |
| 2484 | | |
| 2485 | | tc0100scn_set_layer_ptrs(tc0100scn); |
| 2486 | | |
| 2487 | | tc0100scn_set_colbanks(this, 0, 0, 0); /* standard values, only Wgp & multiscreen games change them */ |
| 2488 | | /* we call this here, so that they can be modified at VIDEO_START*/ |
| 2489 | | |
| 2490 | | /* create the char set (gfx will then be updated dynamically from RAM) */ |
| 2491 | | machine().gfx[tc0100scn->tx_gfx] = auto_alloc(machine(), gfx_element(machine(), tc0100scn_charlayout, (UINT8 *)tc0100scn->char_ram, 64, 0)); |
| 2492 | | |
| 2493 | | save_pointer(NAME(tc0100scn->ram), TC0100SCN_RAM_SIZE / 2); |
| 2494 | | save_item(NAME(tc0100scn->ctrl)); |
| 2495 | | save_item(NAME(tc0100scn->dblwidth)); |
| 2496 | | save_item(NAME(tc0100scn->gfxbank)); |
| 2497 | | machine().save().register_postload(save_prepost_delegate(FUNC(tc0100scn_device::tc0100scn_postload), this)); |
| 2498 | | } |
| 2499 | | |
| 2500 | | //------------------------------------------------- |
| 2501 | | // device_reset - device-specific reset |
| 2502 | | //------------------------------------------------- |
| 2503 | | |
| 2504 | | void tc0100scn_device::device_reset() |
| 2505 | | { |
| 2506 | | tc0100scn_state *tc0100scn = tc0100scn_get_safe_token(this); |
| 2507 | | int i; |
| 2508 | | |
| 2509 | | tc0100scn->dblwidth = 0; |
| 2510 | | tc0100scn->colbank = 0; |
| 2511 | | tc0100scn->gfxbank = 0; /* Mjnquest uniquely banks tiles */ |
| 2512 | | |
| 2513 | | for (i = 0; i < 8; i++) |
| 2514 | | tc0100scn->ctrl[i] = 0; |
| 2515 | | } |
| 2516 | | |
| 2517 | | |
| 2518 | | |
| 2519 | 2376 | /***************************************************************************/ |
| 2520 | 2377 | /* */ |
| 2521 | 2378 | /* TC0280GRD / TC0430GRW */ |
trunk/src/mame/video/taito_h.c
| r23805 | r23806 | |
| 86 | 86 | |
| 87 | 87 | for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) |
| 88 | 88 | { |
| 89 | | x0 = tc0080vco_sprram_r(m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff; |
| 90 | | y0 = tc0080vco_sprram_r(m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff; |
| 91 | | zoomx = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8; |
| 92 | | tile_offs = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2; |
| 93 | | ysize = size[(tc0080vco_sprram_r(m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10]; |
| 89 | x0 = m_tc0080vco->sprram_r(space, offs + 1, 0xffff) & 0x3ff; |
| 90 | y0 = m_tc0080vco->sprram_r(space, offs + 0, 0xffff) & 0x3ff; |
| 91 | zoomx = (m_tc0080vco->sprram_r(space, offs + 2, 0xffff) & 0x7f00) >> 8; |
| 92 | tile_offs = (m_tc0080vco->sprram_r(space, offs + 3, 0xffff) & 0x1fff) << 2; |
| 93 | ysize = size[(m_tc0080vco->sprram_r(space, offs, 0xffff) & 0x0c00) >> 10]; |
| 94 | 94 | |
| 95 | 95 | if (tile_offs) |
| 96 | 96 | { |
| r23805 | r23806 | |
| 112 | 112 | if (x0 >= 0x200) x0 -= 0x400; |
| 113 | 113 | if (y0 >= 0x200) y0 -= 0x400; |
| 114 | 114 | |
| 115 | | if (tc0080vco_flipscreen_r(m_tc0080vco)) |
| 115 | if (m_tc0080vco->flipscreen_r()) |
| 116 | 116 | { |
| 117 | 117 | x0 = 497 - x0; |
| 118 | 118 | y0 = 498 - y0; |
| r23805 | r23806 | |
| 134 | 134 | { |
| 135 | 135 | int tile, color, flipx, flipy; |
| 136 | 136 | |
| 137 | | tile = tc0080vco_cram_0_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff; |
| 138 | | color = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x001f; |
| 139 | | flipx = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x0040; |
| 140 | | flipy = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x0080; |
| 137 | tile = m_tc0080vco->cram_0_r(space, tile_offs, 0xffff) & 0x7fff; |
| 138 | color = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x001f; |
| 139 | flipx = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x0040; |
| 140 | flipy = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x0080; |
| 141 | 141 | |
| 142 | | if (tc0080vco_flipscreen_r(m_tc0080vco)) |
| 142 | if (m_tc0080vco->flipscreen_r()) |
| 143 | 143 | { |
| 144 | 144 | flipx ^= 0x0040; |
| 145 | 145 | flipy ^= 0x0080; |
| r23805 | r23806 | |
| 182 | 182 | if (offs < 0x01b0 && priority == 0) continue; |
| 183 | 183 | if (offs >= 0x01b0 && priority == 1) continue; |
| 184 | 184 | |
| 185 | | x0 = tc0080vco_sprram_r(m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff; |
| 186 | | y0 = tc0080vco_sprram_r(m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff; |
| 187 | | zoomx = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8; |
| 188 | | zoomy = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 2, 0xffff) & 0x007f); |
| 189 | | tile_offs = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2; |
| 190 | | ysize = size[(tc0080vco_sprram_r(m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10]; |
| 185 | x0 = m_tc0080vco->sprram_r(space, offs + 1, 0xffff) & 0x3ff; |
| 186 | y0 = m_tc0080vco->sprram_r(space, offs + 0, 0xffff) & 0x3ff; |
| 187 | zoomx = (m_tc0080vco->sprram_r(space, offs + 2, 0xffff) & 0x7f00) >> 8; |
| 188 | zoomy = (m_tc0080vco->sprram_r(space, offs + 2, 0xffff) & 0x007f); |
| 189 | tile_offs = (m_tc0080vco->sprram_r(space, offs + 3, 0xffff) & 0x1fff) << 2; |
| 190 | ysize = size[(m_tc0080vco->sprram_r(space, offs, 0xffff) & 0x0c00) >> 10]; |
| 191 | 191 | |
| 192 | 192 | if (tile_offs) |
| 193 | 193 | { |
| r23805 | r23806 | |
| 223 | 223 | if (x0 >= 0x200) x0 -= 0x400; |
| 224 | 224 | if (y0 >= 0x200) y0 -= 0x400; |
| 225 | 225 | |
| 226 | | if (tc0080vco_flipscreen_r(m_tc0080vco)) |
| 226 | if (m_tc0080vco->flipscreen_r()) |
| 227 | 227 | { |
| 228 | 228 | x0 = 497 - x0; |
| 229 | 229 | y0 = 498 - y0; |
| r23805 | r23806 | |
| 246 | 246 | { |
| 247 | 247 | int tile, color, flipx, flipy; |
| 248 | 248 | |
| 249 | | tile = tc0080vco_cram_0_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff; |
| 250 | | color = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x001f; |
| 251 | | flipx = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x0040; |
| 252 | | flipy = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x0080; |
| 249 | tile = m_tc0080vco->cram_0_r(space, tile_offs, 0xffff) & 0x7fff; |
| 250 | color = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x001f; |
| 251 | flipx = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x0040; |
| 252 | flipy = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x0080; |
| 253 | 253 | |
| 254 | | if (tc0080vco_flipscreen_r(m_tc0080vco)) |
| 254 | if (m_tc0080vco->flipscreen_r()) |
| 255 | 255 | { |
| 256 | 256 | flipx ^= 0x0040; |
| 257 | 257 | flipy ^= 0x0080; |
| r23805 | r23806 | |
| 292 | 292 | |
| 293 | 293 | for (offs = 0x03f8 / 2; offs >= 0; offs -= 0x008 / 2) |
| 294 | 294 | { |
| 295 | | x0 = tc0080vco_sprram_r(m_tc0080vco, space, offs + 1, 0xffff) & 0x3ff; |
| 296 | | y0 = tc0080vco_sprram_r(m_tc0080vco, space, offs + 0, 0xffff) & 0x3ff; |
| 297 | | zoomx = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 2, 0xffff) & 0x7f00) >> 8; |
| 298 | | tile_offs = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 3, 0xffff) & 0x1fff) << 2; |
| 299 | | pribit = (tc0080vco_sprram_r(m_tc0080vco, space, offs + 0, 0xffff) & 0x1000) >> 12; |
| 300 | | ysize = size[(tc0080vco_sprram_r(m_tc0080vco, space, offs, 0xffff) & 0x0c00) >> 10]; |
| 295 | x0 = m_tc0080vco->sprram_r(space, offs + 1, 0xffff) & 0x3ff; |
| 296 | y0 = m_tc0080vco->sprram_r(space, offs + 0, 0xffff) & 0x3ff; |
| 297 | zoomx = (m_tc0080vco->sprram_r(space, offs + 2, 0xffff) & 0x7f00) >> 8; |
| 298 | tile_offs = (m_tc0080vco->sprram_r(space, offs + 3, 0xffff) & 0x1fff) << 2; |
| 299 | pribit = (m_tc0080vco->sprram_r(space, offs + 0, 0xffff) & 0x1000) >> 12; |
| 300 | ysize = size[(m_tc0080vco->sprram_r(space, offs, 0xffff) & 0x0c00) >> 10]; |
| 301 | 301 | |
| 302 | 302 | if (tile_offs) |
| 303 | 303 | { |
| r23805 | r23806 | |
| 317 | 317 | zx = (dx + ex) << 12; |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | | if (tc0080vco_scrram_r(m_tc0080vco, space, 0x0002, 0xffff) & 0x8000) |
| 320 | if (m_tc0080vco->scrram_r(space, 0x0002, 0xffff) & 0x8000) |
| 321 | 321 | pribit = 1; |
| 322 | 322 | |
| 323 | 323 | if (x0 >= 0x200) x0 -= 0x400; |
| 324 | 324 | if (y0 >= 0x200) y0 -= 0x400; |
| 325 | 325 | |
| 326 | | if (tc0080vco_flipscreen_r(m_tc0080vco)) |
| 326 | if (m_tc0080vco->flipscreen_r()) |
| 327 | 327 | { |
| 328 | 328 | x0 = 497 - x0; |
| 329 | 329 | y0 = 498 - y0; |
| r23805 | r23806 | |
| 347 | 347 | { |
| 348 | 348 | int tile, color, flipx, flipy; |
| 349 | 349 | |
| 350 | | tile = tc0080vco_cram_0_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x7fff; |
| 351 | | color = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x001f; |
| 352 | | flipx = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x0040; |
| 353 | | flipy = tc0080vco_cram_1_r(m_tc0080vco, space, tile_offs, 0xffff) & 0x0080; |
| 350 | tile = m_tc0080vco->cram_0_r(space, tile_offs, 0xffff) & 0x7fff; |
| 351 | color = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x001f; |
| 352 | flipx = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x0040; |
| 353 | flipy = m_tc0080vco->cram_1_r(space, tile_offs, 0xffff) & 0x0080; |
| 354 | 354 | |
| 355 | 355 | |
| 356 | | if (tc0080vco_flipscreen_r(m_tc0080vco)) |
| 356 | if (m_tc0080vco->flipscreen_r()) |
| 357 | 357 | { |
| 358 | 358 | flipx ^= 0x0040; |
| 359 | 359 | flipy ^= 0x0080; |
| r23805 | r23806 | |
| 393 | 393 | |
| 394 | 394 | UINT32 taitoh_state::screen_update_syvalion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 395 | 395 | { |
| 396 | | tc0080vco_tilemap_update(m_tc0080vco); |
| 396 | m_tc0080vco->tilemap_update(); |
| 397 | 397 | |
| 398 | 398 | taitoh_log_vram(); |
| 399 | 399 | |
| 400 | 400 | bitmap.fill(0, cliprect); |
| 401 | 401 | |
| 402 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 403 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0); |
| 402 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 403 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 1, 0, 0); |
| 404 | 404 | syvalion_draw_sprites(bitmap,cliprect); |
| 405 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0); |
| 405 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 2, 0, 0); |
| 406 | 406 | |
| 407 | 407 | return 0; |
| 408 | 408 | } |
| r23805 | r23806 | |
| 410 | 410 | |
| 411 | 411 | UINT32 taitoh_state::screen_update_recordbr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 412 | 412 | { |
| 413 | | tc0080vco_tilemap_update(m_tc0080vco); |
| 413 | m_tc0080vco->tilemap_update(); |
| 414 | 414 | |
| 415 | 415 | taitoh_log_vram(); |
| 416 | 416 | |
| r23805 | r23806 | |
| 418 | 418 | |
| 419 | 419 | #ifdef MAME_DEBUG |
| 420 | 420 | if (!machine().input().code_pressed(KEYCODE_A)) |
| 421 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 421 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 422 | 422 | if (!machine().input().code_pressed(KEYCODE_S)) |
| 423 | 423 | recordbr_draw_sprites(bitmap, cliprect, 0); |
| 424 | 424 | if (!machine().input().code_pressed(KEYCODE_D)) |
| 425 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0); |
| 425 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 1, 0, 0); |
| 426 | 426 | if (!machine().input().code_pressed(KEYCODE_F)) |
| 427 | 427 | recordbr_draw_sprites(bitmap, cliprect, 1); |
| 428 | 428 | #else |
| 429 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 429 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 430 | 430 | recordbr_draw_sprites(bitmap, cliprect, 0); |
| 431 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0); |
| 431 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 1, 0, 0); |
| 432 | 432 | recordbr_draw_sprites(bitmap, cliprect, 1); |
| 433 | 433 | #endif |
| 434 | 434 | |
| 435 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0); |
| 435 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 2, 0, 0); |
| 436 | 436 | return 0; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | |
| 440 | 440 | UINT32 taitoh_state::screen_update_dleague(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 441 | 441 | { |
| 442 | | tc0080vco_tilemap_update(m_tc0080vco); |
| 442 | m_tc0080vco->tilemap_update(); |
| 443 | 443 | |
| 444 | 444 | taitoh_log_vram(); |
| 445 | 445 | |
| r23805 | r23806 | |
| 447 | 447 | |
| 448 | 448 | #ifdef MAME_DEBUG |
| 449 | 449 | if (!machine().input().code_pressed(KEYCODE_A)) |
| 450 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 450 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 451 | 451 | if (!machine().input().code_pressed(KEYCODE_S)) |
| 452 | 452 | dleague_draw_sprites(bitmap, cliprect, 0); |
| 453 | 453 | if (!machine().input().code_pressed(KEYCODE_D)) |
| 454 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0); |
| 454 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 1, 0, 0); |
| 455 | 455 | if (!machine().input().code_pressed(KEYCODE_F)) |
| 456 | 456 | dleague_draw_sprites(bitmap, cliprect, 1); |
| 457 | 457 | #else |
| 458 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 458 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 0, TILEMAP_DRAW_OPAQUE, 0); |
| 459 | 459 | dleague_draw_sprites (bitmap, cliprect, 0); |
| 460 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 1, 0, 0); |
| 460 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 1, 0, 0); |
| 461 | 461 | dleague_draw_sprites (bitmap, cliprect, 1); |
| 462 | 462 | #endif |
| 463 | 463 | |
| 464 | | tc0080vco_tilemap_draw(m_tc0080vco, bitmap, cliprect, 2, 0, 0); |
| 464 | m_tc0080vco->tilemap_draw(bitmap, cliprect, 2, 0, 0); |
| 465 | 465 | return 0; |
| 466 | 466 | } |