trunk/src/mame/video/mb60553.c
| r31046 | r31047 | |
| 199 | 199 | bitmap_ind16 &srcbitmap = m_tmap->pixmap(); |
| 200 | 200 | bitmap_ind8 &flagsbitmap = m_tmap->flagsmap(); |
| 201 | 201 | |
| 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 | | |
| 206 | 202 | // extract start/end points |
| 207 | | int sx = cliprect.min_x; |
| 208 | 203 | int sy = cliprect.min_y; |
| 209 | | int ex = cliprect.max_x; |
| 210 | 204 | int ey = cliprect.max_y; |
| 211 | 205 | |
| 212 | 206 | // loop over rows |
| 213 | 207 | while (sy <= ey) |
| 214 | 208 | { |
| 215 | | // initialize X counters |
| 216 | | int x = sx; |
| 217 | | UINT32 cx = startx; |
| 218 | | UINT32 cy = starty; |
| 219 | | |
| 220 | 209 | // get dest and priority pointers |
| 210 | int sx = cliprect.min_x; |
| 211 | int ex = cliprect.max_x; |
| 212 | |
| 221 | 213 | UINT16 *dest = &destbitmap.pix(sy, sx); |
| 222 | 214 | |
| 223 | 215 | // loop over columns |
| 224 | | while (x <= ex) |
| 216 | while (sx <= ex) |
| 225 | 217 | { |
| 218 | int xxx = startx + (sy*incyx) + (sx*incxx); |
| 219 | int yyy = starty + (sy*incyy) + (sx*incxy); |
| 220 | |
| 226 | 221 | if (wraparound) |
| 227 | 222 | { |
| 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) |
| 229 | 227 | { |
| 230 | | *dest = (srcbitmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask)); |
| 228 | *dest = (srcbitmap.pix(yyy, xxx)); |
| 231 | 229 | } |
| 232 | 230 | } |
| 233 | 231 | else |
| 234 | 232 | { |
| 235 | | if (cx < widthshifted && cy < heightshifted) |
| 233 | if (xxx < widthshifted && yyy < heightshifted) |
| 236 | 234 | { |
| 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) |
| 238 | 239 | { |
| 239 | | *dest = (srcbitmap.pix(cy >> 16, cx >> 16)); |
| 240 | *dest = (srcbitmap.pix(yyy, xxx)); |
| 240 | 241 | } |
| 241 | 242 | } |
| 242 | 243 | } |
| 243 | 244 | |
| 244 | 245 | // advance in X |
| 245 | | cx += incxx; |
| 246 | | cy += incxy; |
| 247 | | x++; |
| 246 | sx++; |
| 248 | 247 | dest++; |
| 249 | 248 | //pri++; |
| 250 | 249 | } |
| 251 | 250 | |
| 252 | 251 | // advance in Y |
| 253 | | startx += incyx; |
| 254 | | starty += incyy; |
| 255 | 252 | sy++; |
| 256 | 253 | } |
| 257 | 254 | } |