Previous 199869 Revisions Next

r31047 Friday 20th June, 2014 at 12:46:20 UTC by David Haywood
shuffle bits of code around for easier experimentation (nw)
[src/mame/video]mb60553.c

trunk/src/mame/video/mb60553.c
r31046r31047
199199   bitmap_ind16 &srcbitmap = m_tmap->pixmap();
200200   bitmap_ind8 &flagsbitmap = m_tmap->flagsmap();
201201
202   // pre-advance based on the cliprect
203   startx += cliprect.min_x * incxx + cliprect.min_y * incyx;
204   starty += cliprect.min_x * incxy + cliprect.min_y * incyy;
205
206202   // extract start/end points
207   int sx = cliprect.min_x;
208203   int sy = cliprect.min_y;
209   int ex = cliprect.max_x;
210204   int ey = cliprect.max_y;
211205
212206   // loop over rows
213207   while (sy <= ey)
214208   {
215      // initialize X counters
216      int x = sx;
217      UINT32 cx = startx;
218      UINT32 cy = starty;
219
220209      // get dest and priority pointers
210      int sx = cliprect.min_x;
211      int ex = cliprect.max_x;
212
221213      UINT16 *dest = &destbitmap.pix(sy, sx);
222214
223215      // loop over columns
224      while (x <= ex)
216      while (sx <= ex)
225217      {
218         int xxx = startx + (sy*incyx) + (sx*incxx);
219         int yyy = starty + (sy*incyy) + (sx*incxy);
220
226221         if (wraparound)
227222         {
228            if ((flagsbitmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value)
223            yyy = (yyy >> 16) & ymask;
224            xxx = (xxx >> 16) & xmask;
225
226            if ((flagsbitmap.pix(yyy, xxx) & mask) == value)
229227            {
230               *dest = (srcbitmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask));
228               *dest = (srcbitmap.pix(yyy, xxx));
231229            }
232230         }
233231         else
234232         {
235            if (cx < widthshifted && cy < heightshifted)
233            if (xxx < widthshifted && yyy < heightshifted)
236234            {
237               if ((flagsbitmap.pix(cy >> 16, cx >> 16) & mask) == value)
235               yyy = (yyy >> 16);
236               xxx = (xxx >> 16);
237
238               if ((flagsbitmap.pix(yyy, xxx) & mask) == value)
238239               {
239                  *dest = (srcbitmap.pix(cy >> 16, cx >> 16));
240                  *dest = (srcbitmap.pix(yyy, xxx));
240241               }
241242            }
242243         }
243244
244245         // advance in X
245         cx += incxx;
246         cy += incxy;
247         x++;
246         sx++;
248247         dest++;
249248         //pri++;
250249      }
251250
252251      // advance in Y
253      startx += incyx;
254      starty += incyy;
255252      sy++;
256253   }
257254}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team