Previous 199869 Revisions Next

r19789 Tuesday 25th December, 2012 at 01:22:17 UTC by Angelo Salese
Bulk replace of logging in uPD7220
[src/mess/video]upd7220.c

trunk/src/mess/video/upd7220.c
r19788r19789
4545//  MACROS / CONSTANTS
4646//**************************************************************************
4747
48#define LOG 1
48#define   VERBOSE         0
49#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
4950
5051
5152// todo typedef
r19788r19789
412413   visarea.max_x = m_aw * horiz_mult - 1;//horiz_pix_total - (m_hfp * 8) - 1;
413414   visarea.max_y = m_al - 1;//vert_pix_total - m_vfp - 1;
414415
415   if (LOG)
416   {
417      logerror("uPD7220 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
418      logerror("Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
419      logerror("%d %d %d %d %d\n",m_hs,m_hbp,m_aw,m_hfp,m_pitch);
420      logerror("%d %d %d %d\n",m_vs,m_vbp,m_al,m_vfp);
421   }
416   LOG(("uPD7220 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh)));
417   LOG(("Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y));
418   LOG(("%d %d %d %d %d\n",m_hs,m_hbp,m_aw,m_hfp,m_pitch));
419   LOG(("%d %d %d %d\n",m_vs,m_vbp,m_al,m_vfp));
422420
423421   if (m_m)
424422   {
r19788r19789
522520{
523521   if (type == 1)
524522   {
525      logerror("uPD7220 invalid type 1 RDAT parameter\n");
523      LOG (("uPD7220 invalid type 1 RDAT parameter\n"));
526524      return;
527525   }
528526
529527   if (mod)
530      logerror("uPD7220 RDAT used with mod = %02x?\n",mod);
528      LOG (("uPD7220 RDAT used with mod = %02x?\n",mod));
531529
532530   for (int i = 0; i < m_figs.m_dc; i++)
533531   {
r19788r19789
939937   UINT16 line_pattern;
940938   UINT8 dot;
941939
942   logerror("uPD7220 rectangle check: %d %d %02x %08x\n",x,y,m_figs.m_dir,m_ead);
940   LOG(("uPD7220 rectangle check: %d %d %02x %08x\n",x,y,m_figs.m_dir,m_ead));
943941
944942   line_pattern = check_pattern((m_ra[8]) | (m_ra[9]<<8));
945943   rect_type = (m_figs.m_dir & 1) << 2;
r19788r19789
11281126      switch (m_param_ptr)
11291127      {
11301128      case 0:
1131         if (LOG) logerror("uPD7220 '%s' RESET\n", tag());
1129         LOG(("uPD7220 '%s' RESET\n", tag()));
11321130
11331131         m_de = 0;
11341132         m_ra[0] = m_ra[1] = m_ra[2] = 0;
r19788r19789
11511149
11521150         m_pitch = m_aw;
11531151
1154         if (LOG)
1155         {
1156            logerror("uPD7220 '%s' Mode: %02x\n", tag(), m_mode);
1157            logerror("uPD7220 '%s' AW: %u\n", tag(), m_aw);
1158            logerror("uPD7220 '%s' HS: %u\n", tag(), m_hs);
1159            logerror("uPD7220 '%s' VS: %u\n", tag(), m_vs);
1160            logerror("uPD7220 '%s' HFP: %u\n", tag(), m_hfp);
1161            logerror("uPD7220 '%s' HBP: %u\n", tag(), m_hbp);
1162            logerror("uPD7220 '%s' VFP: %u\n", tag(), m_vfp);
1163            logerror("uPD7220 '%s' AL: %u\n", tag(), m_al);
1164            logerror("uPD7220 '%s' VBP: %u\n", tag(), m_vbp);
1165            logerror("uPD7220 '%s' PITCH: %u\n", tag(), m_pitch);
1166         }
1152         LOG(("uPD7220 '%s' Mode: %02x\n", tag(), m_mode));
1153         LOG(("uPD7220 '%s' AW: %u\n", tag(), m_aw));
1154         LOG(("uPD7220 '%s' HS: %u\n", tag(), m_hs));
1155         LOG(("uPD7220 '%s' VS: %u\n", tag(), m_vs));
1156         LOG(("uPD7220 '%s' HFP: %u\n", tag(), m_hfp));
1157         LOG(("uPD7220 '%s' HBP: %u\n", tag(), m_hbp));
1158         LOG(("uPD7220 '%s' VFP: %u\n", tag(), m_vfp));
1159         LOG(("uPD7220 '%s' AL: %u\n", tag(), m_al));
1160         LOG(("uPD7220 '%s' VBP: %u\n", tag(), m_vbp));
1161         LOG(("uPD7220 '%s' PITCH: %u\n", tag(), m_pitch));
11671162
11681163         recompute_parameters();
11691164         break;
r19788r19789
11851180
11861181         m_pitch = m_aw;
11871182
1188         if (LOG)
1189         {
1190            logerror("uPD7220 '%s' Mode: %02x\n", tag(), m_mode);
1191            logerror("uPD7220 '%s' AW: %u\n", tag(), m_aw);
1192            logerror("uPD7220 '%s' HS: %u\n", tag(), m_hs);
1193            logerror("uPD7220 '%s' VS: %u\n", tag(), m_vs);
1194            logerror("uPD7220 '%s' HFP: %u\n", tag(), m_hfp);
1195            logerror("uPD7220 '%s' HBP: %u\n", tag(), m_hbp);
1196            logerror("uPD7220 '%s' VFP: %u\n", tag(), m_vfp);
1197            logerror("uPD7220 '%s' AL: %u\n", tag(), m_al);
1198            logerror("uPD7220 '%s' VBP: %u\n", tag(), m_vbp);
1199            logerror("uPD7220 '%s' PITCH: %u\n", tag(), m_pitch);
1200         }
1183         LOG(("uPD7220 '%s' Mode: %02x\n", tag(), m_mode));
1184         LOG(("uPD7220 '%s' AW: %u\n", tag(), m_aw));
1185         LOG(("uPD7220 '%s' HS: %u\n", tag(), m_hs));
1186         LOG(("uPD7220 '%s' VS: %u\n", tag(), m_vs));
1187         LOG(("uPD7220 '%s' HFP: %u\n", tag(), m_hfp));
1188         LOG(("uPD7220 '%s' HBP: %u\n", tag(), m_hbp));
1189         LOG(("uPD7220 '%s' VFP: %u\n", tag(), m_vfp));
1190         LOG(("uPD7220 '%s' AL: %u\n", tag(), m_al));
1191         LOG(("uPD7220 '%s' VBP: %u\n", tag(), m_vbp));
1192         LOG(("uPD7220 '%s' PITCH: %u\n", tag(), m_pitch));
12011193
12021194         recompute_parameters();
12031195      }
r19788r19789
12061198   case COMMAND_VSYNC: /* vertical sync mode */
12071199      m_m = m_cr & 0x01;
12081200
1209      if (LOG) logerror("uPD7220 '%s' M: %u\n", tag(), m_m);
1201      LOG(("uPD7220 '%s' M: %u\n", tag(), m_m));
12101202
12111203      recompute_parameters();
12121204      break;
r19788r19789
12171209         m_lr = (m_pr[1] & 0x1f) + 1;
12181210         m_dc = BIT(m_pr[1], 7);
12191211
1220         if (LOG)
1221         {
1222            logerror("uPD7220 '%s' LR: %u\n", tag(), m_lr);
1223            logerror("uPD7220 '%s' DC: %u\n", tag(), m_dc);
1224         }
1212         LOG(("uPD7220 '%s' LR: %u\n", tag(), m_lr));
1213         LOG(("uPD7220 '%s' DC: %u\n", tag(), m_dc));
12251214      }
12261215
12271216      if(m_param_ptr == 3)
r19788r19789
12291218         m_ctop = m_pr[2] & 0x1f;
12301219         m_sc = BIT(m_pr[2], 5);
12311220
1232         if (LOG)
1233         {
1234            logerror("uPD7220 '%s' CTOP: %u\n", tag(), m_ctop);
1235            logerror("uPD7220 '%s' SC: %u\n", tag(), m_sc);
1236         }
1221         LOG(("uPD7220 '%s' CTOP: %u\n", tag(), m_ctop));
1222         LOG(("uPD7220 '%s' SC: %u\n", tag(), m_sc));
12371223      }
12381224
12391225      if(m_param_ptr == 4)
r19788r19789
12411227         m_br = ((m_pr[3] & 0x07) << 2) | (m_pr[2] >> 6);
12421228         m_cbot = m_pr[3] >> 3;
12431229
1244         if (LOG)
1245         {
1246            logerror("uPD7220 '%s' BR: %u\n", tag(), m_br);
1247            logerror("uPD7220 '%s' CBOT: %u\n", tag(), m_cbot);
1248         }
1230         LOG(("uPD7220 '%s' BR: %u\n", tag(), m_br));
1231         LOG(("uPD7220 '%s' CBOT: %u\n", tag(), m_cbot));
12491232      }
12501233      break;
12511234
12521235   case COMMAND_START: /* start display & end idle mode */
12531236      m_de = 1;
12541237
1255      //if (LOG) logerror("uPD7220 '%s' DE: 1\n", tag());
1238      //LOG(("uPD7220 '%s' DE: 1\n", tag()));
12561239      break;
12571240
12581241   case COMMAND_BCTRL: /* display blanking control */
12591242      m_de = m_cr & 0x01;
12601243
1261      //if (LOG) logerror("uPD7220 '%s' DE: %u\n", tag(), m_de);
1244      //LOG(("uPD7220 '%s' DE: %u\n", tag(), m_de));
12621245      break;
12631246
12641247   case COMMAND_ZOOM: /* zoom factors specify */
r19788r19789
12671250         m_gchr = m_pr[1] & 0x0f;
12681251         m_disp = m_pr[1] >> 4;
12691252
1270         if (LOG) logerror("uPD7220 '%s' GCHR: %01x\n", tag(), m_gchr);
1271         if (LOG) logerror("uPD7220 '%s' DISP: %01x\n", tag(), m_disp);
1253         LOG(("uPD7220 '%s' GCHR: %01x\n", tag(), m_gchr));
1254         LOG(("uPD7220 '%s' DISP: %01x\n", tag(), m_disp));
12721255      }
12731256      break;
12741257
r19788r19789
12791262
12801263         m_ead = (upper_addr << 16) | (m_pr[2] << 8) | m_pr[1];
12811264
1282         //if (LOG) logerror("uPD7220 '%s' EAD: %06x\n", tag(), m_ead);
1265         //LOG(("uPD7220 '%s' EAD: %06x\n", tag(), m_ead));
12831266
12841267         if(m_param_ptr == 4)
12851268         {
12861269            m_dad = m_pr[3] >> 4;
1287            //if (LOG) logerror("uPD7220 '%s' DAD: %01x\n", tag(), m_dad);
1270            //LOG(("uPD7220 '%s' DAD: %01x\n", tag(), m_dad));
12881271         }
12891272      }
12901273      break;
r19788r19789
12981281      {
12991282         if (m_ra_addr < 16)
13001283         {
1301            if (LOG) logerror("uPD7220 '%s' RA%u: %02x\n", tag(), m_ra_addr, data);
1284            LOG(("uPD7220 '%s' RA%u: %02x\n", tag(), m_ra_addr, data));
13021285
13031286            m_ra[m_ra_addr] = data;
13041287            m_ra_addr++;
r19788r19789
13131296      {
13141297         m_pitch = data;
13151298
1316         if (LOG) logerror("uPD7220 '%s' PITCH: %u\n", tag(), m_pitch);
1299         LOG(("uPD7220 '%s' PITCH: %u\n", tag(), m_pitch));
13171300      }
13181301      break;
13191302
r19788r19789
13361319      {
13371320         m_mask = (m_pr[2] << 8) | m_pr[1];
13381321
1339         if (LOG) logerror("uPD7220 '%s' MASK: %04x\n", tag(), m_mask);
1322         LOG(("uPD7220 '%s' MASK: %04x\n", tag(), m_mask));
13401323      }
13411324      break;
13421325
r19788r19789
15211504
15221505WRITE_LINE_MEMBER( upd7220_device::ext_sync_w )
15231506{
1524   //if (LOG) logerror("uPD7220 '%s' External Synchronization: %u\n", tag(), state);
1507   //LOG(("uPD7220 '%s' External Synchronization: %u\n", tag(), state));
15251508
15261509   if (state)
15271510   {
r19788r19789
16761659         break;
16771660
16781661      case UPD7220_MODE_DISPLAY_INVALID:
1679         logerror("uPD7220 '%s' Invalid Display Mode!\n", tag());
1662         LOG(("uPD7220 '%s' Invalid Display Mode!\n", tag()));
16801663      }
16811664   }
16821665   return 0;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team