Previous 15994 Revisions Next

r10491 Friday 18th February, 2011 at 02:50:31 UTC by Angelo Salese
[UPD7220]: Implemented basic WDAT command
[src/mess/video]upd7220.c

src/mess/video/upd7220.c
r10490r10491
465465}
466466
467467/*-------------------------------------------------
468    write_vram - write in the device memory space
469-------------------------------------------------*/
470
471static void write_vram(upd7220_t *upd7220,UINT8 type, UINT8 mod)
472{
473   if(type == 1)
474   {
475      logerror("uPD7220 invalid type 1 WDAT parameter\n");
476      return;
477   }
478
479   switch(mod & 3)
480   {
481      case 0x00: //replace
482         switch(type)
483         {
484            case 0: upd7220->vram[upd7220->ead] = ((upd7220->pr[1]) | (upd7220->pr[2] << 8)) & upd7220->mask; break;
485            case 2:   upd7220->vram[upd7220->ead] = (((upd7220->pr[1] & upd7220->mask) & 0xff) | (upd7220->vram[upd7220->ead] & 0xff00)); break;
486            case 3: upd7220->vram[upd7220->ead] = (((upd7220->pr[1] & upd7220->mask) << 8) | (upd7220->vram[upd7220->ead] & 0x00ff)); break;
487         }
488         break;
489      case 0x01: //complement
490         break;
491      case 0x02: //reset to zero
492         break;
493      case 0x03: //set to one
494         break;
495   }
496}
497
498/*-------------------------------------------------
468499    advance_ead - advance EAD pointer
469500-------------------------------------------------*/
470501
r10490r10491
782813      break;
783814
784815   case COMMAND_WDAT: /* write data into display memory */
785      logerror("uPD7220 '%s' Unimplemented command WDAT\n", device->tag());
786      if (upd7220->param_ptr == 3)
816      if (upd7220->param_ptr == 3 || (upd7220->param_ptr == 2 && upd7220->cr & 0x10))
787817      {
788         printf("%02x %02x (%c) %04x\n",upd7220->pr[2],upd7220->pr[1],upd7220->pr[1],EAD);
818         //printf("%02x = %02x %02x (%c) %04x\n",upd7220->cr,upd7220->pr[2],upd7220->pr[1],upd7220->pr[1],EAD);
789819
790         upd7220->vram[1] = 0x1234;
820         write_vram(upd7220,(upd7220->cr & 0x18) >> 3,upd7220->cr & 3);
791821         advance_ead(upd7220);
792822      }
793823      break;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team