Previous 199869 Revisions Next

r19471 Tuesday 11th December, 2012 at 15:19:44 UTC by Angelo Salese
Merged kanji and PCG hook-ups
[src/mess/drivers]pc9801.c

trunk/src/mess/drivers/pc9801.c
r19470r19471
4444
4545   List of per-game TODO:
4646   - 4D Boxing: inputs are unresponsive
47   (A Midsummer ...)
4748   - Absolutely Mahjong: Kanji data doesn't appear at the Epson logo. Transitions are too fast.
4849   - Brandish 2: Intro needs some window masking effects;
4950   - Dragon Buster: missing bitplanes for the PCG (or not?), slight issue with window masking;
r19470r19471
312313   UINT8 *m_ext_work_ram;
313314   UINT8 *m_char_rom;
314315   UINT8 *m_kanji_rom;
315   UINT8 *m_pcg_ram;
316316
317317   UINT8 m_portb_tmp;
318318   UINT8 m_dma_offset[4];
r19470r19471
579579   // find memory regions
580580   m_char_rom = memregion("chargen")->base();
581581   m_kanji_rom = memregion("kanji")->base();
582
583   m_pcg_ram = auto_alloc_array(machine(), UINT8, 0x200000);
584
585   state_save_register_global_pointer(machine(), m_pcg_ram, 0x200000);
586582}
587583
588584UINT32 pc9801_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
r19470r19471
663659   UINT8 char_size;
664660//  UINT8 interlace_on;
665661   UINT16 tile;
666   UINT8 pcg_sel, pcg_lr;
662   UINT8 kanji_lr;
667663   UINT8 kanji_sel;
668664
669665   if(state->m_video_ff[DISPLAY_REG] == 0) //screen is off
r19470r19471
684680
685681      tile_addr = addr+(x*(state->m_video_ff[WIDTH40_REG]+1));
686682
687      pcg_sel = 0;
688683      kanji_sel = 0;
689      pcg_lr = 0;
684      kanji_lr = 0;
690685
691686      tile = state->m_video_ram_1[(tile_addr*2) & 0x1fff] & 0xff;
692687      knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0xff;
693      if((tile == 0x56 || tile == 0x57) && knj_tile)
688      if(knj_tile)
694689      {
695         pcg_sel = 1;
696         tile = knj_tile & 0x7f;
697         pcg_lr = (knj_tile & 0x80) >> 7;
698      }
699      else if(knj_tile) // kanji select, TODO
700      {
701         pcg_lr = (knj_tile & 0x80) >> 7;
702         pcg_lr |= (tile & 0x80) >> 7; // Tokimeki Sports Gal 3
690         kanji_lr = (knj_tile & 0x80) >> 7;
691         kanji_lr |= (tile & 0x80) >> 7; // Tokimeki Sports Gal 3
703692         tile &= 0x7f;
704693         tile <<= 8;
705694         tile |= (knj_tile & 0x7f);
706         /* annoying kanji bit-swap applied on the address bus ... */
707//         tile = BITSWAP16(tile,15,7,14,13,12,11,6,5,10,9,8,4,3,2,1,0);
708//         tile&=0x7fff;
709695         kanji_sel = 1;
710696      }
711697      attr = (state->m_video_ram_1[(tile_addr*2 & 0x1fff) | 0x2000] & 0xff);
r19470r19471
758744                  tile_data = ((tile >> gfx_bit) & 1) ? 0xff : 0x00;
759745               }
760746               else if(kanji_sel)
761                  tile_data = (state->m_kanji_rom[tile*0x20+yi*2+pcg_lr]);
762               else if(pcg_sel)
763                  tile_data = (state->m_pcg_ram[0xac000+tile*0x20+yi*2+pcg_lr]);
747                  tile_data = (state->m_kanji_rom[tile*0x20+yi*2+kanji_lr]);
764748               else
765749                  tile_data = (state->m_char_rom[tile*char_size+state->m_video_ff[FONTSEL_REG]*0x800+yi]);
766750            }
r19470r19471
774758
775759            if(yi >= char_size)
776760               pen = 0;
777            else if(pcg_sel)
778            {
779               pen = 0;
780               if(color & 1) pen |= ((tile_data >> (7-xi) & 1) ? 1 : 0);
781               if(color & 2) pen |= ((tile_data >> (7-xi) & 1) ? 2 : 0);
782               if(color & 4) pen |= ((tile_data >> (7-xi) & 1) ? 4 : 0);
783            }
784761            else
785762               pen = (tile_data >> (7-xi) & 1) ? color : 0;
786763
r19470r19471
12311208            pcg_offset = m_font_addr << 5;
12321209            pcg_offset|= m_font_line;
12331210            pcg_offset|= m_font_lr;
1234            if((m_font_addr & 0xff00) == 0x5600 || (m_font_addr & 0xff00) == 0x5700)
1235            {
1236               return m_pcg_ram[pcg_offset];
1237            }
12381211
12391212            /* TODO: Brandish 2 accesses a 0008a561 kanji address, obviously causing a crash. */
12401213//            if(pcg_offset >= 0x80000)
r19470r19471
13141287            //printf("%04x %02x %02x %08x\n",m_font_addr,m_font_line,m_font_lr,pcg_offset);
13151288            if((m_font_addr & 0xff00) == 0x5600 || (m_font_addr & 0xff00) == 0x5700)
13161289            {
1317               m_pcg_ram[pcg_offset] = data;
1290               m_kanji_rom[pcg_offset] = data;
1291               machine().gfx[2]->mark_dirty(pcg_offset >> 5);
13181292            }
13191293            return;
13201294         }
r19470r19471
16381612   pcg_offset|= offset & 0x1e;
16391613   pcg_offset|= m_font_lr;
16401614
1615   /* TODO: investigate on this difference */
16411616   if((m_font_addr & 0xff00) == 0x5600 || (m_font_addr & 0xff00) == 0x5700)
1642      return m_pcg_ram[pcg_offset];
1617      return m_kanji_rom[pcg_offset];
16431618
16441619   pcg_offset = m_font_addr << 5;
16451620   pcg_offset|= offset & 0x1f;
r19470r19471
16571632   pcg_offset|= m_font_lr;
16581633
16591634   if((m_font_addr & 0xff00) == 0x5600 || (m_font_addr & 0xff00) == 0x5700)
1660      m_pcg_ram[pcg_offset] = data;
1635   {
1636      m_kanji_rom[pcg_offset] = data;
1637      machine().gfx[2]->mark_dirty(pcg_offset >> 5);
1638   }
16611639}
16621640
16631641/* FF-based */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team