trunk/src/mame/drivers/coolridr.c
| r21414 | r21415 | |
| 550 | 550 | base_offset = which * 0x20000; |
| 551 | 551 | m_color = which * 2; |
| 552 | 552 | |
| 553 | // drawgfx was a lot faster, and I think can handle what we need, even if there |
| 554 | // are RGB effects I think it will be cheaper to manipulate the palette... |
| 553 | 555 | for(ydst=cliprect.min_y;ydst<=cliprect.max_y;ydst++) |
| 554 | 556 | { |
| 555 | 557 | for(xdst=cliprect.min_x;xdst<=cliprect.max_x;xdst++) |
| r21414 | r21415 | |
| 596 | 598 | |
| 597 | 599 | if (which==0) |
| 598 | 600 | { |
| 599 | | copybitmap_trans(bitmap, m_screen1_bitmap, 0, 0, 0, 0, cliprect, 0); |
| 601 | // will probably need a custom function |
| 602 | copybitmap_trans(bitmap, m_screen1_bitmap, 0, 0, 0, 0, cliprect, 0xff000000); |
| 600 | 603 | } |
| 601 | 604 | else |
| 602 | 605 | { |
| 603 | | copybitmap_trans(bitmap, m_screen2_bitmap, 0, 0, 0, 0, cliprect, 0); |
| 606 | // will probably need a custom function |
| 607 | copybitmap_trans(bitmap, m_screen2_bitmap, 0, 0, 0, 0, cliprect, 0xff000000); |
| 604 | 608 | } |
| 605 | 609 | |
| 606 | 610 | return 0; |
| r21414 | r21415 | |
| 689 | 693 | TODO: fix anything that isn't text. |
| 690 | 694 | */ |
| 691 | 695 | |
| 692 | | // because of our copy bitmap any black pens get removed.. obviously this is wrong |
| 693 | 696 | |
| 694 | 697 | #define DRAW_PIX \ |
| 695 | | if (pix&0x7fff) \ |
| 698 | if (pix != 0x8000) \ |
| 696 | 699 | { \ |
| 697 | 700 | if (object->zpri < zline[drawx]) \ |
| 698 | 701 | { \ |
| r21414 | r21415 | |
| 706 | 709 | } \ |
| 707 | 710 | } \ |
| 708 | 711 | } \ |
| 712 | else \ |
| 713 | { \ |
| 714 | /* some alpha sprites have 0x8000 set */ \ |
| 715 | /* but some regular ones text do too? */ \ |
| 716 | /* how do we tell the difference between them? */ \ |
| 717 | /* how would you have a black 0x0000 in an alpha sprite?? */ \ |
| 718 | } \ |
| 709 | 719 | |
| 710 | 720 | |
| 711 | 721 | //object->rearranged_16bit_gfx |
| r21414 | r21415 | |
| 1063 | 1073 | |
| 1064 | 1074 | UINT16 compdata = expanded_10bit_gfx[ (b3romoffset) + spriteNumber + i]; |
| 1065 | 1075 | |
| 1066 | | if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100)) |
| 1076 | if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100)) // 3bpp |
| 1067 | 1077 | { |
| 1068 | 1078 | // mm ccrr rrr0 |
| 1069 | 1079 | int encodelength = (compdata & 0x03e)>>1; |
| r21414 | r21415 | |
| 1073 | 1083 | // 00120 (00000024,0) | 010 03f |
| 1074 | 1084 | if (compdata&1) encodelength = 255; |
| 1075 | 1085 | |
| 1076 | | while (data_written<256 && encodelength >=0) |
| 1086 | while (data_written<256 && encodelength >=0) // 6bpp |
| 1077 | 1087 | { |
| 1078 | 1088 | tempshape[data_written] = rearranged_16bit_gfx[color_offs + rledata]; |
| 1079 | 1089 | encodelength--; |
| 1080 | 1090 | data_written++; |
| 1081 | 1091 | } |
| 1082 | 1092 | } |
| 1083 | | else if ((compdata & 0x300) == 0x200) |
| 1093 | else if ((compdata & 0x300) == 0x200) // 8bpp |
| 1084 | 1094 | { |
| 1085 | 1095 | // mm cccc ccrr |
| 1086 | 1096 | int encodelength = (compdata & 0x003); |
| r21414 | r21415 | |
| 1718 | 1728 | { |
| 1719 | 1729 | osd_work_queue_wait(m_work_queue[0], osd_ticks_per_second() * 100); |
| 1720 | 1730 | copybitmap(m_screen1_bitmap, m_temp_bitmap_sprites[i], 0, 0, 0, 0, visarea); |
| 1721 | | m_temp_bitmap_sprites[i].fill(0, visarea); |
| 1731 | m_temp_bitmap_sprites[i].fill(0xff000000, visarea); |
| 1722 | 1732 | m_zbuffer_bitmap.fill(0xffff, visarea); |
| 1723 | 1733 | } |
| 1724 | 1734 | |
| r21414 | r21415 | |
| 1726 | 1736 | { |
| 1727 | 1737 | osd_work_queue_wait(m_work_queue[1], osd_ticks_per_second() * 100); |
| 1728 | 1738 | copybitmap(m_screen2_bitmap, m_temp_bitmap_sprites2[i], 0, 0, 0, 0, visarea); |
| 1729 | | m_temp_bitmap_sprites2[i].fill(0, visarea); |
| 1739 | m_temp_bitmap_sprites2[i].fill(0xff000000, visarea); |
| 1730 | 1740 | m_zbuffer_bitmap2.fill(0xffff, visarea); |
| 1731 | 1741 | } |
| 1732 | 1742 | |