trunk/src/mame/video/deco_mlc.c
| r21881 | r21882 | |
| 353 | 353 | xbase-=xoffs * (xscale<<8); |
| 354 | 354 | |
| 355 | 355 | |
| 356 | int full_realybase = ybase; |
| 357 | int full_sprite_screen_height = ((yscale<<8)*(h*16)+(0)); |
| 358 | int full_sprite_screen_height_unscaled = ((1)*(h*16)+(0)); |
| 356 | 359 | |
| 357 | 360 | |
| 358 | 361 | |
| 359 | | for (by=0; by<h; by++) |
| 360 | | { |
| 362 | if (!full_sprite_screen_height_unscaled) |
| 363 | continue; |
| 361 | 364 | |
| 362 | | |
| 363 | 365 | |
| 364 | | int realybase = ybase + by * yinc; |
| 365 | | int sprite_screen_height = ((yscale<<8)*16+(realybase&0xffff))>>16; |
| 366 | int ratio = full_sprite_screen_height / full_sprite_screen_height_unscaled; |
| 366 | 367 | |
| 367 | | for (int yi=0;yi<sprite_screen_height;yi++) |
| 368 | | { |
| 369 | | int y = (realybase>>16)+yi; |
| 368 | if (!ratio) |
| 369 | continue; |
| 370 | 370 | |
| 371 | | rectangle myclip; |
| 372 | | myclip = user_clip; |
| 373 | | myclip &= bitmap.cliprect(); |
| 371 | for (int bby=0; bby<full_sprite_screen_height>>16; bby++) |
| 372 | { |
| 373 | int srcline = ((bby<<16) / ratio); |
| 374 | |
| 375 | by = srcline >> 4; |
| 376 | |
| 377 | int y = (full_realybase>>16)+bby; |
| 374 | 378 | |
| 375 | | if( y < myclip.min_y ) |
| 376 | | continue; |
| 379 | rectangle myclip; |
| 380 | myclip = user_clip; |
| 381 | myclip &= bitmap.cliprect(); |
| 377 | 382 | |
| 378 | | if( y > myclip.max_y+1 ) |
| 379 | | continue; |
| 383 | if( y < myclip.min_y ) |
| 384 | continue; |
| 380 | 385 | |
| 381 | | UINT32 *dest = &bitmap.pix32(y); |
| 386 | if( y > myclip.max_y+1 ) |
| 387 | continue; |
| 382 | 388 | |
| 383 | | if (!sprite_screen_height) |
| 384 | | continue; |
| 389 | UINT32 *dest = &bitmap.pix32(y); |
| 385 | 390 | |
| 386 | | int dy = (16<<16)/sprite_screen_height; |
| 391 | srcline &=0xf; |
| 392 | if( fy ) |
| 393 | { |
| 394 | srcline = 15 - srcline; |
| 395 | } |
| 387 | 396 | |
| 388 | 397 | |
| 389 | | |
| 390 | | int dystuff = yi * dy; |
| 391 | | |
| 392 | | int srcline; |
| 393 | | srcline = dystuff >> 16; |
| 394 | | |
| 395 | | if( fy ) |
| 398 | for (bx=0; bx<w; bx++) { |
| 399 | |
| 400 | int realxbase = xbase + bx * xinc; |
| 401 | int count = 0; |
| 402 | if (fx) |
| 396 | 403 | { |
| 397 | | srcline = (srcline &~15) | (15-(srcline&15)); |
| 404 | if (fy) |
| 405 | count = (h-1-by) * w + (w-1-bx); |
| 406 | else |
| 407 | count = by * w + (w-1-bx); |
| 398 | 408 | } |
| 409 | else |
| 410 | { |
| 411 | if (fy) |
| 412 | count = (h-1-by) * w + bx; |
| 413 | else |
| 414 | count = by * w + bx; |
| 415 | } |
| 399 | 416 | |
| 417 | int tile=sprite + count; |
| 418 | int tile2=sprite2 + count; |
| 400 | 419 | |
| 401 | | for (bx=0; bx<w; bx++) { |
| 402 | | |
| 403 | | int realxbase = xbase + bx * xinc; |
| 404 | | int count = 0; |
| 405 | | if (fx) |
| 420 | if (blockIsTilemapIndex) { |
| 421 | if (useIndicesInRom) |
| 406 | 422 | { |
| 407 | | if (fy) |
| 408 | | count = (h-1-by) * w + (w-1-bx); |
| 423 | const UINT8* ptr=rawrom+(tile*2); |
| 424 | tile=(*ptr) + ((*(ptr+1))<<8); |
| 425 | |
| 426 | if (use8bppMode) { |
| 427 | const UINT8* ptr2=rawrom+(tile2*2); |
| 428 | tile2=(*ptr2) + ((*(ptr2+1))<<8); |
| 429 | } |
| 409 | 430 | else |
| 410 | | count = by * w + (w-1-bx); |
| 431 | { |
| 432 | tile2=0; |
| 433 | } |
| 434 | |
| 435 | if (tileFormat) |
| 436 | { |
| 437 | colorOffset=(tile&0xf000)>>12; |
| 438 | tile=(tile&0x0fff)|hibits; |
| 439 | tile2=(tile2&0x0fff)|hibits; |
| 440 | } |
| 441 | else |
| 442 | { |
| 443 | colorOffset=0; |
| 444 | tile=(tile&0xffff)|(hibits<<2); |
| 445 | tile2=(tile2&0xffff)|(hibits<<2); |
| 446 | } |
| 411 | 447 | } |
| 412 | 448 | else |
| 413 | 449 | { |
| 414 | | if (fy) |
| 415 | | count = (h-1-by) * w + bx; |
| 416 | | else |
| 417 | | count = by * w + bx; |
| 418 | | } |
| 450 | const UINT32* ptr=m_mlc_vram + ((tile)&0x7fff); |
| 451 | tile=(*ptr)&0xffff; |
| 419 | 452 | |
| 420 | | int tile=sprite + count; |
| 421 | | int tile2=sprite2 + count; |
| 422 | | |
| 423 | | if (blockIsTilemapIndex) { |
| 424 | | if (useIndicesInRom) |
| 453 | if (tileFormat) |
| 425 | 454 | { |
| 426 | | const UINT8* ptr=rawrom+(tile*2); |
| 427 | | tile=(*ptr) + ((*(ptr+1))<<8); |
| 428 | | |
| 429 | | if (use8bppMode) { |
| 430 | | const UINT8* ptr2=rawrom+(tile2*2); |
| 431 | | tile2=(*ptr2) + ((*(ptr2+1))<<8); |
| 432 | | } |
| 433 | | else |
| 434 | | { |
| 435 | | tile2=0; |
| 436 | | } |
| 437 | | |
| 438 | | if (tileFormat) |
| 439 | | { |
| 440 | | colorOffset=(tile&0xf000)>>12; |
| 441 | | tile=(tile&0x0fff)|hibits; |
| 442 | | tile2=(tile2&0x0fff)|hibits; |
| 443 | | } |
| 444 | | else |
| 445 | | { |
| 446 | | colorOffset=0; |
| 447 | | tile=(tile&0xffff)|(hibits<<2); |
| 448 | | tile2=(tile2&0xffff)|(hibits<<2); |
| 449 | | } |
| 455 | colorOffset=(tile&0xf000)>>12; |
| 456 | tile=(tile&0x0fff)|hibits; |
| 450 | 457 | } |
| 451 | 458 | else |
| 452 | 459 | { |
| 453 | | const UINT32* ptr=m_mlc_vram + ((tile)&0x7fff); |
| 454 | | tile=(*ptr)&0xffff; |
| 455 | | |
| 456 | | if (tileFormat) |
| 457 | | { |
| 458 | | colorOffset=(tile&0xf000)>>12; |
| 459 | | tile=(tile&0x0fff)|hibits; |
| 460 | | } |
| 461 | | else |
| 462 | | { |
| 463 | | colorOffset=0; |
| 464 | | tile=(tile&0xffff)|(hibits<<2); |
| 465 | | } |
| 466 | | |
| 467 | | tile2=0; |
| 460 | colorOffset=0; |
| 461 | tile=(tile&0xffff)|(hibits<<2); |
| 468 | 462 | } |
| 463 | |
| 464 | tile2=0; |
| 469 | 465 | } |
| 466 | } |
| 470 | 467 | |
| 471 | 468 | |
| 472 | 469 | |
| 473 | 470 | |
| 474 | | mlc_drawgfxzoomline( |
| 475 | | dest,user_clip,machine().gfx[0], |
| 476 | | tile,tile2, |
| 477 | | color + colorOffset,fx,realxbase, |
| 478 | | 0, |
| 479 | | use8bppMode,(xscale<<8),alpha, srcline); |
| 471 | mlc_drawgfxzoomline( |
| 472 | dest,user_clip,machine().gfx[0], |
| 473 | tile,tile2, |
| 474 | color + colorOffset,fx,realxbase, |
| 475 | 0, |
| 476 | use8bppMode,(xscale<<8),alpha, srcline); |
| 480 | 477 | |
| 481 | | } |
| 478 | } |
| 482 | 479 | |
| 483 | 480 | |
| 484 | | } |
| 481 | |
| 485 | 482 | } |
| 486 | 483 | |
| 487 | 484 | // if (lastRasterMode!=0 && rasterDirty) |