Previous 199869 Revisions Next

r21296 Friday 22nd February, 2013 at 00:51:55 UTC by David Haywood
temp zoom code, to be improved / rewritten
[src/mame/drivers]coolridr.c

trunk/src/mame/drivers/coolridr.c
r21295r21296
12481248                        }
12491249
12501250
1251                        if (!m_hZoom || !m_vZoom)
1252                        {
1253                           m_blitterSerialCount++;
1254                           return;
1255                        }
12511256
1257                        int blockwide = ((16*m_hZoom)/0x40);
1258                        int blockhigh = ((16*m_vZoom)/0x40);
1259   
12521260
12531261
1254                        int blockwide = ((16*m_hZoom)/0x40)-1;
1255                        int blockhigh = ((16*m_vZoom)/0x40)-1;
1256                        // hack
1257                        if (blockwide<=0) blockwide = 1;
1258                        if (blockhigh<=0) blockhigh = 1;
1262                        UINT32 incx = 0x8000000 / m_hZoom;
1263                        UINT32 incy = 0x8000000 / m_vZoom;
12591264
12601265                        // DEBUG: Draw 16x16 block
12611266                        UINT32* line;
r21295r21296
12681273                                 const int drawy = pixelOffsetY+y;
12691274                                 if ((drawy>383) || (drawy<0)) continue;
12701275                                 line = &drawbitmap->pix32(drawy);
1276                                 int realy = ((y*incy)>>21);
12711277
12721278                                 if (used_flipx)
12731279                                 {
r21295r21296
12751281                                    {
12761282                                       const int drawx = pixelOffsetX+x;
12771283                                       if ((drawx>=495 || drawx<0)) continue;
1284                                       int realx = ((x*incx)>>21);
12781285
1279                                       UINT16 pix = m_tempshape[(15-x)*16+(15-y)];
1286                                       UINT16 pix = m_tempshape[(15-realx)*16+(15-realy)];
12801287                                       if (pix )
12811288                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
12821289                                    }
r21295r21296
12871294                                    {
12881295                                       const int drawx = pixelOffsetX+x;
12891296                                       if ((drawx>=495 || drawx<0)) continue;
1297                                       int realx = ((x*incx)>>21);
12901298
1291                                       UINT16 pix = m_tempshape[(15-x)*16+y];
1299                                       UINT16 pix = m_tempshape[(15-realx)*16+realy];
12921300                                       if (pix )
12931301                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
12941302                                    }
r21295r21296
13021310                                 const int drawy = pixelOffsetY+y;
13031311                                 if ((drawy>383) || (drawy<0)) continue;
13041312                                 line = &drawbitmap->pix32(drawy);
1313                                 int realy = ((y*incy)>>21);
13051314
13061315                                 if (used_flipx)
13071316                                 {
r21295r21296
13091318                                    {
13101319                                       const int drawx = pixelOffsetX+x;
13111320                                       if ((drawx>=495 || drawx<0)) continue;
1321                                       int realx = ((x*incx)>>21);
13121322
1313                                       UINT16 pix = m_tempshape[x*16+(15-y)];
1323                                       UINT16 pix = m_tempshape[realx*16+(15-realy)];
13141324                                       if (pix )
13151325                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
13161326                                    }
r21295r21296
13211331                                    {
13221332                                       const int drawx = pixelOffsetX+x;
13231333                                       if ((drawx>=495 || drawx<0)) continue;
1334                                       int realx = ((x*incx)>>21);
13241335
1325                                       UINT16 pix = m_tempshape[x*16+y];
1336                                       UINT16 pix = m_tempshape[realx*16+realy];
13261337                                       if (pix )
13271338                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
13281339                                    }
r21295r21296
13301341                              }
13311342                           }                       
13321343                        }
1333                        else
1344                        else // no rotate
13341345                        {
13351346                           if (used_flipy)
13361347                           {
r21295r21296
13391350                                 const int drawy = pixelOffsetY+y;
13401351                                 if ((drawy>383) || (drawy<0)) continue;
13411352                                 line = &drawbitmap->pix32(drawy);
1353                                 int realy = ((y*incy)>>21);
13421354
13431355                                 if (used_flipx)
13441356                                 {
r21295r21296
13461358                                    {
13471359                                       const int drawx = pixelOffsetX+x;
13481360                                       if ((drawx>=495 || drawx<0)) continue;
1361                                       int realx = ((x*incx)>>21);
13491362
1350                                       UINT16 pix = m_tempshape[(15-y)*16+(15-x)];
1363                                       UINT16 pix = m_tempshape[(15-realy)*16+(15-realx)];
13511364                                       if (pix )
13521365                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
13531366                                    }
r21295r21296
13581371                                    {
13591372                                       const int drawx = pixelOffsetX+x;
13601373                                       if ((drawx>=495 || drawx<0)) continue;
1361
1362                                       UINT16 pix = m_tempshape[(15-y)*16+x];
1374                                       int realx = ((x*incx)>>21);
1375                                       UINT16 pix = m_tempshape[(15-realy)*16+realx];
13631376                                       if (pix )
13641377                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
13651378                                    }
13661379                                 }
13671380                              }
13681381                           }
1369                           else
1382                           else // no rotate, no flipy
13701383                           {
1371                              for (int y = 0; y < 16; y++)
1384                              for (int y = 0; y < blockhigh; y++)
13721385                              {
13731386                                 const int drawy = pixelOffsetY+y;
13741387                                 if ((drawy>383) || (drawy<0)) continue;
13751388                                 line = &drawbitmap->pix32(drawy);
1389                                 int realy = ((y*incy)>>21);
13761390
13771391                                 if (used_flipx)
13781392                                 {
1379                                    for (int x = 0; x < 16; x++)
1393                                    for (int x = 0; x < blockwide; x++)
13801394                                    {
13811395                                       const int drawx = pixelOffsetX+x;
13821396                                       if ((drawx>=495 || drawx<0)) continue;
1397                                       int realx = ((x*incx)>>21);
13831398
1384                                       UINT16 pix = m_tempshape[y*16+(15-x)];
1399                                       UINT16 pix = m_tempshape[realy*16+(15-realx)];
13851400                                       if (pix )
13861401                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
13871402                                    }
13881403                                 }
1389                                 else
1404
1405
1406
1407                                 else // no rotate, no flipy, no flipx
13901408                                 {
1391                                    for (int x = 0; x < 16; x++)
1409                                    for (int x = 0; x < blockwide; x++)
13921410                                    {
13931411                                       const int drawx = pixelOffsetX+x;
13941412                                       if ((drawx>=495 || drawx<0)) continue;
1413                                       int realx = ((x*incx)>>21);
13951414
1396                                       UINT16 pix = m_tempshape[y*16+x];
1415                                       UINT16 pix = m_tempshape[realy*16+realx];
13971416                                       if (pix )
13981417                                          if (line[drawx]==0) line[drawx] = clut[pix+0x4000];
13991418                                    }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team