trunk/src/mame/video/mb60553.c
| r31035 | r31036 | |
| 181 | 181 | m_m_gfx_region = gfx_region; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | void mb60553_zooming_tilemap_device::draw_roz_core(screen_device &screen, bitmap_ind16 &destbitmap, const rectangle &cliprect, |
| 189 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound) |
| 190 | { |
| 191 | // pre-cache all the inner loop values |
| 192 | //const rgb_t *clut = m_palette->palette()->entry_list_adjusted(); |
| 193 | const int xmask = m_tmap->pixmap().width() - 1; |
| 194 | const int ymask = m_tmap->pixmap().height() - 1; |
| 195 | const int widthshifted = m_tmap->pixmap().width() << 16; |
| 196 | const int heightshifted = m_tmap->pixmap().height() << 16; |
| 197 | UINT8 mask = 0x1f;// blit.mask; |
| 198 | UINT8 value = 0x10;// blit.value; |
| 199 | bitmap_ind16 &srcbitmap = m_tmap->pixmap(); |
| 200 | bitmap_ind8 &flagsbitmap = m_tmap->flagsmap(); |
| 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 | // extract start/end points |
| 207 | int sx = cliprect.min_x; |
| 208 | int sy = cliprect.min_y; |
| 209 | int ex = cliprect.max_x; |
| 210 | int ey = cliprect.max_y; |
| 211 | |
| 212 | // loop over rows |
| 213 | while (sy <= ey) |
| 214 | { |
| 215 | // initialize X counters |
| 216 | int x = sx; |
| 217 | UINT32 cx = startx; |
| 218 | UINT32 cy = starty; |
| 219 | |
| 220 | // get dest and priority pointers |
| 221 | UINT16 *dest = &destbitmap.pix(sy, sx); |
| 222 | |
| 223 | // loop over columns |
| 224 | while (x <= ex) |
| 225 | { |
| 226 | if (wraparound) |
| 227 | { |
| 228 | if ((flagsbitmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask) & mask) == value) |
| 229 | { |
| 230 | *dest = (srcbitmap.pix((cy >> 16) & ymask, (cx >> 16) & xmask)); |
| 231 | } |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | if (cx < widthshifted && cy < heightshifted) |
| 236 | { |
| 237 | if ((flagsbitmap.pix(cy >> 16, cx >> 16) & mask) == value) |
| 238 | { |
| 239 | *dest = (srcbitmap.pix(cy >> 16, cx >> 16)); |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | // advance in X |
| 245 | cx += incxx; |
| 246 | cy += incxy; |
| 247 | x++; |
| 248 | dest++; |
| 249 | //pri++; |
| 250 | } |
| 251 | |
| 252 | // advance in Y |
| 253 | startx += incyx; |
| 254 | starty += incyy; |
| 255 | sy++; |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 184 | 263 | /* THIS IS STILL WRONG! */ |
| 185 | 264 | void mb60553_zooming_tilemap_device::draw( screen_device &screen, bitmap_ind16& bitmap, const rectangle &cliprect, int priority) |
| 186 | 265 | { |
| r31035 | r31036 | |
| 211 | 290 | |
| 212 | 291 | clip.min_y = clip.max_y = line; |
| 213 | 292 | |
| 214 | | m_tmap->draw_roz(screen, bitmap, clip, startx<<12,starty<<12, |
| 293 | draw_roz_core(screen, bitmap, clip, startx<<12,starty<<12, |
| 215 | 294 | incxx,0,0,incyy, |
| 216 | | 1, |
| 217 | | 0,priority); |
| 295 | 1 |
| 296 | ); |
| 218 | 297 | |
| 219 | 298 | } |
| 220 | | |
| 221 | | |
| 222 | | |
| 223 | 299 | } |
| 224 | 300 | |
| 225 | 301 | tilemap_t* mb60553_zooming_tilemap_device::get_tilemap() |
trunk/src/mame/video/mb60553.h
| r31035 | r31036 | |
| 33 | 33 | DECLARE_READ16_MEMBER(vram_r); |
| 34 | 34 | DECLARE_READ16_MEMBER(line_r); |
| 35 | 35 | |
| 36 | void draw_roz_core(screen_device &screen, bitmap_ind16 &destbitmap, const rectangle &cliprect, |
| 37 | UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, bool wraparound); |
| 38 | |
| 36 | 39 | protected: |
| 37 | 40 | virtual void device_start(); |
| 38 | 41 | virtual void device_reset(); |