Previous 15994 Revisions Next

r10108 Wednesday 19th January, 2011 at 20:23:22 UTC by Angelo Salese
[PC-8801]: Implemented kanji drawing
[src/mess/drivers]pc8801.c

src/mess/drivers/pc8801.c
r10107r10108
2525   - Bouken Roman
2626   - Bruce Lee
2727   - Castle Excellent
28   - Tobira wo Akete (in parent pc8801 only)
2829
2930   per-game specific TODO:
3031   - 100 Yen disk(s): reads kanji ports;
r10107r10108
668669   }
669670   else if(offset >= 0x8000 && offset <= 0x83ff) // work RAM window
670671   {
672      static UINT32 window_offset;
673
671674      if(gfx_ctrl & 6) //wram read select or n basic select banks this as normal wram
672675         return pc8801_wram_r(space,offset);
673676
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);
675686   }
676687   else if(offset >= 0x8400 && offset <= 0xbfff)
677688   {
r10107r10108
716727      if(gfx_ctrl & 6) //wram read select or n basic select banks this as normal wram
717728         pc8801_wram_w(space,offset,data);
718729      else
719         pc8801_wram_w(space,(offset & 0x3ff) + (window_offset_bank << 8),data);
730      {
731         static UINT32 window_offset;
720732
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
721744      return;
722745   }
723746   else if(offset >= 0x8400 && offset <= 0xbfff)
r10107r10108
10891112   txt_color = data & 2;
10901113}
10911114
1115static UINT32 knj_addr[2];
1116
1117static 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
1126static 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
1132static 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
1141static 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
10921147static ADDRESS_MAP_START( pc8801_io, ADDRESS_SPACE_IO, 8 )
10931148   ADDRESS_MAP_GLOBAL_MASK(0xff)
10941149   ADDRESS_MAP_UNMAP_HIGH
r10107r10108
11471202   AM_RANGE(0xe4, 0xe4) AM_WRITE(pc8801_irq_level_w)
11481203   AM_RANGE(0xe6, 0xe6) AM_WRITE(pc8801_irq_mask_w)
11491204//  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)
11521207//  AM_RANGE(0xf0, 0xf1) AM_NOP                                     /* Kana to Kanji dictionary ROM select (not yet) */
11531208//  AM_RANGE(0xf3, 0xf3) AM_NOP                                     /* DMA floppy (unknown) */
11541209//  AM_RANGE(0xf4, 0xf7) AM_NOP                                     /* DMA 5'floppy (may be not released) */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team