Previous 199869 Revisions Next

r19495 Wednesday 12th December, 2012 at 15:08:04 UTC by Angelo Salese
Hopefully fixed for good the Kanji lr bugs
[src/mess/drivers]pc9801.c

trunk/src/mess/drivers/pc9801.c
r19494r19495
5252   - Agumix Selects!: needs GDC = 5 MHz, interlace doesn't work properly;
5353   - Aki no Tsukasa no Fushigi no Kabe: moans with a kanji error
5454      "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;
5655   - 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;
5857   - Anniversary - Memories of Summer: thinks that a button is pressed, has window masking bugs during intro;
5958   - Another Genesis: fails loading;
60   - Apple Club 1: how to pass?
59   - Apple Club 1: how to pass an hand?
6160   (Applesauce Pirates)
6261
6362   - Brandish 2: Intro needs some window masking effects;
r19494r19495
694693   UINT16 tile;
695694   UINT8 kanji_lr;
696695   UINT8 kanji_sel;
696   UINT8 x_step;
697697
698698   if(state->m_video_ff[DISPLAY_REG] == 0) //screen is off
699699      return;
r19494r19495
702702   char_size = state->m_video_ff[FONTSEL_REG] ? 16 : 8;
703703   tile = 0;
704704
705   for(x=0;x<pitch;x++)
705   for(x=0;x<pitch;x+=x_step)
706706   {
707707      UINT8 tile_data,secret,reverse,u_line,v_line;
708708      UINT8 color;
r19494r19495
721721      knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0xff;
722722      if(knj_tile)
723723      {
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
726729         tile &= 0x7f;
727730         tile <<= 8;
728731         tile |= (knj_tile & 0x7f);
729732         kanji_sel = 1;
733         x_step = 2;
734//         kanji_lr = 0;
730735      }
736      else
737         x_step = 1;
738
731739      attr = (state->m_video_ram_1[(tile_addr*2 & 0x1fff) | 0x2000] & 0xff);
732740
733741      secret = (attr & 1) ^ 1;
r19494r19495
738746      gfx_mode = (state->m_video_ff[ATTRSEL_REG]) ? attr & 0x10 : 0;
739747      color = (attr & 0xe0) >> 5;
740748
741      for(yi=0;yi<lr;yi++)
749      for(kanji_lr=0;kanji_lr<x_step;kanji_lr++)
742750      {
743         for(xi=0;xi<8;xi++)
751         for(yi=0;yi<lr;yi++)
744752         {
745            int res_x,res_y;
753            for(xi=0;xi<8;xi++)
754            {
755               int res_x,res_y;
746756
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);
749759
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;
752762
753            tile_data = 0;
763               tile_data = 0;
754764
755            if(!secret)
756            {
757               /* TODO: priority */
758               if(gfx_mode)
765               if(!secret)
759766               {
760                  int gfx_bit;
761                  tile_data = 0;
767                  /* TODO: priority */
768                  if(gfx_mode)
769                  {
770                     int gfx_bit;
771                     tile_data = 0;
762772
763                  /*
764                     gfx strip mode:
773                     /*
774                        gfx strip mode:
765775
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                     */
773783
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));
777787
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]);
779794               }
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            }
785795
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; }
789799
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;
792802
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;
797807
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];
800810
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;
805815
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               }
808819            }
809820         }
810821      }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team