trunk/src/mess/drivers/pc9801.c
| r19494 | r19495 | |
| 52 | 52 | - Agumix Selects!: needs GDC = 5 MHz, interlace doesn't work properly; |
| 53 | 53 | - Aki no Tsukasa no Fushigi no Kabe: moans with a kanji error |
| 54 | 54 | "can't use (this) on a vanilla PC-9801, a PC-9801E nor a PC-9801U. Please turn off the computer and turn it on again." |
| 55 | | display of this kanji error is wrong on PC-9801RS; |
| 56 | 55 | - Alice no Yakata: wants a "DSW 1-8" on. |
| 57 | | - Animahjong V3: accesses port 0x88, tile selection pointer has a gfx clearance bug; |
| 56 | - Animahjong V3: accesses port 0x88; |
| 58 | 57 | - Anniversary - Memories of Summer: thinks that a button is pressed, has window masking bugs during intro; |
| 59 | 58 | - Another Genesis: fails loading; |
| 60 | | - Apple Club 1: how to pass? |
| 59 | - Apple Club 1: how to pass an hand? |
| 61 | 60 | (Applesauce Pirates) |
| 62 | 61 | |
| 63 | 62 | - Brandish 2: Intro needs some window masking effects; |
| r19494 | r19495 | |
| 694 | 693 | UINT16 tile; |
| 695 | 694 | UINT8 kanji_lr; |
| 696 | 695 | UINT8 kanji_sel; |
| 696 | UINT8 x_step; |
| 697 | 697 | |
| 698 | 698 | if(state->m_video_ff[DISPLAY_REG] == 0) //screen is off |
| 699 | 699 | return; |
| r19494 | r19495 | |
| 702 | 702 | char_size = state->m_video_ff[FONTSEL_REG] ? 16 : 8; |
| 703 | 703 | tile = 0; |
| 704 | 704 | |
| 705 | | for(x=0;x<pitch;x++) |
| 705 | for(x=0;x<pitch;x+=x_step) |
| 706 | 706 | { |
| 707 | 707 | UINT8 tile_data,secret,reverse,u_line,v_line; |
| 708 | 708 | UINT8 color; |
| r19494 | r19495 | |
| 721 | 721 | knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0xff; |
| 722 | 722 | if(knj_tile) |
| 723 | 723 | { |
| 724 | | kanji_lr = (knj_tile & 0x80) >> 7; |
| 725 | | kanji_lr |= (tile & 0x80) >> 7; // Tokimeki Sports Gal 3 |
| 724 | /* Note: lr doesn't really count, if a kanji is enabled then the successive tile is always the second part of it. |
| 725 | Trusted with Alice no Yakata, Animahjong V3, Aki no Tsukasa no Fushigi no Kabe, Apros ... |
| 726 | */ |
| 727 | //kanji_lr = (knj_tile & 0x80) >> 7; |
| 728 | //kanji_lr |= (tile & 0x80) >> 7; // Tokimeki Sports Gal 3 |
| 726 | 729 | tile &= 0x7f; |
| 727 | 730 | tile <<= 8; |
| 728 | 731 | tile |= (knj_tile & 0x7f); |
| 729 | 732 | kanji_sel = 1; |
| 733 | x_step = 2; |
| 734 | // kanji_lr = 0; |
| 730 | 735 | } |
| 736 | else |
| 737 | x_step = 1; |
| 738 | |
| 731 | 739 | attr = (state->m_video_ram_1[(tile_addr*2 & 0x1fff) | 0x2000] & 0xff); |
| 732 | 740 | |
| 733 | 741 | secret = (attr & 1) ^ 1; |
| r19494 | r19495 | |
| 738 | 746 | gfx_mode = (state->m_video_ff[ATTRSEL_REG]) ? attr & 0x10 : 0; |
| 739 | 747 | color = (attr & 0xe0) >> 5; |
| 740 | 748 | |
| 741 | | for(yi=0;yi<lr;yi++) |
| 749 | for(kanji_lr=0;kanji_lr<x_step;kanji_lr++) |
| 742 | 750 | { |
| 743 | | for(xi=0;xi<8;xi++) |
| 751 | for(yi=0;yi<lr;yi++) |
| 744 | 752 | { |
| 745 | | int res_x,res_y; |
| 753 | for(xi=0;xi<8;xi++) |
| 754 | { |
| 755 | int res_x,res_y; |
| 746 | 756 | |
| 747 | | res_x = (x*8+xi) * (state->m_video_ff[WIDTH40_REG]+1); |
| 748 | | res_y = y*lr+yi - (state->m_txt_scroll_reg[3] & 0xf); |
| 757 | res_x = ((x+kanji_lr)*8+xi) * (state->m_video_ff[WIDTH40_REG]+1); |
| 758 | res_y = y*lr+yi - (state->m_txt_scroll_reg[3] & 0xf); |
| 749 | 759 | |
| 750 | | if(!device->machine().primary_screen->visible_area().contains(res_x, res_y)) |
| 751 | | continue; |
| 760 | if(!device->machine().primary_screen->visible_area().contains(res_x, res_y)) |
| 761 | continue; |
| 752 | 762 | |
| 753 | | tile_data = 0; |
| 763 | tile_data = 0; |
| 754 | 764 | |
| 755 | | if(!secret) |
| 756 | | { |
| 757 | | /* TODO: priority */ |
| 758 | | if(gfx_mode) |
| 765 | if(!secret) |
| 759 | 766 | { |
| 760 | | int gfx_bit; |
| 761 | | tile_data = 0; |
| 767 | /* TODO: priority */ |
| 768 | if(gfx_mode) |
| 769 | { |
| 770 | int gfx_bit; |
| 771 | tile_data = 0; |
| 762 | 772 | |
| 763 | | /* |
| 764 | | gfx strip mode: |
| 773 | /* |
| 774 | gfx strip mode: |
| 765 | 775 | |
| 766 | | number refers to the bit number in the tile data. |
| 767 | | This mode is identical to the one seen in PC-8801 |
| 768 | | 00004444 |
| 769 | | 11115555 |
| 770 | | 22226666 |
| 771 | | 33337777 |
| 772 | | */ |
| 776 | number refers to the bit number in the tile data. |
| 777 | This mode is identical to the one seen in PC-8801 |
| 778 | 00004444 |
| 779 | 11115555 |
| 780 | 22226666 |
| 781 | 33337777 |
| 782 | */ |
| 773 | 783 | |
| 774 | | gfx_bit = (xi & 4); |
| 775 | | gfx_bit+= (yi & (2 << (char_size == 16)))>>(1+(char_size == 16)); |
| 776 | | gfx_bit+= (yi & (4 << (char_size == 16)))>>(1+(char_size == 16)); |
| 784 | gfx_bit = (xi & 4); |
| 785 | gfx_bit+= (yi & (2 << (char_size == 16)))>>(1+(char_size == 16)); |
| 786 | gfx_bit+= (yi & (4 << (char_size == 16)))>>(1+(char_size == 16)); |
| 777 | 787 | |
| 778 | | tile_data = ((tile >> gfx_bit) & 1) ? 0xff : 0x00; |
| 788 | tile_data = ((tile >> gfx_bit) & 1) ? 0xff : 0x00; |
| 789 | } |
| 790 | else if(kanji_sel) |
| 791 | tile_data = (state->m_kanji_rom[tile*0x20+yi*2+kanji_lr]); |
| 792 | else |
| 793 | tile_data = (state->m_char_rom[tile*char_size+state->m_video_ff[FONTSEL_REG]*0x800+yi]); |
| 779 | 794 | } |
| 780 | | else if(kanji_sel) |
| 781 | | tile_data = (state->m_kanji_rom[tile*0x20+yi*2+kanji_lr]); |
| 782 | | else |
| 783 | | tile_data = (state->m_char_rom[tile*char_size+state->m_video_ff[FONTSEL_REG]*0x800+yi]); |
| 784 | | } |
| 785 | 795 | |
| 786 | | if(reverse) { tile_data^=0xff; } |
| 787 | | if(u_line && yi == 7) { tile_data = 0xff; } |
| 788 | | if(v_line) { tile_data|=8; } |
| 796 | if(reverse) { tile_data^=0xff; } |
| 797 | if(u_line && yi == 7) { tile_data = 0xff; } |
| 798 | if(v_line) { tile_data|=8; } |
| 789 | 799 | |
| 790 | | if(cursor_on && cursor_addr == tile_addr && device->machine().primary_screen->frame_number() & 0x10) |
| 791 | | tile_data^=0xff; |
| 800 | if(cursor_on && cursor_addr == tile_addr && device->machine().primary_screen->frame_number() & 0x10) |
| 801 | tile_data^=0xff; |
| 792 | 802 | |
| 793 | | if(yi >= char_size) |
| 794 | | pen = -1; |
| 795 | | else |
| 796 | | pen = (tile_data >> (7-xi) & 1) ? color : -1; |
| 803 | if(yi >= char_size) |
| 804 | pen = -1; |
| 805 | else |
| 806 | pen = (tile_data >> (7-xi) & 1) ? color : -1; |
| 797 | 807 | |
| 798 | | if(pen != -1) |
| 799 | | bitmap.pix32(res_y, res_x) = palette[pen]; |
| 808 | if(pen != -1) |
| 809 | bitmap.pix32(res_y, res_x) = palette[pen]; |
| 800 | 810 | |
| 801 | | if(state->m_video_ff[WIDTH40_REG]) |
| 802 | | { |
| 803 | | if(!device->machine().primary_screen->visible_area().contains(res_x+1, res_y)) |
| 804 | | continue; |
| 811 | if(state->m_video_ff[WIDTH40_REG]) |
| 812 | { |
| 813 | if(!device->machine().primary_screen->visible_area().contains(res_x+1, res_y)) |
| 814 | continue; |
| 805 | 815 | |
| 806 | | if(pen != -1) |
| 807 | | bitmap.pix32(res_y, res_x+1) = palette[pen]; |
| 816 | if(pen != -1) |
| 817 | bitmap.pix32(res_y, res_x+1) = palette[pen]; |
| 818 | } |
| 808 | 819 | } |
| 809 | 820 | } |
| 810 | 821 | } |