Previous 199869 Revisions Next

r21256 Thursday 21st February, 2013 at 06:46:59 UTC by David Haywood
hey look, sprites...
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21255r21256
426426
427427   UINT32 m_blit10; // an address
428428
429   UINT16 m_tempshape[16*16];
430   
429431   required_device<cpu_device> m_maincpu;
430432   required_device<cpu_device> m_subcpu;
431433   required_device<cpu_device> m_soundcpu;
r21255r21256
671673WRITE32_MEMBER(coolridr_state::sysh1_txt_blit_w)
672674{
673675   COMBINE_DATA(&m_sysh1_txt_blit[offset]);
676   const pen_t *clut = &machine().pens[0];
674677
675
676678   switch(offset)
677679   {
678680      // The mode register
r21255r21256
12161218                                    //00200 (00016590,0)  00200 (00016590,0)
12171219                                    //00210 (00016592,0)  00210 (00016592,0)
12181220
1219                                    for (int i=0;i<18;i++)
1221                                    for (int i=0;i<8*12;i++)
12201222                                    {
12211223                                       UINT16 compdata = get_10bit_data( m_b3romoffset, spriteNumber + i);
12221224                                       printf("%03x ", compdata);
r21255r21256
12271229
12281230                                       // as 10-bit (pretty, I like this)
12291231                                       /*                                                                                   |this is where 210 starts
1230                                       00200 (00016590,0) | 00f 03e 03e 03e 03e 03e 03e 03e 257 257 257 257 257 257 257 257(00f 257)
1231                                       00210 (00016592,0) | 00f 257 257 257 257 207 207 207 207 207 207 207 207 207 207 207 207 207
1232                                       00251 (0001659a,1) | 00f 237 237 237 237 237 237 237 237 237 237 237 237 22f 22f 22f 22f 22f
1233                                       00292 (000165a2,2) | 00f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f
1234                                       002b7 (000165a6,7) | 00f 0be 0be 0be 263 263 263 263 07e 07e 07e 07e 05e 00f 07e 07e 05e 247
1235                                       002c4 (000165a8,4) | 00f 07e 07e 05e 247 247 247 247 247 247 247 247 247 247 247 247 20f 20f
1236                                       002f4 (000165ae,4) | 00f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 233 233 233 233 233
1237                                       00335 (000165b6,5) | 00f 23b 23b 23b 23b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b
1238                                       00373 (000165be,3) | 00f 0fe 0fe 0fe 0fe 0fe 0fe 223 223 223 223 223 223 223 223 223 223 223
1239                                       0038a (000165c1,2) | 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223
1240                                       003ac (000165c5,4) | 00f 17e 15e 1be 1be 1be 1be 1be 19e 217 217 217 217 217 217 217 217 00f
1241                                       003bd (000165c7,5) | 00f 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217
1242                                       003fe (000165cf,6) | 00f 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b
1243                                       00419 (000165d3,1) | 00f 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203
1244                                       0045a (000165db,2) | 00f 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 253
1245                                       0049b (000165e3,3) | 00f 213 213 213 213 213 213 213 213 13e 13e 13e 13e 13e 13e 21b 21b 21b
1246                                       004b2 (000165e6,2) | 000 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b
1247                                       */
1232                                       00200 (00016590,0) | 00f 03e 03e 03e 03e 03e 03e 03e 257 257 257 257 257 257 257 257 (00f 257)
1233                                       00210 (00016592,0) | 00f 257 257 257 257 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 237 237 237 237 237 237 237 237 237 237 237 237 237 237 237 237 (00f 237) - these lines are 64 lone
1234                                       00251 (0001659a,1) | 00f 237 237 237 237 237 237 237 237 237 237 237 237 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f (00f 21f)
1235                                       00292 (000165a2,2) | 00f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 0be 0be 0be 0be (00f 0be)
1236                                       002b7 (000165a6,7) | 00f 0be 0be 0be 263 263 263 263 07e 07e 07e 07e 05e (00f 07e)
1237                                       002c4 (000165a8,4) | 00f 07e 07e 05e 247 247 247 247 247 247 247 247 247 247 247 247 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f (00f 20f)
1238                                       002f4 (000165ae,4) | 00f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b (00f 23b)
1239                                       00335 (000165b6,5) | 00f 23b 23b 23b 23b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 0de (00f 0fe)
1240                                       00373 (000165be,3) | 00f 0fe 0fe 0fe 0fe 0fe 0fe 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 267 267 267 267 17e 17e 17e 17e 15e (00f 17e)
1241                                       0038a (000165c1,2) | 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 267 267 267 267 17e 17e 17e 17e 15e (00f 17e)
1242                                       003ac (000165c5,4) | 00f 17e 15e 1be 1be 1be 1be 1be 19e 217 217 217 217 217 217 217 217 (00f 217)
1243                                       003bd (000165c7,5) | 00f 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b (00f 22b)
1244                                       003fe (000165cf,6) | 00f 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 1fe 1fe 1fe 1fe 1fe 1de (00f 203)
1245                                       00419 (000165d3,1) | 00f 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 (00f 227)
1246                                       0045a (000165db,2) | 00f 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 253 253 253 253 253 253 253 253 253 253 253 253 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 (00f 213)
1247                                       0049b (000165e3,3) | 00f 213 213 213 213 213 213 213 213 13e 13e 13e 13e 13e 13e 21b 21b 21b 21b 21b 21b 21b 21b (000 21b)
1248                                       004b2 (000165e6,2) | 000 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 25f 25f 25f 25f 25b 25b 25b 25b 25b 25b 25b 25b 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f (000 000)
1249                                                                              */
12481250                                    }
12491251                                    printf("\n");
12501252                                 }
r21255r21256
13051307                           // these should be 'cell numbers' (tile numbers) which look up RLE data?
13061308                           spriteNumber = get_20bit_data( m_b3romoffset, lookupnum);     
13071309
1310                           int i = 1;// skip first 10 bits for now
1311                           int data_written = 0;
1312
1313                           while (data_written<256)
1314                           {
1315
1316                              UINT16 compdata = get_10bit_data( m_b3romoffset, spriteNumber + i);
1317                           
1318                              if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100))
1319                              {
1320                                 // mm ccrr rrr0
1321                                 int encodelength = (compdata & 0x03e)>>1;
1322                                 int data = (compdata & 0x3c0) >> 6;
1323
1324                                 while (data_written<256 && encodelength >=0)
1325                                 {
1326                                    m_tempshape[data_written] = data;
1327                                    encodelength--;
1328                                    data_written++;
1329                                 }
1330                              }
1331                              else if ((compdata & 0x300) == 0x200)
1332                              {
1333                                 // mm cccc ccrr
1334                                 int encodelength = (compdata & 0x003);
1335                                 int data = (compdata & 0x3fc) >> 6;
1336
1337                                 while (data_written<256 && encodelength >=0)
1338                                 {
1339                                    m_tempshape[data_written] = data;
1340                                    encodelength--;
1341                                    data_written++;
1342                                 }
1343
1344                              }
1345                              else
1346                              {
1347                                 // mm cccc cccc
1348                                 m_tempshape[data_written] = data&0xff;
1349                                 data_written++;
1350                              }
1351
1352                              i++;
1353                           }
1354
1355                           
1356                           //
13081357                           //if (spriteNumber == 0x00)
13091358                           //   continue;
13101359                           
r21255r21256
13471396
13481397                        // DEBUG: Draw 16x16 block
13491398                        UINT32* line;
1399                        for (int y = 0; y < 16; y++)
1400                        {
1401                           const int drawy = pixelOffsetY+y;
1402                           if ((drawy>383) || (drawy<0)) continue;
1403                           line = &drawbitmap->pix32(drawy);
1404
1405                           for (int x = 0; x < 16; x++)
1406                           {
1407                              const int drawx = pixelOffsetX+x;
1408                              if ((drawx>=495 || drawx<0)) continue;
1409
1410                              UINT16 pix = m_tempshape[y*16+x];
1411                              if (pix )
1412                                 if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
1413                           }
1414                        }
1415                        color++;
1416#if 0 // this one does zooming
1417                        // DEBUG: Draw 16x16 block
1418                        UINT32* line;
13501419                        for (int y = 0; y < blockhigh; y++)
13511420                        {
13521421                           const int drawy = pixelOffsetY+y;
r21255r21256
13611430                              if (line[drawx]==0) line[drawx] = color;
13621431                           }
13631432                        }
1433#endif
1434
13641435                     }
13651436                  }
13661437

Previous 199869 Revisions Next


© 1997-2024 The MAME Team