Previous 199869 Revisions Next

r21220 Wednesday 20th February, 2013 at 19:06:10 UTC by David Haywood
notes on flip flags etc.
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21219r21220
413413   UINT32 m_blit1; // ?
414414   UINT32 m_blit2; // ?
415415   UINT32 m_blit3; // ?
416   UINT32 m_blit4_unused;
416417   UINT32 m_blit4; // ?
417418
418   UINT32 m_blit5; // indirection enable + other bits?
419   UINT32 m_blit5_unused; // indirection enable + other bits?
419420   int m_indirect_tile_enable; // from m_blit5
420421   int m_indirect_zoom_enable; // from m_blit5
421422
r21219r21220
695696            //  1: xxxxxxxx - "Color Number" (all bits or just lower 16/8?)
696697            //  2: 00000000 - unknown : OT flag?  (transparency)
697698            //  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?
699703            //  5: 00010000 - enable indirect text tile lookup
700704            //  5: 00000001 - enable line-zoom(?) lookup (road)
701705            //  6: vvvv---- - "Vertical Cell Count"
r21219r21220
731735
732736                // 00??0uuu 
733737                // ?? 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?
735739
736740            }
737741            else if (m_blitterSerialCount == 3)
r21219r21220
743747            }
744748            else if (m_blitterSerialCount == 4)
745749            {
746               m_blit4 = data;
750               m_blit4_unused = data & 0xf8fefefe;
751               m_blit4 = data & 0x07010101;
747752
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
752760            }
753761            else if (m_blitterSerialCount == 5)
754762            {
755               m_blit5 = data&0xfffefffe;
763               m_blit5_unused = data&0xfffefffe;
756764               // this might enable the text indirection thing?
757765               m_indirect_tile_enable = (data & 0x00010000)>>16;
758766               m_indirect_zoom_enable = (data & 0x00000001);
759767
760768
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);
762770               // 00010000 (text)
763771               // 00000001 (other)
764772
r21219r21220
815823               {
816824                  // with this bit enabled m_blit10 is a look up to the zoom(?) value eg. 03f42600
817825                  //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);
819827               
820828                  /* for the horizontal road during attract there are tables 0x480 bytes long (0x120 dwords) and the value passed points to the start of them */
821829                  /* cell sizes for those are are 0011 (v) 0007 (h) with zoom factors of 0020 (half v) 0040 (normal h) */
r21219r21220
823831
824832               }
825833
834     
835               int random;
826836               
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           
827851               bitmap_rgb32* drawbitmap;
828852
829853               // 0x30 - 0x60 are definitely the left screen, 0x90 - 0xc0 are definitely the right screen.. the modes seem priority related
r21219r21220
873897                  break;
874898               }
875899
900
876901               // Splat some sprites
877902               for (int h = 0; h < m_hCellCount; h++)
878903               {
r21219r21220
908933                     if (blockwide<=0) blockwide = 1;
909934                     if (blockhigh<=0) blockhigh = 1;
910935
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
911965                     // DEBUG: Draw 16x16 block
912                     for (int x = 0; x < blockwide; x++)
966                     for (int y = 0; y < blockhigh; y++)
913967                     {
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++)
915972                        {
973                           int drawx = pixelOffsetX+x;
974                           if ((drawx>=495 || drawx<0)) continue;
916975
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;
946977                        }
947978                     }
948979                  }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team