trunk/src/mame/video/pc080sn.c
| r243043 | r243044 | |
| 377 | 377 | |
| 378 | 378 | UINT16 a, color; |
| 379 | 379 | int sx, x_index; |
| 380 | | int i, y, y_index, src_y_index, row_index; |
| 380 | int y_index, src_y_index, row_index; |
| 381 | 381 | |
| 382 | 382 | int flip = 0; |
| 383 | | int machine_flip = 0; /* for ROT 180 ? */ |
| 384 | 383 | |
| 385 | 384 | int min_x = cliprect.min_x; |
| 386 | 385 | int max_x = cliprect.max_x; |
| r243043 | r243044 | |
| 400 | 399 | y_index = 0; |
| 401 | 400 | } |
| 402 | 401 | |
| 403 | | if (!machine_flip) |
| 404 | | y = min_y; |
| 405 | | else |
| 406 | | y = max_y; |
| 407 | | |
| 408 | | do |
| 402 | for (int y = min_y; y <= max_y; y++) |
| 409 | 403 | { |
| 410 | 404 | src_y_index = y_index & 0x1ff; /* tilemaps are 512 px up/down */ |
| 411 | 405 | row_index = (src_y_index - m_bgscrolly[layer]) & 0x1ff; |
| r243043 | r243044 | |
| 419 | 413 | |
| 420 | 414 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 421 | 415 | { |
| 422 | | for (i = 0; i < screen_width; i++) |
| 416 | for (int i = 0; i < screen_width; i++) |
| 423 | 417 | { |
| 424 | 418 | a = src16[x_index & width_mask]; |
| 425 | 419 | #ifdef TOPSPEED_ROAD_COLORS |
| r243043 | r243044 | |
| 431 | 425 | } |
| 432 | 426 | else |
| 433 | 427 | { |
| 434 | | for (i = 0; i < screen_width; i++) |
| 428 | for (int i = 0; i < screen_width; i++) |
| 435 | 429 | { |
| 436 | 430 | if (tsrc[x_index & width_mask]) |
| 437 | 431 | { |
| r243043 | r243044 | |
| 449 | 443 | |
| 450 | 444 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 451 | 445 | y_index++; |
| 452 | | |
| 453 | | if (!machine_flip) |
| 454 | | y++; |
| 455 | | else |
| 456 | | y--; |
| 457 | 446 | } |
| 458 | | while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); |
| 459 | 447 | } |
| 460 | 448 | |
| 461 | 449 | void pc080sn_device::tilemap_draw( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int flags, UINT32 priority ) |
trunk/src/mame/video/tc0080vco.c
| r243043 | r243044 | |
| 439 | 439 | |
| 440 | 440 | int sx, zoomx, zoomy; |
| 441 | 441 | int dx, ex, dy, ey; |
| 442 | | int i, y, y_index, src_y_index, row_index; |
| 442 | int y_index, src_y_index, row_index; |
| 443 | 443 | int x_index, x_step; |
| 444 | 444 | |
| 445 | 445 | int flip = m_flipscreen; |
| 446 | | int machine_flip = 0; /* for ROT 180 ? */ |
| 447 | 446 | |
| 448 | 447 | int min_x = cliprect.min_x; |
| 449 | 448 | int max_x = cliprect.max_x; |
| r243043 | r243044 | |
| 501 | 500 | y_index = ((-m_scroll_ram[3] - 2) << 16) + min_y * zoomy - (max_y + min_y) * (zoomy - 0x10000); |
| 502 | 501 | } |
| 503 | 502 | |
| 504 | | if (!machine_flip) |
| 505 | | y = min_y; |
| 506 | | else |
| 507 | | y = max_y; |
| 508 | | |
| 509 | | do |
| 503 | for (int y = min_y; y <= max_y; y++) |
| 510 | 504 | { |
| 511 | 505 | src_y_index = (y_index >> 16) & 0x3ff; /* tilemaps are 1024 px up/down */ |
| 512 | 506 | |
| r243043 | r243044 | |
| 525 | 519 | |
| 526 | 520 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 527 | 521 | { |
| 528 | | for (i = 0; i < screen_width; i++) |
| 522 | for (int i = 0; i < screen_width; i++) |
| 529 | 523 | { |
| 530 | 524 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| 531 | 525 | x_index += x_step; |
| r243043 | r243044 | |
| 533 | 527 | } |
| 534 | 528 | else |
| 535 | 529 | { |
| 536 | | for (i = 0; i < screen_width; i++) |
| 530 | for (int i = 0; i < screen_width; i++) |
| 537 | 531 | { |
| 538 | 532 | if (tsrc[(x_index >> 16) & width_mask]) |
| 539 | 533 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| r243043 | r243044 | |
| 546 | 540 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1 , ROT0, screen.priority(), priority); |
| 547 | 541 | |
| 548 | 542 | y_index += zoomy; |
| 549 | | |
| 550 | | if (!machine_flip) |
| 551 | | y++; |
| 552 | | else |
| 553 | | y--; |
| 554 | 543 | } |
| 555 | | while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); |
| 556 | 544 | } |
| 557 | 545 | } |
| 558 | 546 | |
trunk/src/mame/video/tc0480scp.c
| r243043 | r243044 | |
| 717 | 717 | bitmap_ind16 &srcbitmap = m_tilemap[layer][m_dblwidth]->pixmap(); |
| 718 | 718 | bitmap_ind8 &flagsbitmap = m_tilemap[layer][m_dblwidth]->flagsmap(); |
| 719 | 719 | int flip = m_pri_reg & 0x40; |
| 720 | | int i, y, y_index, src_y_index, row_index; |
| 720 | int y_index, src_y_index, row_index; |
| 721 | 721 | int x_index, x_step; |
| 722 | 722 | |
| 723 | 723 | UINT16 screen_width = 512; //cliprect.width(); |
| r243043 | r243044 | |
| 745 | 745 | y_index -= (m_y_offset - min_y) * zoomy; |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | | y = min_y; |
| 749 | | |
| 750 | | do |
| 748 | for (int y = min_y; y <= max_y; y++) |
| 751 | 749 | { |
| 752 | 750 | src_y_index = (y_index >> 16) & 0x1ff; |
| 753 | 751 | |
| r243043 | r243044 | |
| 766 | 764 | |
| 767 | 765 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 768 | 766 | { |
| 769 | | for (i = 0; i < screen_width; i++) |
| 767 | for (int i = 0; i < screen_width; i++) |
| 770 | 768 | { |
| 771 | 769 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| 772 | 770 | x_index += x_step; |
| r243043 | r243044 | |
| 774 | 772 | } |
| 775 | 773 | else |
| 776 | 774 | { |
| 777 | | for (i = 0; i < screen_width; i++) |
| 775 | for (int i = 0; i < screen_width; i++) |
| 778 | 776 | { |
| 779 | 777 | if (tsrc[(x_index >> 16) & width_mask]) |
| 780 | 778 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| r243043 | r243044 | |
| 787 | 785 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 788 | 786 | |
| 789 | 787 | y_index += zoomy; |
| 790 | | y++; |
| 791 | 788 | } |
| 792 | | while (y <= max_y); |
| 793 | | |
| 794 | 789 | } |
| 795 | 790 | } |
| 796 | 791 | |
| r243043 | r243044 | |
| 838 | 833 | |
| 839 | 834 | UINT16 *dst16, *src16; |
| 840 | 835 | UINT8 *tsrc; |
| 841 | | int i, y, y_index, src_y_index, row_index, row_zoom; |
| 836 | int y_index, src_y_index, row_index, row_zoom; |
| 842 | 837 | int sx, x_index, x_step; |
| 843 | 838 | UINT32 zoomx, zoomy; |
| 844 | 839 | UINT16 scanline[512]; |
| r243043 | r243044 | |
| 876 | 871 | y_index -= (m_y_offset - min_y) * zoomy; |
| 877 | 872 | } |
| 878 | 873 | |
| 879 | | y = min_y; |
| 880 | | |
| 881 | | do |
| 874 | for (int y = min_y; y <= max_y; y++) |
| 882 | 875 | { |
| 883 | 876 | if (!flipscreen) |
| 884 | 877 | src_y_index = ((y_index>>16) + m_bgcolumn_ram[layer][(y - m_y_offset) & 0x1ff]) & 0x1ff; |
| r243043 | r243044 | |
| 917 | 910 | |
| 918 | 911 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 919 | 912 | { |
| 920 | | for (i = 0; i < screen_width; i++) |
| 913 | for (int i = 0; i < screen_width; i++) |
| 921 | 914 | { |
| 922 | 915 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| 923 | 916 | x_index += x_step; |
| r243043 | r243044 | |
| 925 | 918 | } |
| 926 | 919 | else |
| 927 | 920 | { |
| 928 | | for (i = 0; i < screen_width; i++) |
| 921 | for (int i = 0; i < screen_width; i++) |
| 929 | 922 | { |
| 930 | 923 | if (tsrc[(x_index >> 16) & width_mask]) |
| 931 | 924 | *dst16++ = src16[(x_index >> 16) & width_mask]; |
| r243043 | r243044 | |
| 938 | 931 | taitoic_drawscanline(bitmap, cliprect, 0, y, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 939 | 932 | |
| 940 | 933 | y_index += zoomy; |
| 941 | | y++; |
| 942 | 934 | } |
| 943 | | while (y<=max_y); |
| 944 | 935 | } |
| 945 | 936 | |
| 946 | 937 | |
trunk/src/mame/video/wgp.c
| r243043 | r243044 | |
| 514 | 514 | |
| 515 | 515 | UINT16 *dst16,*src16; |
| 516 | 516 | UINT8 *tsrc; |
| 517 | | int i, y, y_index, src_y_index, row_index, row_zoom; |
| 517 | int y_index, src_y_index, row_index, row_zoom; |
| 518 | 518 | |
| 519 | 519 | /* I have a fairly strong feeling these should be UINT32's, x_index is |
| 520 | 520 | falling through from max +ve to max -ve quite a lot in this routine */ |
| r243043 | r243044 | |
| 524 | 524 | UINT16 scanline[512]; |
| 525 | 525 | UINT16 row_colbank, row_scroll; |
| 526 | 526 | int flipscreen = 0; /* n/a */ |
| 527 | | int machine_flip = 0; /* for ROT 180 ? */ |
| 528 | 527 | |
| 529 | 528 | UINT16 screen_width = cliprect.width(); |
| 530 | 529 | UINT16 min_y = cliprect.min_y; |
| r243043 | r243044 | |
| 558 | 557 | y_index = 0; |
| 559 | 558 | } |
| 560 | 559 | |
| 561 | | if (!machine_flip) |
| 562 | | y = min_y; |
| 563 | | else |
| 564 | | y = max_y; |
| 565 | | |
| 566 | | do |
| 560 | for (int y = min_y; y <= max_y; y++) |
| 567 | 561 | { |
| 568 | 562 | int a; |
| 569 | 563 | |
| r243043 | r243044 | |
| 598 | 592 | |
| 599 | 593 | if (flags & TILEMAP_DRAW_OPAQUE) |
| 600 | 594 | { |
| 601 | | for (i = 0; i < screen_width; i++) |
| 595 | for (int i = 0; i < screen_width; i++) |
| 602 | 596 | { |
| 603 | 597 | *dst16++ = src16[(x_index >> 16) & width_mask] + row_colbank; |
| 604 | 598 | x_index += x_step; |
| r243043 | r243044 | |
| 606 | 600 | } |
| 607 | 601 | else |
| 608 | 602 | { |
| 609 | | for (i = 0; i < screen_width; i++) |
| 603 | for (int i = 0; i < screen_width; i++) |
| 610 | 604 | { |
| 611 | 605 | if (tsrc[(x_index >> 16) & width_mask]) |
| 612 | 606 | *dst16++ = src16[(x_index >> 16) & width_mask] + row_colbank; |
| r243043 | r243044 | |
| 619 | 613 | bryan2_drawscanline(bitmap, 0, y, screen_width, scanline, (flags & TILEMAP_DRAW_OPAQUE) ? 0 : 1, ROT0, screen.priority(), priority); |
| 620 | 614 | |
| 621 | 615 | y_index += zoomy; |
| 622 | | if (!machine_flip) y++; else y--; |
| 623 | 616 | } |
| 624 | | while ((!machine_flip && y <= max_y) || (machine_flip && y >= min_y)); |
| 625 | | |
| 626 | 617 | } |
| 627 | 618 | |
| 628 | 619 | |