Previous 15994 Revisions Next

r5550 Monday 31st August, 2009 at 20:02:33 UTC by Angelo Salese
[X1]: Added basic PCG offset index catching, games that uses the PCG should now have better gfxs
[src/mess/drivers]x1.c

src/mess/drivers/x1.c
r5549r5550
561561   //   fatalerror("Data written to the DMA space");
562562}
563563
564/* TODO: still not yet perfect */
565static UINT16 check_pcg_addr(running_machine *machine)
566{
567   if(colorram[0x7ff] & 0x20) return 0x7ff;
568   if(colorram[0x3ff] & 0x20) return 0x3ff;
569   if(colorram[0x5ff] & 0x20) return 0x5ff;
570   if(colorram[0x1ff] & 0x20) return 0x1ff;
571
572   return 0x3ff;
573}
574
564575static WRITE8_HANDLER( x1_pcg_w )
565576{
566577   int addr,pcg_offset;
567578   UINT8 *PCG_RAM = memory_region(space->machine, "pcg");
579   static UINT16 used_pcg_addr;
568580
569581   addr = (offset & 0x300) >> 8;
570582
r5549r5550
586598   {
587599//      if(!ply_reg.pcg_mode)
588600//      {
589         //( ((V_CNT-CRT_YL)/FNT_YL) + TXT_YL) * TXT_XL
590//         int v_count = video_screen_get_vpos(space->machine->primary_screen);
591601//
592602//      }
593603//      else
594604      {
595         pcg_offset = (pcg_index[addr-1]) & 0x7ff;
605         used_pcg_addr = videoram[check_pcg_addr(space->machine)]*8;
606         pcg_offset = (pcg_index[addr-1]+used_pcg_addr) & 0x7ff;
596607         pcg_offset+=((addr-1)*0x800);
597608         PCG_RAM[pcg_offset] = data;
598609
r5549r5550
604615          gfx_element_mark_dirty(space->machine->gfx[7], pcg_offset >> 3);
605616
606617           pcg_index[addr-1]++;
618           pcg_index[addr-1]&=7;
607619      }
608620   }
609621}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team