trunk/src/mame/drivers/coolridr.c
| r21388 | r21389 | |
| 438 | 438 | |
| 439 | 439 | UINT8* m_compressedgfx; |
| 440 | 440 | UINT16* m_expanded_10bit_gfx; |
| 441 | UINT16* m_rearranged_16bit_gfx; |
| 441 | 442 | |
| 442 | 443 | UINT32 get_20bit_data(UINT32 romoffset, int _20bitwordnum); |
| 443 | 444 | UINT16 get_10bit_data(UINT32 romoffset, int _10bitwordnum); |
| r21388 | r21389 | |
| 659 | 660 | if (!line[drawx]) \ |
| 660 | 661 | { \ |
| 661 | 662 | int r,g,b; \ |
| 662 | | int dot; \ |
| 663 | UINT16 dot; \ |
| 663 | 664 | int color_offs; \ |
| 664 | | color_offs = (b1colorNumber & 0x3ff)*0x40; \ |
| 665 | | color_offs+= pix & 0x3e; \ |
| 666 | | color_offs+= (pix & 0x01)*0x400000; \ |
| 667 | | color_offs+= 0x1ec800; \ |
| 668 | | dot = (m_compressedgfx[color_offs+0]<<8) | m_compressedgfx[color_offs+1]; \ |
| 665 | /* color_offs = (b1colorNumber & 0x3ff)*0x40;*/ \ |
| 666 | /* color_offs+= (pix & 0x38)>>2; */ \ |
| 667 | /* color_offs+= (pix & 0x07)*0x400000; */ \ |
| 668 | /* color_offs+= 0x1ec800; */ \ |
| 669 | /* dot = (m_compressedgfx[color_offs+0]<<8) | m_compressedgfx[color_offs+1]; */ \ |
| 670 | color_offs = (b1colorNumber & 0x3ff)*0x40 * 5; /* yes, * 5 */ \ |
| 671 | color_offs+= (pix & 0x3f); \ |
| 672 | color_offs+= 0x1ec800 * 5; \ |
| 673 | dot = (m_rearranged_16bit_gfx[color_offs]); \ |
| 669 | 674 | r = pal5bit((dot >> 10) & 0x1f); \ |
| 670 | 675 | g = pal5bit((dot >> 5) & 0x1f); \ |
| 671 | 676 | b = pal5bit((dot >> 0) & 0x1f); \ |
| r21388 | r21389 | |
| 674 | 679 | } \ |
| 675 | 680 | } \ |
| 676 | 681 | |
| 682 | |
| 683 | //m_rearranged_16bit_gfx |
| 684 | //m_expanded_10bit_gfx |
| 685 | |
| 677 | 686 | /* This is a RLE-based sprite blitter (US Patent #6,141,122), very unusual from Sega... */ |
| 678 | 687 | void coolridr_state::blit_current_sprite(address_space &space) |
| 679 | 688 | { |
| r21388 | r21389 | |
| 2293 | 2302 | m_expanded_10bit_gfx[i] = get_10bit_data( 0, i); |
| 2294 | 2303 | } |
| 2295 | 2304 | |
| 2305 | // do a rearranged version too with just the 16-bit words in a different order, palettes seem to |
| 2306 | // be referenced this way?! |
| 2307 | m_rearranged_16bit_gfx = auto_alloc_array(machine(), UINT16, size/2); |
| 2308 | |
| 2309 | UINT16* compressed = (UINT16*)memregion( "compressedgfx" )->base(); |
| 2310 | int count = 0; |
| 2311 | for (int i=0;i<size/2/10;i++) |
| 2312 | { |
| 2313 | m_rearranged_16bit_gfx[count+0] = ((compressed[i+((0x0400000/2)*0)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*0)]&0xff00) >> 8); |
| 2314 | m_rearranged_16bit_gfx[count+1] = ((compressed[i+((0x0400000/2)*1)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*1)]&0xff00) >> 8); |
| 2315 | m_rearranged_16bit_gfx[count+2] = ((compressed[i+((0x0400000/2)*2)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*2)]&0xff00) >> 8); |
| 2316 | m_rearranged_16bit_gfx[count+3] = ((compressed[i+((0x0400000/2)*3)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*3)]&0xff00) >> 8); |
| 2317 | m_rearranged_16bit_gfx[count+4] = ((compressed[i+((0x0400000/2)*4)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*4)]&0xff00) >> 8); |
| 2318 | m_rearranged_16bit_gfx[count+5] = ((compressed[i+((0x0400000/2)*5)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*5)]&0xff00) >> 8); |
| 2319 | m_rearranged_16bit_gfx[count+6] = ((compressed[i+((0x0400000/2)*6)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*6)]&0xff00) >> 8); |
| 2320 | m_rearranged_16bit_gfx[count+7] = ((compressed[i+((0x0400000/2)*7)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*7)]&0xff00) >> 8); |
| 2321 | m_rearranged_16bit_gfx[count+8] = ((compressed[i+((0x0400000/2)*8)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*8)]&0xff00) >> 8); |
| 2322 | m_rearranged_16bit_gfx[count+9] = ((compressed[i+((0x0400000/2)*9)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*9)]&0xff00) >> 8); |
| 2323 | count+=10; |
| 2324 | } |
| 2325 | |
| 2326 | |
| 2296 | 2327 | if (0) |
| 2297 | 2328 | { |
| 2298 | 2329 | FILE *fp; |