trunk/src/mame/drivers/coolridr.c
| r21219 | r21220 | |
| 413 | 413 | UINT32 m_blit1; // ? |
| 414 | 414 | UINT32 m_blit2; // ? |
| 415 | 415 | UINT32 m_blit3; // ? |
| 416 | UINT32 m_blit4_unused; |
| 416 | 417 | UINT32 m_blit4; // ? |
| 417 | 418 | |
| 418 | | UINT32 m_blit5; // indirection enable + other bits? |
| 419 | UINT32 m_blit5_unused; // indirection enable + other bits? |
| 419 | 420 | int m_indirect_tile_enable; // from m_blit5 |
| 420 | 421 | int m_indirect_zoom_enable; // from m_blit5 |
| 421 | 422 | |
| r21219 | r21220 | |
| 695 | 696 | // 1: xxxxxxxx - "Color Number" (all bits or just lower 16/8?) |
| 696 | 697 | // 2: 00000000 - unknown : OT flag? (transparency) |
| 697 | 698 | // 3: 00000000 - unknown : RF flag? (90 degree rotation) |
| 698 | | // 4: 07000000 - unknown : VF flag? (vertically flipped) |
| 699 | // 4: 07000000 - unknown (draw mode?) |
| 700 | // 4: 00010000 - unknown (set on a few object) |
| 701 | // 4: 00000100 - y-flip? |
| 702 | // 4: 00000001 - x-flip? |
| 699 | 703 | // 5: 00010000 - enable indirect text tile lookup |
| 700 | 704 | // 5: 00000001 - enable line-zoom(?) lookup (road) |
| 701 | 705 | // 6: vvvv---- - "Vertical Cell Count" |
| r21219 | r21220 | |
| 731 | 735 | |
| 732 | 736 | // 00??0uuu |
| 733 | 737 | // ?? seems to be 00 or 7f |
| 734 | | // uuu, at least 11 bits used, maybe 12 |
| 738 | // uuu, at least 11 bits used, maybe 12 usually the same as m_blit1? leftover? |
| 735 | 739 | |
| 736 | 740 | } |
| 737 | 741 | else if (m_blitterSerialCount == 3) |
| r21219 | r21220 | |
| 743 | 747 | } |
| 744 | 748 | else if (m_blitterSerialCount == 4) |
| 745 | 749 | { |
| 746 | | m_blit4 = data; |
| 750 | m_blit4_unused = data & 0xf8fefefe; |
| 751 | m_blit4 = data & 0x07010101; |
| 747 | 752 | |
| 748 | | //0x000y0z |
| 749 | | // x = 1, 2, 3 or 7 |
| 750 | | // y = 0 or 1 |
| 751 | | // z = 0 or 1 |
| 753 | if (m_blit4_unused) printf("unknown bits in blit word %d - %08x\n", m_blitterSerialCount, m_blit4_unused); |
| 754 | |
| 755 | // ---- -111 ---- ---v ---- ---u ---- ---x |
| 756 | // 1 = used bits? (unknown purpose.. might be object colour mode) |
| 757 | // x = x-flip? |
| 758 | // u = probably y-flip? used on a few objects here and there... |
| 759 | // v = unknown, not used much, occasional object |
| 752 | 760 | } |
| 753 | 761 | else if (m_blitterSerialCount == 5) |
| 754 | 762 | { |
| 755 | | m_blit5 = data&0xfffefffe; |
| 763 | m_blit5_unused = data&0xfffefffe; |
| 756 | 764 | // this might enable the text indirection thing? |
| 757 | 765 | m_indirect_tile_enable = (data & 0x00010000)>>16; |
| 758 | 766 | m_indirect_zoom_enable = (data & 0x00000001); |
| 759 | 767 | |
| 760 | 768 | |
| 761 | | if (m_blit5) printf("unknown bits in blit word %d - %08x\n", m_blitterSerialCount, m_blit5); |
| 769 | if (m_blit5_unused) printf("unknown bits in blit word %d - %08x\n", m_blitterSerialCount, m_blit5_unused); |
| 762 | 770 | // 00010000 (text) |
| 763 | 771 | // 00000001 (other) |
| 764 | 772 | |
| r21219 | r21220 | |
| 815 | 823 | { |
| 816 | 824 | // with this bit enabled m_blit10 is a look up to the zoom(?) value eg. 03f42600 |
| 817 | 825 | //UINT32 temp = space.read_dword(m_blit10); |
| 818 | | //printf("road type blit %08x %08x %08x %08x %08x %08x %04x %04x %04x %04x %08x %08x (TEMP %08x) %d %d\n", m_blit0, m_blit1, m_blit2, m_blit3, m_blit4, m_blit5, m_vCellCount, m_hCellCount, m_vZoom, m_hZoom, m_blit10, data, temp, m_vPosition, m_hPosition); |
| 826 | //printf("road type blit %08x %08x %08x %08x %08x(%08x) %08x %04x %04x %04x %04x %08x %08x (TEMP %08x) %d %d\n", m_blit0, m_blit1, m_blit2, m_blit3, m_blit4_unused, m_blit4, m_blit5_unused, m_vCellCount, m_hCellCount, m_vZoom, m_hZoom, m_blit10, data, temp, m_vPosition, m_hPosition); |
| 819 | 827 | |
| 820 | 828 | /* for the horizontal road during attract there are tables 0x480 bytes long (0x120 dwords) and the value passed points to the start of them */ |
| 821 | 829 | /* cell sizes for those are are 0011 (v) 0007 (h) with zoom factors of 0020 (half v) 0040 (normal h) */ |
| r21219 | r21220 | |
| 823 | 831 | |
| 824 | 832 | } |
| 825 | 833 | |
| 834 | |
| 835 | int random; |
| 826 | 836 | |
| 837 | random = 0; |
| 838 | |
| 839 | // not used much.. |
| 840 | if (m_blit4 &0x00010000) |
| 841 | { |
| 842 | // printf("type blit %08x %08x %08x %08x %08x(%08x) %08x %04x %04x %04x %04x %08x %08x %d %d\n", m_blit0, m_blit1, m_blit2, m_blit3, m_blit4_unused, m_blit4, m_blit5_unused, m_vCellCount, m_hCellCount, m_vZoom, m_hZoom, m_blit10, data, m_vPosition, m_hPosition); |
| 843 | m_colorNumber = machine().rand() | 0xff000000; |
| 844 | random = 1; |
| 845 | } |
| 846 | else |
| 847 | { |
| 848 | |
| 849 | } |
| 850 | |
| 827 | 851 | bitmap_rgb32* drawbitmap; |
| 828 | 852 | |
| 829 | 853 | // 0x30 - 0x60 are definitely the left screen, 0x90 - 0xc0 are definitely the right screen.. the modes seem priority related |
| r21219 | r21220 | |
| 873 | 897 | break; |
| 874 | 898 | } |
| 875 | 899 | |
| 900 | |
| 876 | 901 | // Splat some sprites |
| 877 | 902 | for (int h = 0; h < m_hCellCount; h++) |
| 878 | 903 | { |
| r21219 | r21220 | |
| 908 | 933 | if (blockwide<=0) blockwide = 1; |
| 909 | 934 | if (blockhigh<=0) blockhigh = 1; |
| 910 | 935 | |
| 936 | |
| 937 | UINT32 color = 0xffffffff; |
| 938 | // HACKS to draw coloured blocks in easy to distinguish colours |
| 939 | if (m_blitterMode == 0x30 || m_blitterMode == 0x90) |
| 940 | { |
| 941 | if (m_colorNumber == 0x5b) |
| 942 | color = 0xffff0000; |
| 943 | else if (m_colorNumber == 0x5d) |
| 944 | color = 0xff00ff00; |
| 945 | else if (m_colorNumber == 0x5e) |
| 946 | color = 0xff0000ff; |
| 947 | else |
| 948 | color = 0xff00ffff; |
| 949 | } |
| 950 | else if (m_blitterMode == 0x40 || m_blitterMode == 0xa0) |
| 951 | { |
| 952 | color = 0xff000000 | (((m_colorNumber & 0xff) | 0x80)-0x40); |
| 953 | } |
| 954 | else if (m_blitterMode == 0x50 || m_blitterMode == 0xb0) |
| 955 | { |
| 956 | color = 0xff000000 | ((((m_colorNumber & 0xff) | 0x80)-0x40) << 8); |
| 957 | } |
| 958 | else if (m_blitterMode == 0x60 || m_blitterMode == 0xc0) |
| 959 | { |
| 960 | color = 0xff000000 | ((((m_colorNumber & 0xff) | 0x80)-0x40) << 16); |
| 961 | } |
| 962 | if (random == 1) |
| 963 | color = m_colorNumber; |
| 964 | |
| 911 | 965 | // DEBUG: Draw 16x16 block |
| 912 | | for (int x = 0; x < blockwide; x++) |
| 966 | for (int y = 0; y < blockhigh; y++) |
| 913 | 967 | { |
| 914 | | for (int y = 0; y < blockhigh; y++) |
| 968 | int drawy = pixelOffsetY+y; |
| 969 | if ((drawy>383) || (drawy<0)) continue; |
| 970 | |
| 971 | for (int x = 0; x < blockwide; x++) |
| 915 | 972 | { |
| 973 | int drawx = pixelOffsetX+x; |
| 974 | if ((drawx>=495 || drawx<0)) continue; |
| 916 | 975 | |
| 917 | | UINT32 color = 0xffffffff; |
| 918 | | // HACKS to draw coloured blocks in easy to distinguish colours |
| 919 | | if (m_blitterMode == 0x30 || m_blitterMode == 0x90) |
| 920 | | { |
| 921 | | if (m_colorNumber == 0x5b) |
| 922 | | color = 0xffff0000; |
| 923 | | else if (m_colorNumber == 0x5d) |
| 924 | | color = 0xff00ff00; |
| 925 | | else if (m_colorNumber == 0x5e) |
| 926 | | color = 0xff0000ff; |
| 927 | | else |
| 928 | | color = 0xff00ffff; |
| 929 | | } |
| 930 | | else if (m_blitterMode == 0x40 || m_blitterMode == 0xa0) |
| 931 | | { |
| 932 | | color = 0xff000000 | (((m_colorNumber & 0xff) | 0x80)-0x40); |
| 933 | | } |
| 934 | | else if (m_blitterMode == 0x50 || m_blitterMode == 0xb0) |
| 935 | | { |
| 936 | | color = 0xff000000 | ((((m_colorNumber & 0xff) | 0x80)-0x40) << 8); |
| 937 | | } |
| 938 | | else if (m_blitterMode == 0x60 || m_blitterMode == 0xc0) |
| 939 | | { |
| 940 | | color = 0xff000000 | ((((m_colorNumber & 0xff) | 0x80)-0x40) << 16); |
| 941 | | } |
| 942 | | |
| 943 | | |
| 944 | | if (drawbitmap->cliprect().contains(pixelOffsetX+x, pixelOffsetY+y)) |
| 945 | | if (drawbitmap->pix32(pixelOffsetY+y, pixelOffsetX+x)==0) drawbitmap->pix32(pixelOffsetY+y, pixelOffsetX+x) = color; |
| 976 | if (drawbitmap->pix32(drawy,drawx)==0) drawbitmap->pix32(drawy, drawx) = color; |
| 946 | 977 | } |
| 947 | 978 | } |
| 948 | 979 | } |