src/mess/drivers/scv.c
| r15512 | r15513 | |
| 424 | 424 | |
| 425 | 425 | INLINE void plot_sprite_part( bitmap_ind16 &bitmap, UINT8 x, UINT8 y, UINT8 pat, UINT8 col ) |
| 426 | 426 | { |
| 427 | if ( x < 4 ) |
| 428 | { |
| 429 | return; |
| 430 | } |
| 431 | |
| 432 | x -= 4; |
| 433 | |
| 427 | 434 | if ( pat & 0x08 ) |
| 428 | | bitmap.pix16(y, x ) = col; |
| 435 | { |
| 436 | bitmap.pix16(y + 2, x ) = col; |
| 437 | } |
| 429 | 438 | if ( pat & 0x04 && x < 255 ) |
| 430 | | bitmap.pix16(y, x + 1 ) = col; |
| 439 | { |
| 440 | bitmap.pix16(y + 2, x + 1 ) = col; |
| 441 | } |
| 431 | 442 | if ( pat & 0x02 && x < 254 ) |
| 432 | | bitmap.pix16(y, x + 2 ) = col; |
| 443 | { |
| 444 | bitmap.pix16(y + 2, x + 2 ) = col; |
| 445 | } |
| 433 | 446 | if ( pat & 0x01 && x < 253 ) |
| 434 | | bitmap.pix16(y, x + 3 ) = col; |
| 447 | { |
| 448 | bitmap.pix16(y + 2, x + 3 ) = col; |
| 449 | } |
| 435 | 450 | } |
| 436 | 451 | |
| 437 | 452 | |
| r15512 | r15513 | |
| 565 | 580 | int text_y = 0; |
| 566 | 581 | |
| 567 | 582 | if ( y < clip_y ) |
| 583 | { |
| 568 | 584 | text_y = ( state->m_videoram[0x1400] & 0x80 ) ? 0 : 1; |
| 585 | } |
| 569 | 586 | else |
| 587 | { |
| 570 | 588 | text_y = ( state->m_videoram[0x1400] & 0x80 ) ? 1 : 0; |
| 589 | } |
| 571 | 590 | |
| 572 | 591 | for ( x = 0; x < 32; x++ ) |
| 573 | 592 | { |
| r15512 | r15513 | |
| 575 | 594 | UINT8 d = state->m_videoram[ 0x1000 + y * 32 + x ]; |
| 576 | 595 | |
| 577 | 596 | if ( x < clip_x ) |
| 597 | { |
| 578 | 598 | text_x = ( state->m_videoram[0x1400] & 0x40 ) ? 0 : 1; |
| 599 | } |
| 579 | 600 | else |
| 601 | { |
| 580 | 602 | text_x = ( state->m_videoram[0x1400] & 0x40 ) ? 1 : 0; |
| 603 | } |
| 581 | 604 | |
| 582 | 605 | if ( text_x && text_y ) |
| 583 | 606 | { |
| r15512 | r15513 | |
| 599 | 622 | draw_semi_graph( bitmap, x * 8 , y * 16 + 12, d & 0x02, gr_fg ); |
| 600 | 623 | draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 12, d & 0x01, gr_fg ); |
| 601 | 624 | break; |
| 625 | |
| 602 | 626 | case 0x03: /* Block graphics mode */ |
| 603 | 627 | draw_block_graph( bitmap, x * 8, y * 16 , d >> 4 ); |
| 604 | 628 | draw_block_graph( bitmap, x * 8, y * 16 + 8, d & 0x0f ); |
| 605 | 629 | break; |
| 630 | |
| 606 | 631 | default: /* Otherwise draw nothing? */ |
| 607 | 632 | break; |
| 608 | 633 | } |
| r15512 | r15513 | |
| 631 | 656 | UINT8 bottom = 1; |
| 632 | 657 | |
| 633 | 658 | if ( !col ) |
| 659 | { |
| 634 | 660 | continue; |
| 661 | } |
| 635 | 662 | |
| 636 | 663 | if ( !spr_y ) |
| 664 | { |
| 637 | 665 | continue; |
| 666 | } |
| 638 | 667 | |
| 639 | 668 | if ( half ) |
| 640 | 669 | { |
| r15512 | r15513 | |
| 674 | 703 | draw_sprite( state, bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip ); |
| 675 | 704 | if ( x_32 || y_32 ) |
| 676 | 705 | { |
| 677 | | static const UINT8 spr_2col_lut0[16] = { 0, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 1, 1 }; |
| 678 | | static const UINT8 spr_2col_lut1[16] = { 0, 1, 8, 11, 2, 3, 10, 9, 4, 5, 12, 13, 6, 7, 14, 15 }; |
| 706 | static const UINT8 spr_2col_lut0[16] = { 0, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 1, 1 }; |
| 707 | static const UINT8 spr_2col_lut1[16] = { 0, 1, 8, 11, 2, 3, 10, 9, 4, 5, 12, 13, 6, 7, 14, 15 }; |
| 679 | 708 | |
| 680 | 709 | draw_sprite( state, bitmap, spr_x, spr_y, tile_idx + 8 * x_32 + y_32, ( i & 0x40 ) ? spr_2col_lut1[col] : spr_2col_lut0[col], left, right, top, bottom, clip ); |
| 681 | 710 | } |
| r15512 | r15513 | |
| 685 | 714 | /* regular sprite handling */ |
| 686 | 715 | draw_sprite( state, bitmap, spr_x, spr_y, tile_idx, col, left, right, top, bottom, clip ); |
| 687 | 716 | if ( x_32 ) |
| 688 | | draw_sprite( state, bitmap, spr_x + 16, spr_y, tile_idx + 8, col, 1, 1, top, bottom, clip ); |
| 717 | { |
| 718 | draw_sprite( state, bitmap, spr_x + 16, spr_y, tile_idx | 8, col, 1, 1, top, bottom, clip ); |
| 719 | } |
| 689 | 720 | |
| 690 | 721 | if ( y_32 ) |
| 691 | 722 | { |
| 692 | 723 | clip &= 0x07; |
| 693 | | draw_sprite( state, bitmap, spr_x, spr_y + 16, tile_idx + 1, col, left, right, 1, 1, clip ); |
| 724 | draw_sprite( state, bitmap, spr_x, spr_y + 16, tile_idx | 1, col, left, right, 1, 1, clip ); |
| 694 | 725 | if ( x_32 ) |
| 695 | | draw_sprite( state, bitmap, spr_x + 16, spr_y + 16, tile_idx + 9, col, 1, 1, 1, 1, clip ); |
| 726 | { |
| 727 | draw_sprite( state, bitmap, spr_x + 16, spr_y + 16, tile_idx | 9, col, 1, 1, 1, 1, clip ); |
| 728 | } |
| 696 | 729 | } |
| 697 | 730 | } |
| 698 | 731 | } |
| r15512 | r15513 | |
| 759 | 792 | |
| 760 | 793 | /* Video chip is EPOCH TV-1 */ |
| 761 | 794 | MCFG_SCREEN_ADD( "screen", RASTER ) |
| 762 | | MCFG_SCREEN_RAW_PARAMS( XTAL_14_31818MHz/2, 456, 17, 209, 262, 0, 240 ) /* TODO: Verify */ |
| 795 | MCFG_SCREEN_RAW_PARAMS( XTAL_14_31818MHz/2, 456, 24, 24+192, 262, 23, 23+222 ) /* TODO: Verify */ |
| 763 | 796 | MCFG_SCREEN_UPDATE_STATIC( scv ) |
| 764 | 797 | |
| 765 | 798 | MCFG_GFXDECODE(scv) |
| r15512 | r15513 | |
| 796 | 829 | |
| 797 | 830 | /* Video chip is EPOCH TV-1A */ |
| 798 | 831 | MCFG_SCREEN_ADD( "screen", RASTER ) |
| 799 | | MCFG_SCREEN_RAW_PARAMS( XTAL_13_4MHz/2, 456, 17, 209, 342, 0, 256 ) /* TODO: Verify */ |
| 832 | MCFG_SCREEN_RAW_PARAMS( XTAL_13_4MHz/2, 456, 24, 24+192, 342, 23, 23+222 ) /* TODO: Verify */ |
| 800 | 833 | MCFG_SCREEN_UPDATE_STATIC( scv ) |
| 801 | 834 | |
| 802 | 835 | MCFG_GFXDECODE(scv) |