src/mess/video/thomson.c
| r2201 | r2202 | |
| 416 | 416 | |
| 417 | 417 | |
| 418 | 418 | |
| 419 | | typedef void ( *thom_scandraw ) ( running_machine *machine, UINT8* vram, UINT16* dst, UINT16* pal, |
| 419 | typedef void ( *thom_scandraw ) ( UINT8* vram, UINT16* dst, UINT16* pal, |
| 420 | 420 | int org, int len ); |
| 421 | 421 | |
| 422 | 422 | |
| 423 | 423 | |
| 424 | 424 | #define UPDATE( name, res ) \ |
| 425 | | static void name##_scandraw_##res ( running_machine *machine, UINT8* vram, UINT16* dst, UINT16* pal, \ |
| 425 | static void name##_scandraw_##res ( UINT8* vram, UINT16* dst, UINT16* pal, \ |
| 426 | 426 | int org, int len ) \ |
| 427 | 427 | { \ |
| 428 | 428 | unsigned gpl; \ |
| r2201 | r2202 | |
| 446 | 446 | { |
| 447 | 447 | int i; |
| 448 | 448 | pen_t c[2]; |
| 449 | | c[0] = machine->pens[ pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ] ]; |
| 450 | | c[1] = machine->pens[ pal[ ((ramb >> 3) & 15) ^ 8 ] ]; |
| 449 | c[0] = pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ]; |
| 450 | c[1] = pal[ ((ramb >> 3) & 15) ^ 8 ]; |
| 451 | 451 | for ( i = 0; i < 16; i += 2, rama >>= 1 ) |
| 452 | 452 | dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ]; |
| 453 | 453 | } |
| r2201 | r2202 | |
| 457 | 457 | { |
| 458 | 458 | int i; |
| 459 | 459 | pen_t c[2]; |
| 460 | | c[0] = machine->pens[ pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ] ]; |
| 461 | | c[1] = machine->pens[ pal[ ((ramb >> 3) & 15) ^ 8 ] ]; |
| 460 | c[0] = pal[ ((ramb & 7) | ((ramb>>4) & 8)) ^ 8 ]; |
| 461 | c[1] = pal[ ((ramb >> 3) & 15) ^ 8 ]; |
| 462 | 462 | for ( i = 0; i < 8; i++, rama >>= 1 ) |
| 463 | 463 | dst[ 7 - i ] = c[ rama & 1 ]; |
| 464 | 464 | } |
| r2201 | r2202 | |
| 472 | 472 | { |
| 473 | 473 | int i; |
| 474 | 474 | pen_t c[2]; |
| 475 | | c[0] = machine->pens[ pal[ ramb & 15 ] ]; |
| 476 | | c[1] = machine->pens[ pal[ ramb >> 4 ] ]; |
| 475 | c[0] = pal[ ramb & 15 ]; |
| 476 | c[1] = pal[ ramb >> 4 ]; |
| 477 | 477 | for ( i = 0; i < 16; i += 2, rama >>= 1 ) |
| 478 | 478 | dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ]; |
| 479 | 479 | } |
| r2201 | r2202 | |
| 483 | 483 | { |
| 484 | 484 | int i; |
| 485 | 485 | pen_t c[2]; |
| 486 | | c[0] = machine->pens[ pal[ ramb & 15 ] ]; |
| 487 | | c[1] = machine->pens[ pal[ ramb >> 4 ] ]; |
| 486 | c[0] = pal[ ramb & 15 ]; |
| 487 | c[1] = pal[ ramb >> 4 ]; |
| 488 | 488 | for ( i = 0; i < 8; i++, rama >>= 1 ) |
| 489 | 489 | dst[ 7 - i ] = c[ rama & 1 ]; |
| 490 | 490 | } |
| r2201 | r2202 | |
| 498 | 498 | { |
| 499 | 499 | int i; |
| 500 | 500 | pen_t c[2]; |
| 501 | | c[0] = machine->pens[ pal[ (ramb & 7) | ((ramb>>4) & 8) ] ]; |
| 502 | | c[1] = machine->pens[ pal[ (ramb >> 3) & 15 ] ]; |
| 501 | c[0] = pal[ (ramb & 7) | ((ramb>>4) & 8) ]; |
| 502 | c[1] = pal[ (ramb >> 3) & 15 ]; |
| 503 | 503 | for ( i = 0; i < 16; i += 2, rama >>= 1 ) |
| 504 | 504 | dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ]; |
| 505 | 505 | } |
| r2201 | r2202 | |
| 509 | 509 | { |
| 510 | 510 | int i; |
| 511 | 511 | pen_t c[2]; |
| 512 | | c[0] = machine->pens[ pal[ (ramb & 7) | ((ramb>>4) & 8) ] ]; |
| 513 | | c[1] = machine->pens[ pal[ (ramb >> 3) & 15 ] ]; |
| 512 | c[0] = pal[ (ramb & 7) | ((ramb>>4) & 8) ]; |
| 513 | c[1] = pal[ (ramb >> 3) & 15 ]; |
| 514 | 514 | for ( i = 0; i < 8; i++, rama >>= 1 ) |
| 515 | 515 | dst[ 7 - i ] = c[ rama & 1 ]; |
| 516 | 516 | } |
| r2201 | r2202 | |
| 524 | 524 | { |
| 525 | 525 | int i; |
| 526 | 526 | pen_t c[2][2]; |
| 527 | | c[0][0] = machine->pens[ pal[ 0 ] ]; |
| 528 | | c[0][1] = machine->pens[ pal[ 1 ] ]; |
| 529 | | c[1][0] = machine->pens[ pal[ 2 ] ]; |
| 530 | | c[1][1] = machine->pens[ pal[ 3 ] ]; |
| 527 | c[0][0] = pal[ 0 ]; |
| 528 | c[0][1] = pal[ 1 ]; |
| 529 | c[1][0] = pal[ 2 ]; |
| 530 | c[1][1] = pal[ 3 ]; |
| 531 | 531 | for ( i = 0; i < 16; i += 2, rama >>= 1, ramb >>= 1 ) |
| 532 | 532 | dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ] [ ramb & 1 ]; |
| 533 | 533 | } |
| r2201 | r2202 | |
| 537 | 537 | { |
| 538 | 538 | int i; |
| 539 | 539 | pen_t c[2][2]; |
| 540 | | c[0][0] = machine->pens[ pal[ 0 ] ]; |
| 541 | | c[0][1] = machine->pens[ pal[ 1 ] ]; |
| 542 | | c[1][0] = machine->pens[ pal[ 2 ] ]; |
| 543 | | c[1][1] = machine->pens[ pal[ 3 ] ]; |
| 540 | c[0][0] = pal[ 0 ]; |
| 541 | c[0][1] = pal[ 1 ]; |
| 542 | c[1][0] = pal[ 2 ]; |
| 543 | c[1][1] = pal[ 3 ]; |
| 544 | 544 | for ( i = 0; i < 8; i++, rama >>= 1, ramb >>= 1 ) |
| 545 | 545 | dst[ 7 - i ] = c[ rama & 1 ] [ ramb & 1 ]; |
| 546 | 546 | } |
| r2201 | r2202 | |
| 554 | 554 | { |
| 555 | 555 | int i; |
| 556 | 556 | pen_t c[4]; |
| 557 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 558 | | c[1] = machine->pens[ pal[ 1 ] ]; |
| 559 | | c[2] = machine->pens[ pal[ 2 ] ]; |
| 560 | | c[3] = machine->pens[ pal[ 3 ] ]; |
| 557 | c[0] = pal[ 0 ]; |
| 558 | c[1] = pal[ 1 ]; |
| 559 | c[2] = pal[ 2 ]; |
| 560 | c[3] = pal[ 3 ]; |
| 561 | 561 | for ( i = 0; i < 8; i += 2, ramb >>= 2 ) |
| 562 | 562 | dst[ 15 - i ] = dst[ 14 - i ] = c[ ramb & 3 ]; |
| 563 | 563 | for ( i = 0; i < 8; i += 2, rama >>= 2 ) |
| r2201 | r2202 | |
| 569 | 569 | { |
| 570 | 570 | int i; |
| 571 | 571 | pen_t c[4]; |
| 572 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 573 | | c[1] = machine->pens[ pal[ 1 ] ]; |
| 574 | | c[2] = machine->pens[ pal[ 2 ] ]; |
| 575 | | c[3] = machine->pens[ pal[ 3 ] ]; |
| 572 | c[0] = pal[ 0 ]; |
| 573 | c[1] = pal[ 1 ]; |
| 574 | c[2] = pal[ 2 ]; |
| 575 | c[3] = pal[ 3 ]; |
| 576 | 576 | for ( i = 0; i < 4; i++, ramb >>= 2 ) |
| 577 | 577 | dst[ 7 - i ] = c[ ramb & 3 ]; |
| 578 | 578 | for ( i = 0; i < 4; i++, rama >>= 2 ) |
| r2201 | r2202 | |
| 586 | 586 | |
| 587 | 587 | UPDATE_HI( bitmap16 ) |
| 588 | 588 | { |
| 589 | | dst[ 0] = dst[ 1] = dst[ 2] = dst[ 3] = machine->pens[ pal[ rama >> 4 ] ]; |
| 590 | | dst[ 4] = dst[ 5] = dst[ 6] = dst[ 7] = machine->pens[ pal[ rama & 15 ] ]; |
| 591 | | dst[ 8] = dst[ 9] = dst[10] = dst[11] = machine->pens[ pal[ ramb >> 4 ] ]; |
| 592 | | dst[12] = dst[13] = dst[14] = dst[15] = machine->pens[ pal[ ramb & 15 ] ]; |
| 589 | dst[ 0] = dst[ 1] = dst[ 2] = dst[ 3] = pal[ rama >> 4 ]; |
| 590 | dst[ 4] = dst[ 5] = dst[ 6] = dst[ 7] = pal[ rama & 15 ]; |
| 591 | dst[ 8] = dst[ 9] = dst[10] = dst[11] = pal[ ramb >> 4 ]; |
| 592 | dst[12] = dst[13] = dst[14] = dst[15] = pal[ ramb & 15 ]; |
| 593 | 593 | } |
| 594 | 594 | END_UPDATE |
| 595 | 595 | |
| 596 | 596 | UPDATE_LOW( bitmap16 ) |
| 597 | 597 | { |
| 598 | | dst[0] = dst[1] = machine->pens[ pal[ rama >> 4 ] ]; |
| 599 | | dst[2] = dst[3] = machine->pens[ pal[ rama & 15 ] ]; |
| 600 | | dst[4] = dst[5] = machine->pens[ pal[ ramb >> 4 ] ]; |
| 601 | | dst[6] = dst[7] = machine->pens[ pal[ ramb & 15 ] ]; |
| 598 | dst[0] = dst[1] = pal[ rama >> 4 ]; |
| 599 | dst[2] = dst[3] = pal[ rama & 15 ]; |
| 600 | dst[4] = dst[5] = pal[ ramb >> 4 ]; |
| 601 | dst[6] = dst[7] = pal[ ramb & 15 ]; |
| 602 | 602 | } |
| 603 | 603 | END_UPDATE |
| 604 | 604 | |
| r2201 | r2202 | |
| 610 | 610 | { |
| 611 | 611 | int i; |
| 612 | 612 | pen_t c[2]; |
| 613 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 614 | | c[1] = machine->pens[ pal[ 1 ] ]; |
| 613 | c[0] = pal[ 0 ]; |
| 614 | c[1] = pal[ 1 ]; |
| 615 | 615 | for ( i = 0; i < 8; i++, ramb >>= 1 ) |
| 616 | 616 | dst[ 15 - i ] = c[ ramb & 1 ]; |
| 617 | 617 | for ( i = 0; i < 8; i++, rama >>= 1 ) |
| r2201 | r2202 | |
| 624 | 624 | /* 640-pixel mode but 320 pixels emulated => we merge pixels */ |
| 625 | 625 | int i; |
| 626 | 626 | pen_t c[4]; |
| 627 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 628 | | c[1] = c[2] = c[3] = machine->pens[ pal[ 1 ] ]; |
| 627 | c[0] = pal[ 0 ]; |
| 628 | c[1] = c[2] = c[3] = pal[ 1 ]; |
| 629 | 629 | for ( i = 0; i < 4; i++, ramb >>= 2 ) |
| 630 | 630 | dst[ 7 - i ] = c[ ramb & 3 ]; |
| 631 | 631 | for ( i = 0; i < 4; i++, rama >>= 2 ) |
| r2201 | r2202 | |
| 641 | 641 | { |
| 642 | 642 | int i; |
| 643 | 643 | pen_t c[2]; |
| 644 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 645 | | c[1] = machine->pens[ pal[ 6 ] ]; |
| 644 | c[0] = pal[ 0 ]; |
| 645 | c[1] = pal[ 6 ]; |
| 646 | 646 | for ( i = 0; i < 8; i++, ramb >>= 1 ) |
| 647 | 647 | dst[ 15 - i ] = c[ ramb & 1 ]; |
| 648 | 648 | for ( i = 0; i < 8; i++, rama >>= 1 ) |
| r2201 | r2202 | |
| 654 | 654 | { |
| 655 | 655 | int i; |
| 656 | 656 | pen_t c[4]; |
| 657 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 658 | | c[1] = c[2] = c[3] = machine->pens[ pal[ 6 ] ]; |
| 657 | c[0] = pal[ 0 ]; |
| 658 | c[1] = c[2] = c[3] = pal[ 6 ]; |
| 659 | 659 | for ( i = 0; i < 4; i++, ramb >>= 2 ) |
| 660 | 660 | dst[ 7 - i ] = c[ ramb & 3 ]; |
| 661 | 661 | for ( i = 0; i < 4; i++, rama >>= 2 ) |
| r2201 | r2202 | |
| 671 | 671 | { |
| 672 | 672 | int i; |
| 673 | 673 | pen_t c[2]; |
| 674 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 675 | | c[1] = machine->pens[ pal[ 1 ] ]; |
| 674 | c[0] = pal[ 0 ]; |
| 675 | c[1] = pal[ 1 ]; |
| 676 | 676 | for ( i = 0; i < 16; i += 2, rama >>= 1 ) |
| 677 | 677 | dst[ 15 - i ] = dst[ 14 - i ] = c[ rama & 1 ]; |
| 678 | 678 | (void)ramb; |
| r2201 | r2202 | |
| 683 | 683 | { |
| 684 | 684 | int i; |
| 685 | 685 | pen_t c[2]; |
| 686 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 687 | | c[1] = machine->pens[ pal[ 1 ] ]; |
| 686 | c[0] = pal[ 0 ]; |
| 687 | c[1] = pal[ 1 ]; |
| 688 | 688 | for ( i = 0; i < 8; i++, rama >>= 1 ) |
| 689 | 689 | dst[ 7 - i ] = c[ rama & 1 ]; |
| 690 | 690 | (void)ramb; |
| r2201 | r2202 | |
| 695 | 695 | { |
| 696 | 696 | int i; |
| 697 | 697 | pen_t c[2]; |
| 698 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 699 | | c[1] = machine->pens[ pal[ 2 ] ]; |
| 698 | c[0] = pal[ 0 ]; |
| 699 | c[1] = pal[ 2 ]; |
| 700 | 700 | for ( i = 0; i < 16; i += 2, ramb >>= 1 ) |
| 701 | 701 | dst[ 15 - i ] = dst[ 14 - i ] = c[ ramb & 1 ]; |
| 702 | 702 | (void)rama; |
| r2201 | r2202 | |
| 707 | 707 | { |
| 708 | 708 | int i; |
| 709 | 709 | pen_t c[2]; |
| 710 | | c[0] = machine->pens[ pal[ 0 ] ]; |
| 711 | | c[1] = machine->pens[ pal[ 2 ] ]; |
| 710 | c[0] = pal[ 0 ]; |
| 711 | c[1] = pal[ 2 ]; |
| 712 | 712 | for ( i = 0; i < 8; i++, ramb >>= 1 ) |
| 713 | 713 | dst[ 7 - i ] = c[ ramb & 1 ]; |
| 714 | 714 | (void)rama; |
| r2201 | r2202 | |
| 723 | 723 | { |
| 724 | 724 | int i; |
| 725 | 725 | pen_t c[2][2]; |
| 726 | | c[0][0] = machine->pens[ pal[ 0 ] ]; |
| 727 | | c[0][1] = c[1][1] = machine->pens[ pal[ 1 ] ]; |
| 728 | | c[1][0] = machine->pens[ pal[ 2 ] ]; |
| 726 | c[0][0] = pal[ 0 ]; |
| 727 | c[0][1] = c[1][1] = pal[ 1 ]; |
| 728 | c[1][0] = pal[ 2 ]; |
| 729 | 729 | for ( i = 0; i < 16; i += 2, rama >>= 1, ramb >>= 1 ) |
| 730 | 730 | dst[ 15 - i ] = dst[ 14 - i ] = c[ ramb & 1 ] [ rama & 1 ]; |
| 731 | 731 | } |
| r2201 | r2202 | |
| 735 | 735 | { |
| 736 | 736 | int i; |
| 737 | 737 | pen_t c[2][2]; |
| 738 | | c[0][0] = machine->pens[ pal[ 0 ] ]; |
| 739 | | c[0][1] = c[1][1] = machine->pens[ pal[ 1 ] ]; |
| 740 | | c[1][0] = machine->pens[ pal[ 2 ] ]; |
| 738 | c[0][0] = pal[ 0 ]; |
| 739 | c[0][1] = c[1][1] = pal[ 1 ]; |
| 740 | c[1][0] = pal[ 2 ]; |
| 741 | 741 | for ( i = 0; i < 8; i++, rama >>= 1, ramb >>= 1 ) |
| 742 | 742 | dst[ 7 - i ] = c[ ramb & 1 ] [ rama & 1 ]; |
| 743 | 743 | } |
| r2201 | r2202 | |
| 755 | 755 | int i; |
| 756 | 756 | for ( i = 0; i < 16; i += 4, rama >>= 1, ramb >>= 1 ) |
| 757 | 757 | dst[ 15 - i ] = dst[ 14 - i ] = dst[ 13 - i ] = dst[ 12 - i ] = |
| 758 | | machine->pens[ pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ] |
| 759 | | [ rama & 1 ] [ (rama >> 4) & 1 ] ] ]; |
| 758 | pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ] |
| 759 | [ rama & 1 ] [ (rama >> 4) & 1 ] ]; |
| 760 | 760 | } |
| 761 | 761 | END_UPDATE |
| 762 | 762 | |
| r2201 | r2202 | |
| 768 | 768 | int i; |
| 769 | 769 | for ( i = 0; i < 8; i += 2, rama >>= 1, ramb >>= 1 ) |
| 770 | 770 | dst[ 7 - i ] = dst[ 6 - i ] = |
| 771 | | machine->pens[ pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ] |
| 772 | | [ rama & 1 ] [ (rama >> 4) & 1 ] ] ]; |
| 771 | pal[ p[ ramb & 1 ] [ (ramb >> 4) & 1 ] |
| 772 | [ rama & 1 ] [ (rama >> 4) & 1 ] ]; |
| 773 | 773 | } |
| 774 | 774 | END_UPDATE |
| 775 | 775 | |
| r2201 | r2202 | |
| 810 | 810 | xx++; |
| 811 | 811 | } while ( xx < 40 && thom_vmodepage[xx] == -1 ); |
| 812 | 812 | thom_scandraw_funcs[ mode ][ thom_hires ] |
| 813 | | ( machine, thom_vram + y * 40 + page * 0x4000, |
| 813 | ( thom_vram + y * 40 + page * 0x4000, |
| 814 | 814 | thom_vbody + y * 320 * (thom_hires+1), |
| 815 | 815 | thom_last_pal, x, xx-x ); |
| 816 | 816 | x = xx; |
| r2201 | r2202 | |
| 906 | 906 | const int yup = THOM_BORDER_HEIGHT + THOM_ACTIVE_HEIGHT; |
| 907 | 907 | const int ybot = THOM_BORDER_HEIGHT + thom_bheight + 200; |
| 908 | 908 | UINT16* v = thom_vbody; |
| 909 | | pen_t border = screen->machine->pens[ 0 ]; |
| 909 | pen_t border = 0; |
| 910 | 910 | rectangle wrect = { 0, xright - 1, 0, 0 }; |
| 911 | 911 | rectangle lrect = { 0, xbleft - 1, 0, 0 }; |
| 912 | 912 | rectangle rrect = { xbright, xright - 1, 0, 0 }; |
| r2201 | r2202 | |
| 917 | 917 | for ( y = 0; y < THOM_BORDER_HEIGHT - thom_bheight; y++ ) |
| 918 | 918 | { |
| 919 | 919 | if ( thom_border_l[ y ] != -1 ) |
| 920 | | border = screen->machine->pens[ thom_border_l[ y ] ]; |
| 920 | border = thom_border_l[ y ]; |
| 921 | 921 | } |
| 922 | 922 | ypos = 0; |
| 923 | 923 | while ( y < THOM_BORDER_HEIGHT ) |
| 924 | 924 | { |
| 925 | 925 | if ( thom_border_l[ y ] != -1 ) |
| 926 | | border = screen->machine->pens[ thom_border_l[ y ] ]; |
| 926 | border = thom_border_l[ y ]; |
| 927 | 927 | wrect.min_y = ypos; |
| 928 | 928 | do |
| 929 | 929 | { |
| r2201 | r2202 | |
| 939 | 939 | while ( y < yup ) |
| 940 | 940 | { |
| 941 | 941 | if ( thom_border_l[ y ] != -1 ) |
| 942 | | border = screen->machine->pens[ thom_border_l[ y ] ]; |
| 942 | border = thom_border_l[ y ]; |
| 943 | 943 | lrect.min_y = ypos; |
| 944 | 944 | do |
| 945 | 945 | { |
| r2201 | r2202 | |
| 955 | 955 | while (y < ybot ) |
| 956 | 956 | { |
| 957 | 957 | if ( thom_border_l[ y ] != -1 ) |
| 958 | | border = screen->machine->pens[ thom_border_l[ y ] ]; |
| 958 | border = thom_border_l[ y ]; |
| 959 | 959 | wrect.min_y = ypos; |
| 960 | 960 | do |
| 961 | 961 | { |
| r2201 | r2202 | |
| 969 | 969 | /* right border */ |
| 970 | 970 | for ( y = 0; y < THOM_BORDER_HEIGHT; y++ ) { |
| 971 | 971 | if ( thom_border_r[ y ] != -1 ) |
| 972 | | border = screen->machine->pens[ thom_border_r[ y ] ]; |
| 972 | border = thom_border_r[ y ]; |
| 973 | 973 | } |
| 974 | 974 | ypos = thom_bheight /* * scale */; |
| 975 | 975 | while ( y < yup ) |
| 976 | 976 | { |
| 977 | 977 | if ( thom_border_r[ y ] != -1 ) |
| 978 | | border = screen->machine->pens[ thom_border_r[ y ] ]; |
| 978 | border = thom_border_r[ y ]; |
| 979 | 979 | rrect.min_y = ypos; |
| 980 | 980 | do |
| 981 | 981 | { |
src/mess/video/spectrum.c
| r2201 | r2202 | |
| 301 | 301 | for (b=0x80;b!=0;b>>=1) |
| 302 | 302 | { |
| 303 | 303 | if (*scr&b) |
| 304 | | spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,screen->machine->pens[ink]); |
| 304 | spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,ink); |
| 305 | 305 | else |
| 306 | | spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,screen->machine->pens[pap]); |
| 306 | spectrum_plot_pixel(bitmap,scrx++,SPEC_TOP_BORDER+scry,pap); |
| 307 | 307 | } |
| 308 | 308 | scr++; |
| 309 | 309 | attr++; |
| r2201 | r2202 | |
| 341 | 341 | *******************************************************************/ |
| 342 | 342 | |
| 343 | 343 | /* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */ |
| 344 | | static void ts2068_hires_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines) |
| 344 | static void ts2068_hires_scanline(bitmap_t *bitmap, int y, int borderlines) |
| 345 | 345 | { |
| 346 | 346 | int x,b,scrx,scry; |
| 347 | 347 | unsigned short ink,pap; |
| r2201 | r2202 | |
| 371 | 371 | { |
| 372 | 372 | if (*scr&b) |
| 373 | 373 | { |
| 374 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 375 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 374 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink); |
| 375 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink); |
| 376 | 376 | } |
| 377 | 377 | else |
| 378 | 378 | { |
| 379 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 380 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 379 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap); |
| 380 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap); |
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | scr++; |
| r2201 | r2202 | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /* Draw a scanline in TS2068/TC2048 64-column mode */ |
| 389 | | static void ts2068_64col_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines, unsigned short inkcolor) |
| 389 | static void ts2068_64col_scanline(bitmap_t *bitmap, int y, int borderlines, unsigned short inkcolor) |
| 390 | 390 | { |
| 391 | 391 | int x,b,scrx,scry; |
| 392 | 392 | unsigned char *scr1, *scr2; |
| r2201 | r2202 | |
| 402 | 402 | for (b=0x80;b!=0;b>>=1) |
| 403 | 403 | { |
| 404 | 404 | if (*scr1&b) |
| 405 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[inkcolor]); |
| 405 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,inkcolor); |
| 406 | 406 | else |
| 407 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[7-inkcolor]); |
| 407 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,7-inkcolor); |
| 408 | 408 | } |
| 409 | 409 | scr1++; |
| 410 | 410 | |
| 411 | 411 | for (b=0x80;b!=0;b>>=1) |
| 412 | 412 | { |
| 413 | 413 | if (*scr2&b) |
| 414 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[inkcolor]); |
| 414 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,inkcolor); |
| 415 | 415 | else |
| 416 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[7-inkcolor]); |
| 416 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,7-inkcolor); |
| 417 | 417 | } |
| 418 | 418 | scr2++; |
| 419 | 419 | } |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | /* Draw a scanline in TS2068/TC2048 lores (normal Spectrum) mode */ |
| 423 | | static void ts2068_lores_scanline(running_machine *machine, bitmap_t *bitmap, int y, int borderlines, int screen) |
| 423 | static void ts2068_lores_scanline(bitmap_t *bitmap, int y, int borderlines, int screen) |
| 424 | 424 | { |
| 425 | 425 | int x,b,scrx,scry; |
| 426 | 426 | unsigned short ink,pap; |
| r2201 | r2202 | |
| 450 | 450 | { |
| 451 | 451 | if (*scr&b) |
| 452 | 452 | { |
| 453 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 454 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[ink]); |
| 453 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink); |
| 454 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,ink); |
| 455 | 455 | } |
| 456 | 456 | else |
| 457 | 457 | { |
| 458 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 459 | | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,machine->pens[pap]); |
| 458 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap); |
| 459 | spectrum_plot_pixel(bitmap,scrx++,scry+borderlines,pap); |
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 | scr++; |
| r2201 | r2202 | |
| 475 | 475 | /* 64 Column mode */ |
| 476 | 476 | unsigned short inkcolor = (ts2068_port_ff_data & 0x38) >> 3; |
| 477 | 477 | for (count = 0; count < 192; count++) |
| 478 | | ts2068_64col_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER, inkcolor); |
| 478 | ts2068_64col_scanline(bitmap, count, TS2068_TOP_BORDER, inkcolor); |
| 479 | 479 | } |
| 480 | 480 | else if ((ts2068_port_ff_data & 7) == 2) |
| 481 | 481 | { |
| 482 | 482 | /* Extended Color mode */ |
| 483 | 483 | for (count = 0; count < 192; count++) |
| 484 | | ts2068_hires_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER); |
| 484 | ts2068_hires_scanline(bitmap, count, TS2068_TOP_BORDER); |
| 485 | 485 | } |
| 486 | 486 | else if ((ts2068_port_ff_data & 7) == 1) |
| 487 | 487 | { |
| 488 | 488 | /* Screen 6000-7aff */ |
| 489 | 489 | for (count = 0; count < 192; count++) |
| 490 | | ts2068_lores_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER, 1); |
| 490 | ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 1); |
| 491 | 491 | } |
| 492 | 492 | else |
| 493 | 493 | { |
| 494 | 494 | /* Screen 4000-5aff */ |
| 495 | 495 | for (count = 0; count < 192; count++) |
| 496 | | ts2068_lores_scanline(screen->machine, bitmap, count, TS2068_TOP_BORDER, 0); |
| 496 | ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 0); |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | draw_border(screen->machine, bitmap, full_refresh, |
| r2201 | r2202 | |
| 515 | 515 | /* 64 Column mode */ |
| 516 | 516 | unsigned short inkcolor = (ts2068_port_ff_data & 0x38) >> 3; |
| 517 | 517 | for (count = 0; count < 192; count++) |
| 518 | | ts2068_64col_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER, inkcolor); |
| 518 | ts2068_64col_scanline(bitmap, count, SPEC_TOP_BORDER, inkcolor); |
| 519 | 519 | } |
| 520 | 520 | else if ((ts2068_port_ff_data & 7) == 2) |
| 521 | 521 | { |
| 522 | 522 | /* Extended Color mode */ |
| 523 | 523 | for (count = 0; count < 192; count++) |
| 524 | | ts2068_hires_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER); |
| 524 | ts2068_hires_scanline(bitmap, count, SPEC_TOP_BORDER); |
| 525 | 525 | } |
| 526 | 526 | else if ((ts2068_port_ff_data & 7) == 1) |
| 527 | 527 | { |
| 528 | 528 | /* Screen 6000-7aff */ |
| 529 | 529 | for (count = 0; count < 192; count++) |
| 530 | | ts2068_lores_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER, 1); |
| 530 | ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 1); |
| 531 | 531 | } |
| 532 | 532 | else |
| 533 | 533 | { |
| 534 | 534 | /* Screen 4000-5aff */ |
| 535 | 535 | for (count = 0; count < 192; count++) |
| 536 | | ts2068_lores_scanline(screen->machine, bitmap, count, SPEC_TOP_BORDER, 0); |
| 536 | ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 0); |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | draw_border(screen->machine, bitmap, full_refresh, |
src/mess/video/ssystem3.c
| r2201 | r2202 | |
| 87 | 87 | " dddddddddddd" |
| 88 | 88 | }; |
| 89 | 89 | |
| 90 | | static void ssystem3_draw_7segment(running_machine *machine, bitmap_t *bitmap,int value, int x, int y) |
| 90 | static void ssystem3_draw_7segment(bitmap_t *bitmap,int value, int x, int y) |
| 91 | 91 | { |
| 92 | 92 | int i, xi, yi, mask, color; |
| 93 | 93 | |
| r2201 | r2202 | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | if (mask!=0) { |
| 111 | | color=machine->pens[(value&mask)?1:0]; |
| 111 | color=(value&mask)?1:0; |
| 112 | 112 | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = color; |
| 113 | 113 | } |
| 114 | 114 | if (led[i]!='\r') xi++; |
| r2201 | r2202 | |
| 193 | 193 | int i; |
| 194 | 194 | |
| 195 | 195 | for (i=0; i<4; i++) { |
| 196 | | ssystem3_draw_7segment(screen->machine, bitmap, ssystem3_lcd.data[1+i], ssystem3_led_pos[i].x, ssystem3_led_pos[i].y); |
| 196 | ssystem3_draw_7segment(bitmap, ssystem3_lcd.data[1+i], ssystem3_led_pos[i].x, ssystem3_led_pos[i].y); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '0'); //? |
| 200 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&2?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '5'); |
| 201 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&4?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '7'); |
| 202 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&8?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'b'); |
| 203 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x10?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '9'); |
| 204 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x20?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '8'); |
| 205 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x40?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'c'); |
| 206 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[0]&0x80?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '6'); |
| 207 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[1]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '2'); |
| 208 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[2]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '1'); //? |
| 209 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[3]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3'); |
| 210 | | ssystem3_draw_led(bitmap, screen->machine->pens[ssystem3_lcd.data[4]&1?1:0], ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4'); |
| 199 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '0'); //? |
| 200 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&2?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '5'); |
| 201 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&4?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '7'); |
| 202 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&8?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'b'); |
| 203 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x10?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '9'); |
| 204 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x20?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '8'); |
| 205 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x40?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, 'c'); |
| 206 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[0]&0x80?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '6'); |
| 207 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[1]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '2'); |
| 208 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[2]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '1'); //? |
| 209 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[3]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '3'); |
| 210 | ssystem3_draw_led(bitmap, ssystem3_lcd.data[4]&1?1:0, ssystem3_led_pos[4].x, ssystem3_led_pos[4].y, '4'); |
| 211 | 211 | |
| 212 | 212 | if (readinputportbytag("Configuration")&1) { // playfield(optional device) |
| 213 | 213 | const int lcd_signs_on[]={ |
| r2201 | r2202 | |
| 227 | 227 | int xp=263+x*22; |
| 228 | 228 | int yp=55+(y^7)*28; |
| 229 | 229 | ssystem3_playfield_getfigure(x, y, &figure, &black); |
| 230 | | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&1?1:0], xp, yp, '6'); |
| 231 | | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&2?1:0], xp, yp, '8'); |
| 232 | | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&4?1:0], xp, yp, '9'); |
| 233 | | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&8?1:0], xp, yp, 'b'); |
| 234 | | ssystem3_draw_led(bitmap, screen->machine->pens[lcd_signs_on[figure]&0x10?1:0], xp, yp, 'c'); |
| 235 | | ssystem3_draw_led(bitmap, screen->machine->pens[figure!=0 && black?1:0], xp, yp, '7'); |
| 230 | ssystem3_draw_led(bitmap, lcd_signs_on[figure]&1?1:0, xp, yp, '6'); |
| 231 | ssystem3_draw_led(bitmap, lcd_signs_on[figure]&2?1:0, xp, yp, '8'); |
| 232 | ssystem3_draw_led(bitmap, lcd_signs_on[figure]&4?1:0, xp, yp, '9'); |
| 233 | ssystem3_draw_led(bitmap, lcd_signs_on[figure]&8?1:0, xp, yp, 'b'); |
| 234 | ssystem3_draw_led(bitmap, lcd_signs_on[figure]&0x10?1:0, xp, yp, 'c'); |
| 235 | ssystem3_draw_led(bitmap, figure!=0 && black?1:0, xp, yp, '7'); |
| 236 | 236 | |
| 237 | 237 | } |
| 238 | 238 | } |
src/mess/video/tms3556.c
| r2201 | r2202 | |
| 307 | 307 | draw a line of text (called by tms3556_draw_line_text and |
| 308 | 308 | tms3556_draw_line_mixed) |
| 309 | 309 | */ |
| 310 | | static void tms3556_draw_line_text_common(running_machine *machine, UINT16 *ln) |
| 310 | static void tms3556_draw_line_text_common(UINT16 *ln) |
| 311 | 311 | { |
| 312 | 312 | int pattern, x, xx, i, name_offset; |
| 313 | 313 | UINT16 fg, bg; |
| r2201 | r2202 | |
| 335 | 335 | name_lo = nametbl[name_offset+1]; |
| 336 | 336 | pattern_ix = ((name_hi >> 2) & 2) | ((name_hi >> 4) & 1); |
| 337 | 337 | alphanumeric_mode = (pattern_ix < 2) || ((pattern_ix == 3) && !(vdp.controlRegs[7] & 0x08)); |
| 338 | | fg = machine->pens[(name_hi >> 5) & 0x7]; |
| 338 | fg = (name_hi >> 5) & 0x7; |
| 339 | 339 | if (alphanumeric_mode) |
| 340 | 340 | { |
| 341 | 341 | if (name_hi & 4) |
| r2201 | r2202 | |
| 421 | 421 | draw a line of bitmap (called by tms3556_draw_line_bitmap and |
| 422 | 422 | tms3556_draw_line_mixed) |
| 423 | 423 | */ |
| 424 | | static void tms3556_draw_line_bitmap_common(running_machine *machine, UINT16 *ln) |
| 424 | static void tms3556_draw_line_bitmap_common(UINT16 *ln) |
| 425 | 425 | { |
| 426 | 426 | int x, xx; |
| 427 | 427 | UINT8 *nametbl; |
| r2201 | r2202 | |
| 443 | 443 | name_r = nametbl[vdp.name_offset+2]; |
| 444 | 444 | for (xx=0;xx<8;xx++) |
| 445 | 445 | { |
| 446 | | UINT16 color = machine->pens[((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1)]; |
| 446 | UINT16 color = ((name_b >> 5) & 0x4) | ((name_g >> 6) & 0x2) | ((name_r >> 7) & 0x1); |
| 447 | 447 | #if DOUBLE_WIDTH |
| 448 | 448 | *ln++ = color; |
| 449 | 449 | #endif |
| r2201 | r2202 | |
| 467 | 467 | |
| 468 | 468 | draw a line in text mode |
| 469 | 469 | */ |
| 470 | | static void tms3556_draw_line_text(running_machine *machine, UINT16 *ln) |
| 470 | static void tms3556_draw_line_text(UINT16 *ln) |
| 471 | 471 | { |
| 472 | 472 | if (vdp.char_line_counter == 0) |
| 473 | 473 | vdp.char_line_counter = 10; |
| 474 | 474 | vdp.char_line_counter--; |
| 475 | | tms3556_draw_line_text_common(machine, ln); |
| 475 | tms3556_draw_line_text_common(ln); |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | /* |
| r2201 | r2202 | |
| 480 | 480 | |
| 481 | 481 | draw a line in bitmap mode |
| 482 | 482 | */ |
| 483 | | static void tms3556_draw_line_bitmap(running_machine *machine, UINT16 *ln) |
| 483 | static void tms3556_draw_line_bitmap(UINT16 *ln) |
| 484 | 484 | { |
| 485 | 485 | UINT8 *nametbl; |
| 486 | 486 | |
| 487 | 487 | |
| 488 | | tms3556_draw_line_bitmap_common(machine, ln); |
| 488 | tms3556_draw_line_bitmap_common(ln); |
| 489 | 489 | nametbl = vdp.vram + vdp.addressRegs[2]; |
| 490 | | vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7]; |
| 490 | vdp.bg_color = (nametbl[vdp.name_offset] >> 5) & 0x7; |
| 491 | 491 | vdp.name_offset += 2; |
| 492 | 492 | } |
| 493 | 493 | |
| r2201 | r2202 | |
| 496 | 496 | |
| 497 | 497 | draw a line in mixed mode |
| 498 | 498 | */ |
| 499 | | static void tms3556_draw_line_mixed(running_machine *machine, UINT16 *ln) |
| 499 | static void tms3556_draw_line_mixed(UINT16 *ln) |
| 500 | 500 | { |
| 501 | 501 | UINT8 *nametbl; |
| 502 | 502 | |
| 503 | 503 | |
| 504 | 504 | if (vdp.cg_flag) |
| 505 | 505 | { /* bitmap line */ |
| 506 | | tms3556_draw_line_bitmap_common(machine, ln); |
| 506 | tms3556_draw_line_bitmap_common(ln); |
| 507 | 507 | nametbl = vdp.vram + vdp.addressRegs[2]; |
| 508 | | vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7]; |
| 508 | vdp.bg_color = (nametbl[vdp.name_offset] >> 5) & 0x7; |
| 509 | 509 | vdp.cg_flag = (nametbl[vdp.name_offset] >> 4) & 0x1; |
| 510 | 510 | vdp.name_offset += 2; |
| 511 | 511 | } |
| r2201 | r2202 | |
| 514 | 514 | if (vdp.char_line_counter == 0) |
| 515 | 515 | vdp.char_line_counter = 10; |
| 516 | 516 | vdp.char_line_counter--; |
| 517 | | tms3556_draw_line_text_common(machine, ln); |
| 517 | tms3556_draw_line_text_common(ln); |
| 518 | 518 | if (vdp.char_line_counter == 0) |
| 519 | 519 | { |
| 520 | 520 | nametbl = vdp.vram + vdp.addressRegs[2]; |
| 521 | | vdp.bg_color = machine->pens[(nametbl[vdp.name_offset] >> 5) & 0x7]; |
| 521 | vdp.bg_color = (nametbl[vdp.name_offset] >> 5) & 0x7; |
| 522 | 522 | vdp.cg_flag = (nametbl[vdp.name_offset] >> 4) & 0x1; |
| 523 | 523 | vdp.name_offset += 2; |
| 524 | 524 | } |
| r2201 | r2202 | |
| 530 | 530 | |
| 531 | 531 | draw a line. If non-interlaced mode, duplicate the line. |
| 532 | 532 | */ |
| 533 | | static void tms3556_draw_line(running_machine *machine, bitmap_t *bmp, int line) |
| 533 | static void tms3556_draw_line(bitmap_t *bmp, int line) |
| 534 | 534 | { |
| 535 | 535 | int double_lines; |
| 536 | 536 | UINT16 *ln, *ln2 = NULL; |
| r2201 | r2202 | |
| 560 | 560 | tms3556_draw_line_empty(ln); |
| 561 | 561 | break; |
| 562 | 562 | case TMS3556_MODE_TEXT: |
| 563 | | tms3556_draw_line_text(machine, ln); |
| 563 | tms3556_draw_line_text(ln); |
| 564 | 564 | break; |
| 565 | 565 | case TMS3556_MODE_BITMAP: |
| 566 | | tms3556_draw_line_bitmap(machine, ln); |
| 566 | tms3556_draw_line_bitmap(ln); |
| 567 | 567 | break; |
| 568 | 568 | case TMS3556_MODE_MIXED: |
| 569 | | tms3556_draw_line_mixed(machine, ln); |
| 569 | tms3556_draw_line_mixed(ln); |
| 570 | 570 | break; |
| 571 | 571 | } |
| 572 | 572 | } |
| r2201 | r2202 | |
| 581 | 581 | |
| 582 | 582 | Do vblank-time tasks |
| 583 | 583 | */ |
| 584 | | static void tms3556_interrupt_start_vblank(running_machine *machine) |
| 584 | static void tms3556_interrupt_start_vblank(void) |
| 585 | 585 | { |
| 586 | 586 | int i; |
| 587 | 587 | |
| r2201 | r2202 | |
| 598 | 598 | vdp.blink_count = 60; /*no idea what the real value is*/ |
| 599 | 599 | } |
| 600 | 600 | /* reset background color */ |
| 601 | | vdp.bg_color = machine->pens[(vdp.controlRegs[7] >> 5) & 0x7]; |
| 601 | vdp.bg_color = (vdp.controlRegs[7] >> 5) & 0x7; |
| 602 | 602 | /* reset name offset */ |
| 603 | 603 | vdp.name_offset = 0; |
| 604 | 604 | /* reset character line counter */ |
| r2201 | r2202 | |
| 615 | 615 | |
| 616 | 616 | scanline handler |
| 617 | 617 | */ |
| 618 | | void tms3556_interrupt(running_machine *machine) |
| 618 | void tms3556_interrupt() |
| 619 | 619 | { |
| 620 | 620 | /* check for start of vblank */ |
| 621 | 621 | if (vdp.scanline == 310) /*no idea what the real value is*/ |
| 622 | | tms3556_interrupt_start_vblank( machine ); |
| 622 | tms3556_interrupt_start_vblank(); |
| 623 | 623 | |
| 624 | 624 | /* render the current line */ |
| 625 | 625 | if ((vdp.scanline >= 0) && (vdp.scanline < TOTAL_HEIGHT)) |
| 626 | 626 | { |
| 627 | 627 | //if (!video_skip_this_frame()) |
| 628 | | tms3556_draw_line(machine, tmpbitmap, vdp.scanline); |
| 628 | tms3556_draw_line(tmpbitmap, vdp.scanline); |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | if (++vdp.scanline == 313) |
src/mess/video/ted7360.c
| r2201 | r2202 | |
| 800 | 800 | ted7360_drawlines (machine, lastline, rasterline); |
| 801 | 801 | ted7360[offset] = data; |
| 802 | 802 | monoinversed[1] = mono[0] = bitmapmulti[0] = multi[0] = colors[0] = |
| 803 | | machine->pens[BACKGROUNDCOLOR]; |
| 803 | BACKGROUNDCOLOR; |
| 804 | 804 | } |
| 805 | 805 | break; |
| 806 | 806 | case 0x16: /* foregroundcolor */ |
| r2201 | r2202 | |
| 808 | 808 | { |
| 809 | 809 | ted7360_drawlines (machine, lastline, rasterline); |
| 810 | 810 | ted7360[offset] = data; |
| 811 | | bitmapmulti[3] = multi[1] = colors[1] = machine->pens[FOREGROUNDCOLOR]; |
| 811 | bitmapmulti[3] = multi[1] = colors[1] = FOREGROUNDCOLOR; |
| 812 | 812 | } |
| 813 | 813 | break; |
| 814 | 814 | case 0x17: /* multicolor 1 */ |
| r2201 | r2202 | |
| 816 | 816 | { |
| 817 | 817 | ted7360_drawlines (machine, lastline, rasterline); |
| 818 | 818 | ted7360[offset] = data; |
| 819 | | multi[2] = colors[2] = machine->pens[MULTICOLOR1]; |
| 819 | multi[2] = colors[2] = MULTICOLOR1; |
| 820 | 820 | } |
| 821 | 821 | break; |
| 822 | 822 | case 0x18: /* multicolor 2 */ |
| r2201 | r2202 | |
| 824 | 824 | { |
| 825 | 825 | ted7360_drawlines (machine, lastline, rasterline); |
| 826 | 826 | ted7360[offset] = data; |
| 827 | | colors[3] = machine->pens[MULTICOLOR2]; |
| 827 | colors[3] = MULTICOLOR2; |
| 828 | 828 | } |
| 829 | 829 | break; |
| 830 | 830 | case 0x19: /* framecolor */ |
| r2201 | r2202 | |
| 832 | 832 | { |
| 833 | 833 | ted7360_drawlines (machine, lastline, rasterline); |
| 834 | 834 | ted7360[offset] = data; |
| 835 | | colors[4] = machine->pens[FRAMECOLOR]; |
| 835 | colors[4] = FRAMECOLOR; |
| 836 | 836 | } |
| 837 | 837 | break; |
| 838 | 838 | case 0x1c: |
| r2201 | r2202 | |
| 956 | 956 | decodegfx(cursorelement, cursormask, 0, 1); |
| 957 | 957 | /* 7-Sep-2007 - After 0.118u5, you cannot revector the color table */ |
| 958 | 958 | /* cursorelement->colortable = cursorcolortable; */ |
| 959 | | cursorcolortable[1] = machine->pens[1]; |
| 959 | cursorcolortable[1] = 1; |
| 960 | 960 | cursorelement->total_colors = 2; |
| 961 | 961 | ted7360_bitmap = auto_bitmap_alloc(width, height, BITMAP_FORMAT_INDEXED16); |
| 962 | 962 | add_exit_callback(machine, ted7360_video_stop); |
| r2201 | r2202 | |
| 1078 | 1078 | if (!SCREENON) |
| 1079 | 1079 | { |
| 1080 | 1080 | for (line = first; (line < last) && (line < ted7360_bitmap->height); line++) |
| 1081 | | memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), machine->pens[0], ted7360_bitmap->width); |
| 1081 | memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), 0, ted7360_bitmap->width); |
| 1082 | 1082 | return; |
| 1083 | 1083 | } |
| 1084 | 1084 | |
| r2201 | r2202 | |
| 1093 | 1093 | end = y_begin + YPOS; |
| 1094 | 1094 | { |
| 1095 | 1095 | for (line = first; line < end; line++) |
| 1096 | | memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), machine->pens[FRAMECOLOR], |
| 1096 | memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), FRAMECOLOR, |
| 1097 | 1097 | ted7360_bitmap->width); |
| 1098 | 1098 | } |
| 1099 | 1099 | if (LINES25) |
| r2201 | r2202 | |
| 1125 | 1125 | attr = vic_dma_read (machine, ((videoaddr) + offs)); |
| 1126 | 1126 | c1 = ((ch >> 4) & 0xf) | (attr << 4); |
| 1127 | 1127 | c2 = (ch & 0xf) | (attr & 0x70); |
| 1128 | | bitmapmulti[1] = c16_bitmap[1] = machine->pens[c1 & 0x7f]; |
| 1129 | | bitmapmulti[2] = c16_bitmap[0] = machine->pens[c2 & 0x7f]; |
| 1128 | bitmapmulti[1] = c16_bitmap[1] = c1 & 0x7f; |
| 1129 | bitmapmulti[2] = c16_bitmap[0] = c2 & 0x7f; |
| 1130 | 1130 | if (MULTICOLORON) |
| 1131 | 1131 | { |
| 1132 | 1132 | ted7360_draw_bitmap_multi (machine, ybegin, yend, offs, yoff, xoff); |
| r2201 | r2202 | |
| 1146 | 1146 | // hardware reverse off |
| 1147 | 1147 | ecm = ch >> 6; |
| 1148 | 1148 | ecmcolor[0] = colors[ecm]; |
| 1149 | | ecmcolor[1] = machine->pens[attr & 0x7f]; |
| 1149 | ecmcolor[1] = attr & 0x7f; |
| 1150 | 1150 | ted7360_draw_character (machine, ybegin, yend, ch & ~0xC0, yoff, xoff, ecmcolor); |
| 1151 | 1151 | } |
| 1152 | 1152 | else if (MULTICOLORON) |
| r2201 | r2202 | |
| 1154 | 1154 | // hardware reverse off |
| 1155 | 1155 | if (attr & 8) |
| 1156 | 1156 | { |
| 1157 | | multi[3] = machine->pens[attr & 0x77]; |
| 1157 | multi[3] = attr & 0x77; |
| 1158 | 1158 | ted7360_draw_character_multi (machine, ybegin, yend, ch, yoff, xoff); |
| 1159 | 1159 | } |
| 1160 | 1160 | else |
| 1161 | 1161 | { |
| 1162 | | mono[1] = machine->pens[attr & 0x7f]; |
| 1162 | mono[1] = attr & 0x7f; |
| 1163 | 1163 | ted7360_draw_character (machine, ybegin, yend, ch, yoff, xoff, mono); |
| 1164 | 1164 | } |
| 1165 | 1165 | } |
| r2201 | r2202 | |
| 1167 | 1167 | { |
| 1168 | 1168 | #ifndef GFX |
| 1169 | 1169 | ted7360_draw_cursor (ybegin, yend, yoff, xoff, |
| 1170 | | machine->pens[attr & 0x7f]); |
| 1170 | attr & 0x7f); |
| 1171 | 1171 | #else |
| 1172 | | drawgfx (ted7360_bitmap, cursorelement, 0, machine->pens[attr & 0x7f], 0, 0, |
| 1172 | drawgfx (ted7360_bitmap, cursorelement, 0, attr & 0x7f, 0, 0, |
| 1173 | 1173 | xoff, yoff, 0, TRANSPARENCY_NONE, 0); |
| 1174 | 1174 | #endif |
| 1175 | 1175 | } |
| 1176 | 1176 | else if (REVERSEON && (ch & 0x80)) |
| 1177 | 1177 | { |
| 1178 | | monoinversed[0] = machine->pens[attr & 0x7f]; |
| 1178 | monoinversed[0] = attr & 0x7f; |
| 1179 | 1179 | if (cursor1 && (attr & 0x80)) |
| 1180 | 1180 | ted7360_draw_cursor (ybegin, yend, yoff, xoff, monoinversed[0]); |
| 1181 | 1181 | else |
| r2201 | r2202 | |
| 1184 | 1184 | } |
| 1185 | 1185 | else |
| 1186 | 1186 | { |
| 1187 | | mono[1] = machine->pens[attr & 0x7f]; |
| 1187 | mono[1] = attr & 0x7f; |
| 1188 | 1188 | if (cursor1 && (attr & 0x80)) |
| 1189 | 1189 | ted7360_draw_cursor (ybegin, yend, yoff, xoff, mono[0]); |
| 1190 | 1190 | else |
| r2201 | r2202 | |
| 1195 | 1195 | |
| 1196 | 1196 | for (i = ybegin; i <= yend; i++) |
| 1197 | 1197 | { |
| 1198 | | memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, 0), machine->pens[FRAMECOLOR], xbegin); |
| 1199 | | memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, xend), machine->pens[FRAMECOLOR], ted7360_bitmap->width - xend); |
| 1198 | memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, 0), FRAMECOLOR, xbegin); |
| 1199 | memset16 (BITMAP_ADDR16(ted7360_bitmap, yoff + i, xend), FRAMECOLOR, ted7360_bitmap->width - xend); |
| 1200 | 1200 | } |
| 1201 | 1201 | } |
| 1202 | 1202 | |
| r2201 | r2202 | |
| 1207 | 1207 | |
| 1208 | 1208 | for (; line < end; line++) |
| 1209 | 1209 | { |
| 1210 | | memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), machine->pens[FRAMECOLOR], ted7360_bitmap->width); |
| 1210 | memset16 (BITMAP_ADDR16(ted7360_bitmap, line, 0), FRAMECOLOR, ted7360_bitmap->width); |
| 1211 | 1211 | } |
| 1212 | 1212 | } |
| 1213 | 1213 | |
src/mess/video/vc4000.c
| r2201 | r2202 | |
| 257 | 257 | "iiiihhhhgggg" |
| 258 | 258 | }; |
| 259 | 259 | |
| 260 | | static void vc4000_draw_digit(running_machine *machine, bitmap_t *bitmap, int x, int y, int d, int line) |
| 260 | static void vc4000_draw_digit(bitmap_t *bitmap, int x, int y, int d, int line) |
| 261 | 261 | { |
| 262 | 262 | static const int digit_to_segment[0x10]={ |
| 263 | 263 | 0x0fff, 0x007c, 0x17df, 0x15ff, 0x1c7d, 0x1df7, 0x1ff7, 0x007f, 0x1fff, 0x1dff |
| r2201 | r2202 | |
| 266 | 266 | i=line; |
| 267 | 267 | for (j=0; j<sizeof(led[0]); j++) { |
| 268 | 268 | if (digit_to_segment[d]&(1<<(led[i][j]-'a')) ) { |
| 269 | | *BITMAP_ADDR16(bitmap, y+i, x+j) = machine->pens[((vc4000_video.reg.d.background>>4)&7)^7]; |
| 269 | *BITMAP_ADDR16(bitmap, y+i, x+j) = ((vc4000_video.reg.d.background>>4)&7)^7; |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | } |
| r2201 | r2202 | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | |
| 287 | | static void vc4000_sprite_update(running_machine *machine, bitmap_t *bitmap, UINT8 *collision, SPRITE *This) |
| 287 | static void vc4000_sprite_update(bitmap_t *bitmap, UINT8 *collision, SPRITE *This) |
| 288 | 288 | { |
| 289 | 289 | |
| 290 | 290 | int i,j,m; |
| r2201 | r2202 | |
| 317 | 317 | for (i=0; i<This->size; i++) |
| 318 | 318 | { |
| 319 | 319 | *BITMAP_ADDR16(bitmap, vc4000_video.line, This->data->x1 + i + j*This->size) = |
| 320 | | machine->pens[This->scolor]; |
| 320 | This->scolor; |
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | } |
| r2201 | r2202 | |
| 373 | 373 | for (i=0; i<This->size; i++) |
| 374 | 374 | { |
| 375 | 375 | *BITMAP_ADDR16(bitmap, vc4000_video.line, This->data->x2 + i + j*This->size) = |
| 376 | | machine->pens[This->scolor]; |
| 376 | This->scolor; |
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | } |
| r2201 | r2202 | |
| 401 | 401 | |
| 402 | 402 | if (vc4000_video.line>=height) return; |
| 403 | 403 | |
| 404 | | plot_box(vc4000_video.bitmap, 0, vc4000_video.line, width, 1, machine->pens[(vc4000_video.reg.d.background)&7]); |
| 404 | plot_box(vc4000_video.bitmap, 0, vc4000_video.line, width, 1, (vc4000_video.reg.d.background)&7); |
| 405 | 405 | |
| 406 | 406 | if (line<0 || line>=200) return; |
| 407 | 407 | if (!vc4000_video.reg.d.background&8) return; |
| r2201 | r2202 | |
| 441 | 441 | for (l=0; l<w; l++) { |
| 442 | 442 | collision[x+l]|=0x10; |
| 443 | 443 | } |
| 444 | | plot_box(vc4000_video.bitmap, x, vc4000_video.line, w, 1, machine->pens[(vc4000_video.reg.d.background>>4)&7]); |
| 444 | plot_box(vc4000_video.bitmap, x, vc4000_video.line, w, 1, (vc4000_video.reg.d.background>>4)&7); |
| 445 | 445 | } |
| 446 | 446 | if (j==7) m=0x100; |
| 447 | 447 | } |
| r2201 | r2202 | |
| 468 | 468 | { |
| 469 | 469 | vc4000_draw_grid(machine, collision); |
| 470 | 470 | |
| 471 | | vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[0]); |
| 472 | | vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[1]); |
| 473 | | vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[2]); |
| 474 | | vc4000_sprite_update(machine, vc4000_video.bitmap, collision, &vc4000_video.sprites[3]); |
| 471 | vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[0]); |
| 472 | vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[1]); |
| 473 | vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[2]); |
| 474 | vc4000_sprite_update(vc4000_video.bitmap, collision, &vc4000_video.sprites[3]); |
| 475 | 475 | |
| 476 | 476 | for (i=0; i<256; i++) |
| 477 | 477 | { |
| r2201 | r2202 | |
| 484 | 484 | if ((vc4000_video.line>=y)&&(vc4000_video.line<y+20)) |
| 485 | 485 | { |
| 486 | 486 | x = 58; |
| 487 | | vc4000_draw_digit(machine, vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[0]>>4, vc4000_video.line-y); |
| 488 | | vc4000_draw_digit(machine, vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[0]&0xf, vc4000_video.line-y); |
| 487 | vc4000_draw_digit(vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[0]>>4, vc4000_video.line-y); |
| 488 | vc4000_draw_digit(vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[0]&0xf, vc4000_video.line-y); |
| 489 | 489 | x = 106; |
| 490 | 490 | if (vc4000_video.reg.d.score_control&2) |
| 491 | 491 | x += 16; |
| 492 | | vc4000_draw_digit(machine, vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[1]>>4, vc4000_video.line-y); |
| 493 | | vc4000_draw_digit(machine, vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[1]&0xf, vc4000_video.line-y); |
| 492 | vc4000_draw_digit(vc4000_video.bitmap, x, y, vc4000_video.reg.d.bcd[1]>>4, vc4000_video.line-y); |
| 493 | vc4000_draw_digit(vc4000_video.bitmap, x+16, y, vc4000_video.reg.d.bcd[1]&0xf, vc4000_video.line-y); |
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | 496 | if (vc4000_video.line==269) vc4000_video.reg.d.sprite_collision |=0x40; |