Previous 199869 Revisions Next

r21232 Wednesday 20th February, 2013 at 20:13:05 UTC by David Haywood
more documentation of where bits are used.. I think one of the blit params is a rom offset, so maybe it does decompress at blit time afterall, although for the ASCII parts that param is 0.
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21231r21232
374374      m_blitterSerialCount(0x00),
375375      m_blitterMode(0x00),
376376      m_textOffset(0x0000),
377      m_colorNumber(0x00000000),
378377      m_vCellCount(0x0000),
379378      m_hCellCount(0x0000),
380379      m_vPosition(0x0000),
r21231r21232
399398   INT16  m_blitterSerialCount;
400399   UINT8  m_blitterMode;
401400   UINT16 m_textOffset;
402   UINT32 m_colorNumber;
403401   UINT16 m_vCellCount;
404402   UINT16 m_hCellCount;
405403   int m_vPosition;
r21231r21232
410408   UINT16 m_vZoom;
411409   UINT16 m_hZoom;
412410   UINT32 m_blit0; // ?
413   UINT32 m_blit1; // ?
414   UINT32 m_blit2; // ?
411   UINT32 m_blit1_unused; // ?
412   UINT32 m_b1mode; // ?
413   UINT32 m_b1colorNumber;
414   UINT32 m_blit2_unused; // ?
415   UINT32 m_b2tpen;
416   UINT32 m_b2colorNumber;
417
415418   UINT32 m_blit3; // ?
416419   UINT32 m_blit4_unused;
417420   UINT32 m_blit4; // ?
r21231r21232
476479   TIMER_DEVICE_CALLBACK_MEMBER(system_h1_sub);
477480};
478481
482#define PRINT_BLIT_STUFF \
483   printf("type blit %08x %08x(%d, %03x) %08x(%02x, %03x) %08x %08x(%08x) %08x(%d,%d) %04x %04x %04x %04x %08x %08x %d %d\n", m_blit0, m_blit1_unused,m_b1mode,m_b1colorNumber, m_blit2_unused,m_b2tpen,m_b2colorNumber, m_blit3, m_blit4_unused, m_blit4, m_blit5_unused, m_indirect_tile_enable, m_indirect_zoom_enable, m_vCellCount, m_hCellCount, m_vZoom, m_hZoom, m_blit10, data, m_vPosition, m_hPosition); \
479484
480485
481486/* video */
r21231r21232
693698         {
694699            // Serialized 32-bit words in order of appearance:
695700            //  0: 00000000 - unknown, 0x00000000 or 0x00000001, 0 seems to be regular sprite, 1 seems to change meaning of below, possible clip area?
696            //  1: xxxxxxxx - "Color Number" (all bits or just lower 16/8?)
697            //  2: 00000000 - unknown : OT flag?  (transparency)
698            //  3: 00000000 - unknown : RF flag?  (90 degree rotation)
701            //  1: 00010000 - unknown, color mode? (7bpp select?) set on player bike object
702            //  1: 00000xxx - "Color Number" (all bits or just lower 16/8?)
703            //  2: 007f0000 - unknown, transpen? set to 0x7f whenever the 'color mode' bit in (1) is set, otherwise 0
704            //  2: 00000xxx - unknown, usually a copy of color number, leftover?
705            //  3: 001fffff - offset to compressed data? (it's 0 on text objects tho, but maybe the ascii tiles are a special decode to go with the indirect mode)
699706            //  4: 07000000 - unknown (draw mode?)
700707            //  4: 00010000 - unknown (set on a few object)
701708            //  4: 00000100 - y-flip?
r21231r21232
731738            }
732739            else if (m_blitterSerialCount == 1)
733740            {
734               // 000u0ccc  - c = colour? u = 0/1
735               m_blit1 = data;
741               m_blit1_unused = 0; m_b1mode = 0; m_b1colorNumber = 0;
736742
737               m_colorNumber = (data & 0x000000ff);    // Probably more bits
738            //   if (data!=0) printf("blit %08x\n", data);
743               if (!(m_blit0 & 1)) // don't bother for non-sprites
744               {
745                  // 000u0ccc  - c = colour? u = 0/1
746                  m_blit1_unused = data & 0xfffef800;
747                  m_b1mode = (data & 0x00010000)>>16;
748                  m_b1colorNumber = (data & 0x000007ff);    // Probably more bits
749           
750                  if (m_blit1_unused!=0) printf("blit1 unknown bits set %08x\n", data);
751               }
739752            }
740753            else if (m_blitterSerialCount == 2)
741754            {
742               // seems to be more complex than just transparency
743               m_blit2 = data;
755               if (!(m_blit0 & 1)) // don't bother for non-sprites
756               {   
757               
758                  // seems to be more complex than just transparency
759                  m_blit2_unused = data&0xff80f800;
760                  m_b2tpen = (data & 0x007f0000)>>16;
761                  m_b2colorNumber = (data & 0x000007ff);
762               
763                  if (m_blit2_unused!=0) printf("blit1 unknown bits set %08x\n", data);
764                  if (m_b1mode)
765                  {
766                     if (m_b2tpen != 0x7f) printf("m_b1mode 1, m_b2tpen!=0x7f");
767                  }
768                  else
769                  {
770                     if (m_b2tpen != 0x00) printf("m_b1mode 0, m_b2tpen!=0x00");
771                  }
744772
745                // 00??0uuu 
746                // ?? seems to be 00 or 7f
747                // uuu, at least 11 bits used, maybe 12 usually the same as m_blit1? leftover?
773                   // 00??0uuu 
774                   // ?? seems to be 00 or 7f, set depending on b1mode
775                   // uuu, at least 11 bits used, maybe 12 usually the same as m_blit1_unused? leftover?
776               }
748777
749778            }
750779            else if (m_blitterSerialCount == 3)
r21231r21232
822851
823852                  // these are something else, not sprites?  It still writes 11 dwords I think they have a different meaning
824853                  // it might be a clipping area set? looks potentially like co-ordinates at least
825                  //printf("NON-SPRITE 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);
826
854                  //printf("non sprite: ");
855                  //PRINT_BLIT_STUFF
827856               }
828857               else
829858               {
r21231r21232
845874                  {
846875                     // with this bit enabled m_blit10 is a look up to the zoom(?) value eg. 03f42600
847876                     //UINT32 temp = space.read_dword(m_blit10);
848                     //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);
849               
877                     //PRINT_BLIT_STUFF     
850878                     /* for the horizontal road during attract there are tables 0x480 bytes long (0x120 dwords) and the value passed points to the start of them */
851879                     /* cell sizes for those are are 0011 (v) 0007 (h) with zoom factors of 0020 (half v) 0040 (normal h) */
852880                     /* tables seem to be 2x 8-bit values, possibly zoom + linescroll, although ingame ones seem to be 2x16-bit (corrupt? more meaning) */
r21231r21232
862890                  /*
863891                  if (m_blit4 &0x00010000)
864892                  {
865                     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);
866                     m_colorNumber = machine().rand() | 0xff000000;
893                     //PRINT_BLIT_STUFF
894                     m_b1colorNumber = machine().rand() | 0xff000000;
867895                     random = 1;
868896                  }
869897                  else
r21231r21232
872900                  }
873901                  */
874902
903                  //if (m_b1mode)
904                  //{
905                     //PRINT_BLIT_STUFF
906                  //}
907                  //else
908                  //{
909                  //   return;
910                  //}
911
875912                  bitmap_rgb32* drawbitmap;
876913
877914                  // 0x30 - 0x60 are definitely the left screen, 0x90 - 0xc0 are definitely the right screen.. the modes seem priority related
r21231r21232
962999                        // HACKS to draw coloured blocks in easy to distinguish colours
9631000                        if (m_blitterMode == 0x30 || m_blitterMode == 0x90)
9641001                        {
965                           if (m_colorNumber == 0x5b)
1002                           if (m_b1colorNumber == 0x5b)
9661003                              color = 0xffff0000;
967                           else if (m_colorNumber == 0x5d)
1004                           else if (m_b1colorNumber == 0x5d)
9681005                              color = 0xff00ff00;
969                           else if (m_colorNumber == 0x5e)
1006                           else if (m_b1colorNumber == 0x5e)
9701007                              color = 0xff0000ff;
9711008                           else
9721009                              color = 0xff00ffff;
9731010                        }
9741011                        else if (m_blitterMode == 0x40 || m_blitterMode == 0xa0)
9751012                        {
976                           color = 0xff000000 | (((m_colorNumber & 0xff) | 0x80)-0x40);
1013                           color = 0xff000000 | (((m_b1colorNumber & 0xff) | 0x80)-0x40);
9771014                        }
9781015                        else if (m_blitterMode == 0x50 || m_blitterMode == 0xb0)
9791016                        {
980                           color = 0xff000000 | ((((m_colorNumber & 0xff) | 0x80)-0x40) << 8);
1017                           color = 0xff000000 | ((((m_b1colorNumber & 0xff) | 0x80)-0x40) << 8);
9811018                        }
9821019                        else if (m_blitterMode == 0x60 || m_blitterMode == 0xc0)
9831020                        {
984                           color = 0xff000000 | ((((m_colorNumber & 0xff) | 0x80)-0x40) << 16);
1021                           color = 0xff000000 | ((((m_b1colorNumber & 0xff) | 0x80)-0x40) << 16);
9851022                        }
9861023                        if (random == 1)
987                           color = m_colorNumber;
1024                           color = m_b1colorNumber;
9881025
9891026                        // DEBUG: Draw 16x16 block
9901027                        for (int y = 0; y < blockhigh; y++)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team