Previous 199869 Revisions Next

r21415 Sunday 24th February, 2013 at 01:49:03 UTC by David Haywood
better transparent pen handling
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21414r21415
550550   base_offset = which * 0x20000;
551551   m_color = which * 2;
552552
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...
553555   for(ydst=cliprect.min_y;ydst<=cliprect.max_y;ydst++)
554556   {
555557      for(xdst=cliprect.min_x;xdst<=cliprect.max_x;xdst++)
r21414r21415
596598
597599   if (which==0)
598600   {
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);
600603   }
601604   else
602605   {
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);
604608   }
605609
606610   return 0;
r21414r21415
689693TODO: fix anything that isn't text.
690694*/
691695
692// because of our copy bitmap any black pens get removed.. obviously this is wrong
693696
694697#define DRAW_PIX \
695   if (pix&0x7fff) \
698   if (pix != 0x8000) \
696699   { \
697700      if (object->zpri < zline[drawx]) \
698701      { \
r21414r21415
706709         } \
707710      } \
708711   } \
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   } \
709719
710720
711721//object->rearranged_16bit_gfx
r21414r21415
10631073
10641074               UINT16 compdata = expanded_10bit_gfx[ (b3romoffset) + spriteNumber + i];
10651075
1066               if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100))
1076               if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100)) // 3bpp
10671077               {
10681078                  // mm ccrr rrr0
10691079                  int encodelength = (compdata & 0x03e)>>1;
r21414r21415
10731083                  // 00120 (00000024,0) | 010 03f
10741084                  if (compdata&1) encodelength = 255;
10751085
1076                  while (data_written<256 && encodelength >=0)
1086                  while (data_written<256 && encodelength >=0) // 6bpp
10771087                  {
10781088                     tempshape[data_written] = rearranged_16bit_gfx[color_offs + rledata];
10791089                     encodelength--;
10801090                     data_written++;
10811091                  }
10821092               }
1083               else if ((compdata & 0x300) == 0x200)
1093               else if ((compdata & 0x300) == 0x200) // 8bpp
10841094               {
10851095                  // mm cccc ccrr
10861096                  int encodelength = (compdata & 0x003);
r21414r21415
17181728         {
17191729            osd_work_queue_wait(m_work_queue[0], osd_ticks_per_second() * 100);
17201730            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);
17221732            m_zbuffer_bitmap.fill(0xffff, visarea);
17231733         }
17241734
r21414r21415
17261736         {
17271737            osd_work_queue_wait(m_work_queue[1], osd_ticks_per_second() * 100);
17281738            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);
17301740            m_zbuffer_bitmap2.fill(0xffff, visarea);
17311741         }
17321742

Previous 199869 Revisions Next


© 1997-2024 The MAME Team