Previous 199869 Revisions Next

r20311 Thursday 17th January, 2013 at 23:20:07 UTC by Tafoid
sharcdsm.c:  [Pavel Semerad]
- Added omitted direction flags in instruction using both PM() and DM().
- In instruction with 6bit immediate data, this data is signed value.  It would be better to show this sign because it is confusing to see for
example 0x3F which actually means -1 (32bit immed data are not confusing
as that big values are easy to recognize).
[src/emu/cpu/sharc]sharcdsm.c

trunk/src/emu/cpu/sharc/sharcdsm.c
r20310r20311
354354
355355static void pm_dm_imm_dreg(int g, int d, int i, int data, int dreg, int update)
356356{
357   const char *sign = "";
358   if (data & 0x20)
359   {
360      /* negative sign */
361      data = (data ^ 0x3f) + 1;
362      sign = "-";
363   }
357364   if (update)     // post-modify
358365   {
359366      if (d)
360367      {
361368         if (g)
362369         {
363            print("PM(%s, 0x%02X) = %s", GET_DAG2_I(i), data, GET_DREG(dreg));
370            print("PM(%s, %s0x%02X) = %s", GET_DAG2_I(i), sign, data, GET_DREG(dreg));
364371         }
365372         else
366373         {
367            print("DM(%s, 0x%02X) = %s", GET_DAG1_I(i), data, GET_DREG(dreg));
374            print("DM(%s, %s0x%02X) = %s", GET_DAG1_I(i), sign, data, GET_DREG(dreg));
368375         }
369376      }
370377      else
371378      {
372379         if (g)
373380         {
374            print("%s = PM(%s, 0x%02X)", GET_DREG(dreg), GET_DAG2_I(i), data);
381            print("%s = PM(%s, %s0x%02X)", GET_DREG(dreg), GET_DAG2_I(i), sign, data);
375382         }
376383         else
377384         {
378            print("%s = DM(%s, 0x%02X)", GET_DREG(dreg), GET_DAG1_I(i), data);
385            print("%s = DM(%s, %s0x%02X)", GET_DREG(dreg), GET_DAG1_I(i), sign, data);
379386         }
380387      }
381388   }
r20310r20311
385392      {
386393         if (g)
387394         {
388            print("PM(0x%02X, %s) = %s", data, GET_DAG2_I(i), GET_DREG(dreg));
395            print("PM(%s0x%02X, %s) = %s", sign, data, GET_DAG2_I(i), GET_DREG(dreg));
389396         }
390397         else
391398         {
392            print("DM(0x%02X, %s) = %s", data, GET_DAG1_I(i), GET_DREG(dreg));
399            print("DM(%s0x%02X, %s) = %s", sign, data, GET_DAG1_I(i), GET_DREG(dreg));
393400         }
394401      }
395402      else
396403      {
397404         if (g)
398405         {
399            print("%s = PM(0x%02X, %s)", GET_DREG(dreg), data, GET_DAG2_I(i));
406            print("%s = PM(%s0x%02X, %s)", GET_DREG(dreg), sign, data, GET_DAG2_I(i));
400407         }
401408         else
402409         {
403            print("%s = DM(0x%02X, %s)", GET_DREG(dreg), data, GET_DAG1_I(i));
410            print("%s = DM(%s0x%02X, %s)", GET_DREG(dreg), sign, data, GET_DAG1_I(i));
404411         }
405412      }
406413   }
r20310r20311
478485   int dmdreg = (opcode >> 33) & 0xf;
479486   int pmdreg = (opcode >> 23) & 0xf;
480487   int comp = opcode & 0x7fffff;
488   int dmd = (opcode >> 44) & 0x1;
489   int pmd = (opcode >> 37) & 0x1;
481490
482491   if (comp)
483492   {
484493      compute(comp);
485494      print(",  ");
486495   }
487   print("DM(%s, %s) = R%d, ", GET_DAG1_I(dmi), GET_DAG1_M(dmm), dmdreg);
488   print("PM(%s, %s) = R%d", GET_DAG2_I(pmi), GET_DAG2_M(pmm), pmdreg);
496   if (dmd)
497   {
498      print("DM(%s, %s) = R%d, ", GET_DAG1_I(dmi), GET_DAG1_M(dmm), dmdreg);
499   }
500   else
501   {
502      print("R%d = DM(%s, %s), ", dmdreg, GET_DAG1_I(dmi), GET_DAG1_M(dmm));
503   }
504   if (pmd)
505   {
506      print("PM(%s, %s) = R%d", GET_DAG2_I(pmi), GET_DAG2_M(pmm), pmdreg);
507   }
508   else
509   {
510      print("R%d = PM(%s, %s)", pmdreg, GET_DAG2_I(pmi), GET_DAG2_M(pmm));
511   }
489512   return 0;
490513}
491514

Previous 199869 Revisions Next


© 1997-2024 The MAME Team