Previous 199869 Revisions Next

r21334 Friday 22nd February, 2013 at 20:31:36 UTC by David Haywood
notes based on some (failed) test
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21333r21334
394394   UINT16 m_textBytesToWrite;
395395   INT16  m_blitterSerialCount;
396396   UINT8  m_blitterMode;
397   UINT16 m_blitterAddr;
397398   UINT16 m_textOffset;
398399   UINT32 m_blitterClearMode;
399400   INT16 m_blitterClearCount;
r21333r21334
425426   required_shared_ptr<UINT32> m_sound_dma;
426427   required_shared_ptr<UINT16> m_soundram;
427428   required_shared_ptr<UINT16> m_soundram2;
428   bitmap_rgb32 m_temp_bitmap_sprites;
429   bitmap_rgb32 m_temp_bitmap_sprites2;
429   bitmap_rgb32 m_temp_bitmap_sprites[4];
430   bitmap_rgb32 m_temp_bitmap_sprites2[4];
430431   bitmap_rgb32 m_screen1_bitmap;
431432   bitmap_rgb32 m_screen2_bitmap;
432433   int m_color;
r21333r21334
489490
490491void coolridr_state::video_start()
491492{
492   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites);
493   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites2);
493   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites[0]);
494   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites2[0]);
495
496   // testing, not right
497   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites[1]);
498   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites2[1]);
499   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites[2]);
500   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites2[2]);
501   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites[3]);
502   machine().primary_screen->register_screen_bitmap(m_temp_bitmap_sprites2[3]);
503
494504   machine().primary_screen->register_screen_bitmap(m_screen1_bitmap);
495505   machine().primary_screen->register_screen_bitmap(m_screen2_bitmap);
496506}
r21333r21334
720730   /************* m_spriteblit[3] *************/
721731
722732   UINT32 blit3_unused = m_spriteblit[3] & 0xffe00000;
723   UINT32 b3romoffset = (m_spriteblit[3] & 0x001fffff)*2;
724   // if this is an offset into the compressed m_spriteblit[3] then it's probably a word offset into each rom (each is 0x400000 bytes) with the m_spriteblit[3] from all 10 being used in parallel as per the notes from Charles
725   // this needs verifying as it could instead be an index into some other ram area already decompressed..
726   // 0000xxxx
727   //  to
728   // 001fxxxx
733   UINT32 b3romoffset = (m_spriteblit[3] & 0x001fffff)*16;
729734
730   if (blit3_unused) printf("unknown bits in blit word %d -  %08x\n", m_blitterSerialCount, blit3_unused);
735
736   if (blit3_unused) printf("unknown bits in blit word %d -  %08x\n", 3, blit3_unused);
731737   
732738
733739   /************* m_spriteblit[4] *************/
r21333r21334
737743   UINT32 blit_flipx = m_spriteblit[4] & 0x00000001;
738744   UINT32 blit_flipy = (m_spriteblit[4] & 0x00000100)>>8;
739745   UINT32 blit_rotate = (m_spriteblit[4] & 0x00010000)>>16;
740   if (blit4_unused) printf("unknown bits in blit word %d -  %08x\n", m_blitterSerialCount, blit4_unused);
746   if (blit4_unused) printf("unknown bits in blit word %d -  %08x\n", 4, blit4_unused);
741747
742748   // ---- -111 ---- ---r ---- ---y ---- ---x
743749   // 1 = used bits? (unknown purpose.. might be object colour mode)
r21333r21334
790796
791797   /************* m_spriteblit[10] *************/
792798
793   // this is an address on some objects..
794   // to be specific, the center line of the road (actual road object? which currently gets shown as a single pixel column?)
795   // and the horizontal road used in the background of the title screen (which currently looks normal)
796   // I guess it's some kind of indirect way to do a line effect?
799   // pointer to per-line zoom and scroll data for sprites
797800   UINT32 blit10 =  m_spriteblit[10];
798801
799802   /************* m_spriteblit[11] *************/
r21333r21334
829832
830833   bitmap_rgb32* drawbitmap;
831834
835   /* test code, not right 0x30 is always text, 0x40 hud, 0x50 99% of game objects and 0x60 some background objects, but it doesn't seem directly priority related*/
836   /*
832837   // 0x30 - 0x60 are definitely the left screen, 0x90 - 0xc0 are definitely the right screen.. the modes seem priority related
833838   if (m_blitterMode == 0x30 || m_blitterMode == 0x40 || m_blitterMode == 0x50 || m_blitterMode == 0x60)
834      drawbitmap = &m_temp_bitmap_sprites;
839      drawbitmap = &m_temp_bitmap_sprites[(m_blitterMode-0x30)>>4];
835840   else // 0x90, 0xa0, 0xb0, 0xc0
836      drawbitmap = &m_temp_bitmap_sprites2;
841      drawbitmap = &m_temp_bitmap_sprites2[(m_blitterMode-0x90)>>4];
842   */
837843
844   
845   if (m_blitterMode == 0x30 || m_blitterMode == 0x40 || m_blitterMode == 0x50 || m_blitterMode == 0x60)
846      drawbitmap = &m_temp_bitmap_sprites[0];
847   else // 0x90, 0xa0, 0xb0, 0xc0
848      drawbitmap = &m_temp_bitmap_sprites2[0];
849   
850
838851   int sizey = used_vCellCount * 16 * vZoom;
839852
840853   vPosition *= 0x40;
r21333r21334
925938
926939      }
927940
928      //if ((hOrigin & 3) != 1)
929      //   return;
930941
931942      for (int h = 0; h < used_hCellCount; h++)
932943      {
r21333r21334
982993
983994
984995         // these should be 'cell numbers' (tile numbers) which look up RLE data?
985         UINT32 spriteNumber = (m_expanded_10bit_gfx[ (b3romoffset << 3) + (lookupnum<<1) +0 ] << 10) | (m_expanded_10bit_gfx[ (b3romoffset << 3) + (lookupnum<<1) + 1 ]);
996         UINT32 spriteNumber = (m_expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) +0 ] << 10) | (m_expanded_10bit_gfx[ (b3romoffset) + (lookupnum<<1) + 1 ]);
986997         UINT16 tempshape[16*16];
987998         
988999         // skip the decoding if it's the same tile as last time!
r21333r21334
9961007            while (data_written<256)
9971008            {
9981009
999               UINT16 compdata = m_expanded_10bit_gfx[ (b3romoffset << 3) + spriteNumber + i];
1010               UINT16 compdata = m_expanded_10bit_gfx[ (b3romoffset) + spriteNumber + i];
10001011
10011012               if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100))
10021013               {
r21333r21334
11881199      // The lower word always seems to be 0x0001 and the upper byte always 0xac.
11891200      m_blitterSerialCount = 0;
11901201
1202      m_blitterAddr = data & 0x00000fff;
1203
1204      // maybe it's actually treated like RAM, and blittermode determines the nature of the write (forward inc, backward inc, no inc etc.)
1205      // the m_blitterAddr when used does increase by 6 each time
1206
1207      // not seen this triggered
1208      if ((data & 0xff000000) != 0xac000000)
1209         printf("blitter mode set without upper bits equal 0xac000000\n");
1210
1211      // nor this
1212      if (data & 0x0000f000)
1213         printf("blitter mode with mask 0x0000f000\n");
1214
1215
11911216      // form 0xacMM-xxx   ac = fixed value for this mode?  MM = modes above.  -xxx = some kind of offset? but it doesn't increment for each blit like the textOffset / paletteOffset stuff, investigate
11921217
11931218   }
r21333r21334
13251350      {
13261351         const rectangle& visarea = machine().primary_screen->visible_area();
13271352
1353         // test code
1354         int i = 0;
1355
13281356         if(m_blitterClearMode == 0x8c200000)
13291357         {
1330            copybitmap(m_screen1_bitmap, m_temp_bitmap_sprites, 0, 0, 0, 0, visarea);
1331            m_temp_bitmap_sprites.fill(0, visarea);
1358            copybitmap(m_screen1_bitmap, m_temp_bitmap_sprites[i], 0, 0, 0, 0, visarea);
1359            m_temp_bitmap_sprites[i].fill(0, visarea);
13321360         }
13331361
13341362         if(m_blitterClearMode == 0x8c800000)
13351363         {
1336            copybitmap(m_screen2_bitmap, m_temp_bitmap_sprites2, 0, 0, 0, 0, visarea);
1337            m_temp_bitmap_sprites2.fill(0, visarea);
1364            copybitmap(m_screen2_bitmap, m_temp_bitmap_sprites2[i], 0, 0, 0, 0, visarea);
1365            m_temp_bitmap_sprites2[i].fill(0, visarea);
13381366         }
13391367      }
13401368   }
r21333r21334
13581386      {
13591387         printf("sysh1_unk_blit_w unhandled offset %04x %08x %08x\n", offset, data, mem_mask);
13601388      }
1389      break;
13611390
1391      case 0x01:
1392      {
1393         // writes on startup
1394         // sysh1_unk_blit_w unhandled offset 0001 01010101 ffffffff
1395      }
1396      break;
1397
1398      case 0x02:
1399      {
1400
1401         // writes 3d0dxxxx / 3d0exxxx before a level start.. tilemaps transfer?
1402
1403         //printf("sysh1_unk_blit_w unhandled offset %04x %08x %08x\n", offset, data, mem_mask);
1404
1405     
1406      }
1407      break;
1408
13621409   }
13631410}
13641411

Previous 199869 Revisions Next


© 1997-2024 The MAME Team