Previous 199869 Revisions Next

r21389 Saturday 23rd February, 2013 at 12:45:01 UTC by David Haywood
Sega, think different, or just be schizophrenic
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21388r21389
438438
439439   UINT8* m_compressedgfx;
440440   UINT16* m_expanded_10bit_gfx;
441   UINT16* m_rearranged_16bit_gfx;
441442
442443   UINT32 get_20bit_data(UINT32 romoffset, int _20bitwordnum);
443444   UINT16 get_10bit_data(UINT32 romoffset, int _10bitwordnum);
r21388r21389
659660         if (!line[drawx]) \
660661         { \
661662            int r,g,b; \
662            int dot; \
663            UINT16 dot; \
663664            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]); \
669674            r = pal5bit((dot >> 10) & 0x1f); \
670675            g = pal5bit((dot >> 5) & 0x1f); \
671676            b = pal5bit((dot >> 0) & 0x1f); \
r21388r21389
674679      } \
675680   } \
676681
682
683//m_rearranged_16bit_gfx
684//m_expanded_10bit_gfx
685
677686/* This is a RLE-based sprite blitter (US Patent #6,141,122), very unusual from Sega... */
678687void coolridr_state::blit_current_sprite(address_space &space)
679688{
r21388r21389
22932302      m_expanded_10bit_gfx[i] = get_10bit_data( 0, i);
22942303   }
22952304
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
22962327   if (0)
22972328   {
22982329      FILE *fp;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team