src/mess/drivers/pc8801.c
| r10107 | r10108 | |
| 25 | 25 | - Bouken Roman |
| 26 | 26 | - Bruce Lee |
| 27 | 27 | - Castle Excellent |
| 28 | - Tobira wo Akete (in parent pc8801 only) |
| 28 | 29 | |
| 29 | 30 | per-game specific TODO: |
| 30 | 31 | - 100 Yen disk(s): reads kanji ports; |
| r10107 | r10108 | |
| 668 | 669 | } |
| 669 | 670 | else if(offset >= 0x8000 && offset <= 0x83ff) // work RAM window |
| 670 | 671 | { |
| 672 | static UINT32 window_offset; |
| 673 | |
| 671 | 674 | if(gfx_ctrl & 6) //wram read select or n basic select banks this as normal wram |
| 672 | 675 | return pc8801_wram_r(space,offset); |
| 673 | 676 | |
| 674 | | return pc8801_wram_r(space,(offset & 0x3ff) + (window_offset_bank << 8)); |
| 677 | window_offset = (offset & 0x3ff) + (window_offset_bank << 8); |
| 678 | |
| 679 | if((window_offset & 0xf000) == 0xf000) |
| 680 | printf("Read from 0xf000 - 0xffff window offset\n"); |
| 681 | |
| 682 | if(((window_offset & 0xf000) == 0xf000) && (misc_ctrl & 0x10)) |
| 683 | return pc8801_high_wram_r(space,window_offset & 0xfff); |
| 684 | |
| 685 | return pc8801_wram_r(space,window_offset); |
| 675 | 686 | } |
| 676 | 687 | else if(offset >= 0x8400 && offset <= 0xbfff) |
| 677 | 688 | { |
| r10107 | r10108 | |
| 716 | 727 | if(gfx_ctrl & 6) //wram read select or n basic select banks this as normal wram |
| 717 | 728 | pc8801_wram_w(space,offset,data); |
| 718 | 729 | else |
| 719 | | pc8801_wram_w(space,(offset & 0x3ff) + (window_offset_bank << 8),data); |
| 730 | { |
| 731 | static UINT32 window_offset; |
| 720 | 732 | |
| 733 | window_offset = (offset & 0x3ff) + (window_offset_bank << 8); |
| 734 | |
| 735 | if((window_offset & 0xf000) == 0xf000) |
| 736 | printf("Read from 0xf000 - 0xffff window offset\n"); |
| 737 | |
| 738 | if(((window_offset & 0xf000) == 0xf000) && (misc_ctrl & 0x10)) |
| 739 | pc8801_high_wram_w(space,window_offset & 0xfff,data); |
| 740 | else |
| 741 | pc8801_wram_w(space,window_offset,data); |
| 742 | } |
| 743 | |
| 721 | 744 | return; |
| 722 | 745 | } |
| 723 | 746 | else if(offset >= 0x8400 && offset <= 0xbfff) |
| r10107 | r10108 | |
| 1089 | 1112 | txt_color = data & 2; |
| 1090 | 1113 | } |
| 1091 | 1114 | |
| 1115 | static UINT32 knj_addr[2]; |
| 1116 | |
| 1117 | static READ8_HANDLER( pc8801_kanji_r ) |
| 1118 | { |
| 1119 | UINT8 *knj_rom = space->machine->region("kanji")->base(); |
| 1120 | if((offset & 2) == 0) |
| 1121 | return knj_rom[knj_addr[0]*2+((offset & 1) ^ 1)]; |
| 1122 | |
| 1123 | return 0xff; |
| 1124 | } |
| 1125 | |
| 1126 | static WRITE8_HANDLER( pc8801_kanji_w ) |
| 1127 | { |
| 1128 | if((offset & 2) == 0) |
| 1129 | knj_addr[0] = ((offset & 1) == 0) ? ((knj_addr[0]&0xff00)|(data&0xff)) : ((knj_addr[0]&0x00ff)|(data<<8)); |
| 1130 | } |
| 1131 | |
| 1132 | static READ8_HANDLER( pc8801_kanji_lv2_r ) |
| 1133 | { |
| 1134 | UINT8 *knj_rom = space->machine->region("kanji")->base() + 0x20000; |
| 1135 | if((offset & 2) == 0) |
| 1136 | return knj_rom[knj_addr[1]*2+((offset & 1) ^ 1)]; |
| 1137 | |
| 1138 | return 0xff; |
| 1139 | } |
| 1140 | |
| 1141 | static WRITE8_HANDLER( pc8801_kanji_lv2_w ) |
| 1142 | { |
| 1143 | if((offset & 2) == 0) |
| 1144 | knj_addr[1] = ((offset & 1) == 0) ? ((knj_addr[1]&0xff00)|(data&0xff)) : ((knj_addr[1]&0x00ff)|(data<<8)); |
| 1145 | } |
| 1146 | |
| 1092 | 1147 | static ADDRESS_MAP_START( pc8801_io, ADDRESS_SPACE_IO, 8 ) |
| 1093 | 1148 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1094 | 1149 | ADDRESS_MAP_UNMAP_HIGH |
| r10107 | r10108 | |
| 1147 | 1202 | AM_RANGE(0xe4, 0xe4) AM_WRITE(pc8801_irq_level_w) |
| 1148 | 1203 | AM_RANGE(0xe6, 0xe6) AM_WRITE(pc8801_irq_mask_w) |
| 1149 | 1204 | // AM_RANGE(0xe7, 0xe7) AM_NOP /* (unknown) */ |
| 1150 | | // AM_RANGE(0xe8, 0xeb) AM_READWRITE(pc88_kanji_r, pc88_kanji_w) |
| 1151 | | // AM_RANGE(0xec, 0xed) AM_READWRITE(pc88_kanji2_r, pc88_kanji2_w) /* JIS level2 Kanji ROM */ |
| 1205 | AM_RANGE(0xe8, 0xeb) AM_READWRITE(pc8801_kanji_r, pc8801_kanji_w) |
| 1206 | AM_RANGE(0xec, 0xef) AM_READWRITE(pc8801_kanji_lv2_r, pc8801_kanji_lv2_w) |
| 1152 | 1207 | // AM_RANGE(0xf0, 0xf1) AM_NOP /* Kana to Kanji dictionary ROM select (not yet) */ |
| 1153 | 1208 | // AM_RANGE(0xf3, 0xf3) AM_NOP /* DMA floppy (unknown) */ |
| 1154 | 1209 | // AM_RANGE(0xf4, 0xf7) AM_NOP /* DMA 5'floppy (may be not released) */ |