home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / TIERRA40.ZIP / TIERRA / TTOOLS.C < prev    next >
C/C++ Source or Header  |  1992-09-09  |  18KB  |  601 lines

  1. /* ======================================================================*/
  2. /* ttools.c  9-9-92  support for data analysis of the 
  3.    Tierra Simulator V4.0: Copyright (c) 1992 Dan Pirone & Virtual Life
  4.    written by Daniel pirone
  5.    v 2.0
  6. */
  7. /* ======================================================================*/
  8.  
  9. #ifndef lint
  10. static char ttools_sccsid[] = "@(#)ttools.c    1.7 7/21/92";
  11. #endif
  12.  
  13. #include "tierra.h"
  14. #include "extern.h"
  15. #include <signal.h>
  16.  
  17. #ifdef ALCOMM
  18. #include "tmonitor.h"
  19. #include "trequest.h"
  20. #include <mlayer.h>
  21. #endif
  22.  
  23.  
  24.  
  25. #ifdef MEM_CHK
  26. #include <memcheck.h>
  27. #endif
  28.  
  29. /*-----------------------------------------------------------------------*/
  30. /*-----------------------------------------------------------------------*/
  31. /* routines for query_species */
  32. /*-----------------------------------------------------------------------*/
  33. I16s hg_compare(i,j)         
  34. HistType   *i,*j;
  35.    {
  36.    if(i->size == j->size)
  37.      return(i->lbl - j->lbl);
  38.    return(i->size - j->size);
  39.    }
  40. /*-----------------------------------------------------------------------*/
  41. I16s hs_compare(i,j)         
  42. HistType   *i,*j;
  43.    {
  44.    return(i->size - j->size);
  45.    }
  46. /*-----------------------------------------------------------------------*/
  47. I16s hc_compare(i,j)         
  48. HistType   *i,*j;
  49.    {
  50.    return(j->count - i->count);
  51.    }
  52. /*-----------------------------------------------------------------------*/
  53. /* routines for query_size */
  54. /*-----------------------------------------------------------------------*/
  55. I16s bc_compare(i,j)         
  56. struct size_buf {
  57.    I32s count;
  58.    I32s lbl;
  59.    I32s moves;
  60.    I32s flags;
  61.    I32s bits;
  62.    } *i,*j;
  63.    {
  64.    return(j->count - i->count);
  65.    }
  66. /*-----------------------------------------------------------------------*/
  67. I16s bg_compare(i,j)         
  68. struct size_buf {
  69.    I32s count;
  70.    I32s lbl;
  71.    I32s moves;
  72.    I32s flags;
  73.    I32s bits;
  74.    } *i,*j;
  75.    {
  76.      return(i->lbl - j->lbl);
  77.    }
  78. /*-----------------------------------------------------------------------*/
  79.  
  80. void query_size(size_class)
  81. I32s size_class;
  82. {
  83. I32s nnn,num_spec,top_buf,tc,tl,ci,t,thit;
  84. typedef struct size_buf {
  85.    I32s count;
  86.    I32s lbl;
  87.    I32s moves;
  88.    I32s flags;
  89.    I32s bits;
  90.    } bf;
  91.    bf * buf;
  92.    Pcells  ce;
  93.  
  94. if((size_class < 1) || (size_class > siz_sl)|| (!GeneBnker)
  95.    || (sl[size_class]<(SList *)4)) return;
  96.  
  97. num_spec = sl[size_class]->num_g;
  98.  
  99. if ((buf = (bf *) thcalloc((num_spec+1) , sizeof(bf) )) == (bf *) NULL)
  100.    {
  101.    FEError(-1500,NOEXIT,NOWRITE,
  102.       "Tierra query_size() Not enough memory to create size table");
  103.     return;
  104.    }
  105. for(tc = 0,t= 0; tc < sl[size_class]->num_g,t < sl[size_class]->a_num; t++)
  106.    {
  107.    if (!((I32s) sl[size_class]->g[t] > 4)) continue;
  108.        buf[tc].lbl = tc; 
  109.    buf[tc].count =  sl[size_class]->g[t]->pop;
  110.    buf[tc].moves =  sl[size_class]->g[t]->d1.mov_daught;
  111.    buf[tc].flags =  sl[size_class]->g[t]->d1.flags;
  112.    buf[tc].bits =  sl[size_class]->g[t]->bits;
  113.    tc++; 
  114.    }
  115.  
  116. tc = (tc > fe_lines-MSG_Y)? fe_lines - MSG_Y -1 : tc;
  117.  
  118. qsort(buf,num_spec-1,sizeof(bf),bc_compare); /*sort all, by count*/
  119. qsort(buf,tc, sizeof(bf),bg_compare); /* sort top num, by size */
  120.  
  121.  FEPrintf(MSG_X,MSG_Y,0,"Gene:    #  Mem Errs   Move  Bits\n");
  122.  if (Log && HistPrint) fprintf(tfp_log,"Gene:    #  Mem Errs   Move  Bits\n");
  123.  
  124.    for(t= 0; t < tc; t++)
  125.       {
  126.       if (buf[t].count < 1) break;
  127.       WritEcoB(buf[t].bits ,mes[9]);
  128.       FEPrintf(MSG_X,MSG_Y+t+1,0,"%3.3s %6ld %3ld %3ld %6ld    %s\n",
  129.         Int2Lbl(buf[t].lbl),
  130.         buf[t].count,
  131.         (I32s) (100.0 * buf[t].count * size_class / SoupSize),
  132.         buf[t].flags ,
  133.         buf[t].moves, 
  134.         mes[9]
  135.         );
  136.       if (Log && HistPrint) 
  137.         fprintf(tfp_log,"%3.3s %6ld %3ld %3ld %6ld    %s\n",
  138.         Int2Lbl(buf[t].lbl),
  139.         buf[t].count,
  140.         (I32s) (100.0 * buf[t].count * size_class / SoupSize),
  141.         buf[t].flags ,
  142.         buf[t].moves, 
  143.         mes[9]
  144.         );
  145.       }
  146.    if (Log && HistPrint) {fprintf(tfp_log,"\n"); fflush(tfp_log);}
  147.    if (buf)
  148.    {  thfree(buf);
  149.       buf = NULL;
  150.    }
  151. } /* end query_size */
  152.  
  153. /*-----------------------------------------------------------------------*/
  154.  
  155. void query_species(num)
  156. I32s num;
  157. {
  158.  
  159. I32s num_ent = 0,
  160.      nnn = 0,
  161.      ci,t,n_star = 0;
  162.      Pcells ce;
  163.  
  164.  
  165. if ((!GeneBnker)|| (NumSizes < 1) || (num < 2)) return; 
  166.  
  167. if (Hist != NULL)
  168.    {  
  169.    thfree(Hist);
  170.    Hist = (HistType *)NULL;
  171.    }
  172. Max_hits = -1;
  173.  
  174. if (IMode == GEN_HIST) 
  175.    num_ent = NumGenotypes;
  176. else                                 /* IMode == SIZ_HIST  || SIZM_HIST*/
  177.    num_ent = NumSizes;
  178.  
  179. if ((Hist  = (HistType *) thcalloc((num_ent+1) , sizeof(HistType))) 
  180.     == (HistType *) NULL)
  181.    {
  182.    FEError(-1501,NOEXIT,NOWRITE,
  183.       "Tierra query_species() Not enough memory to create %s table",
  184.           (IMode == GEN_HIST)? "genotype":
  185.        (IMode == SIZM_HIST)? "memory" : "size");
  186.     return;
  187.    }
  188.  
  189. for(nnn= 0,ci = 1; (ci < siz_sl && nnn < num_ent); ci++)
  190.    {
  191.    if(((I32u) sl[ci] > 4L) && (sl[ci]->num_c > 0))
  192.       {
  193.          if (IMode == GEN_HIST)
  194.             {
  195.             for(n_star = 0,t= 0; 
  196.                (n_star < sl[ci]->num_g && t < sl[ci]->a_num); t++)
  197.                {
  198.                if(((I32u) sl[ci]->g[t] < 5L) || (sl[ci]->g[t]->pop < 1))
  199.                   continue;
  200.                Hist[nnn].size = ci;
  201.                Hist[nnn].lbl =  t; /* int form of label */
  202.                Hist[nnn].count =  sl[ci]->g[t]->pop;
  203.                if (Hist[nnn].count >= Max_hits) 
  204.                   {Max_hits = Hist[nnn].count;}
  205.                nnn++; n_star++;
  206.                }
  207.             }
  208.          else /* IMode == SIZ_HIST  || SIZM_HIST */
  209.            {
  210.            Hist[nnn].size = ci;
  211.            Hist[nnn].count =  sl[ci]->num_c;
  212.            if (Hist[nnn].count >= Max_hits) 
  213.               {Max_hits = Hist[nnn].count;}
  214.            nnn++;
  215.            }
  216.     } /* end of valid size class */
  217. }
  218.  
  219. if (( Max_hits ) < 1) return;
  220. nnn = ((nnn > num_ent)? num_ent : nnn);
  221. nnn = ((nnn > num)? num : nnn);
  222. nnn = ((nnn > fe_lines - MSG_Y)? fe_lines - MSG_Y :nnn);
  223.  
  224. if (IMode == SIZM_HIST) 
  225.    for (t = 0; t < nnn; t++)
  226.      {
  227.      Hist[t].count *= Hist[t].size;
  228.      if (Hist[t].count >= Max_hits) 
  229.         {Max_hits = Hist[t].count;}
  230.     }
  231.  
  232. qsort(Hist,num_ent-1,sizeof(HistType),hc_compare); /*sort all, by count*/
  233. if (IMode == GEN_HIST)
  234.    qsort(Hist,nnn, sizeof(HistType),hg_compare); /* sort top num, by size */
  235. else /* IMode == SIZ_HIST  || SIZM_HIST*/
  236.    qsort(Hist,nnn, sizeof(HistType),hs_compare); /* sort top num, by size */
  237.  
  238. if ((Hist  = (HistType *) threcalloc(Hist,((nnn+1)*sizeof(HistType)),
  239.                                           ((num_ent+1) * sizeof(HistType)))) 
  240.     == (HistType *) NULL)
  241.    {
  242.    FEError(-1502,NOEXIT,NOWRITE,
  243.       "Tierra query_species() problem reallocing %s table",
  244.           (IMode == GEN_HIST)? "genotype":
  245.        (IMode == SIZM_HIST)? "memory" : "size");
  246.     return;
  247.    }
  248.  
  249. HistSize = nnn;
  250. HistNStars =  ((float)(fe_width -20) /(float) Max_hits);
  251.  
  252. for(t= 0; t < nnn; t++)
  253.     {
  254.          if (Hist[t].count < 1) continue;
  255.          Buff[0]=  '*'; Buff[1]=  '\0';
  256.          Hist[t].nstar = n_star =  HistNStars * Hist[t].count;
  257.          if (IMode == GEN_HIST)
  258.             {
  259.             if ((t > 0) && (Hist[t].size == Hist[t-1].size))
  260.                {
  261.                FEPrintf(MSG_X,MSG_Y+t,0,"      %3s %6ld | ",
  262.                   Int2Lbl(Hist[t].lbl) ,Hist[t].count);
  263.                if (Log && HistPrint) fprintf(tfp_log,"    %3s %6ld |",
  264.                   Int2Lbl(Hist[t].lbl) ,Hist[t].count);
  265.                }
  266.             else
  267.                {
  268.                FEPrintf(MSG_X,MSG_Y+t,0," %5hd%3s %6ld | ",
  269.                   Hist[t].size,Int2Lbl(Hist[t].lbl) ,Hist[t].count);
  270.                if (Log && HistPrint) fprintf(tfp_log,"%5hd%3s %6ld |",
  271.                   Hist[t].size,Int2Lbl(Hist[t].lbl) ,Hist[t].count);
  272.                }
  273.             }
  274.          else /* IMode == SIZ_HIST || SIZM_HIST */
  275.             {
  276.             FEPrintf(MSG_X,MSG_Y+t,0,"%5hd %3hd %6ld | ",
  277.                Hist[t].size,sl[Hist[t].size]->num_g,Hist[t].count);
  278.             if (Log && HistPrint) fprintf(tfp_log,"%5hd %3hd %6ld |",
  279.                Hist[t].size,sl[Hist[t].size]->num_g,Hist[t].count);
  280.             }
  281.         for(ci= 0;ci < n_star;ci++,strcat(Buff, "*")); 
  282.         FEPrintf((MSG_X+19),MSG_Y+t,0,"%s\n",Buff); 
  283.         if (Log && HistPrint) fprintf(tfp_log,"%s\n",Buff); 
  284.     }
  285. FEClrmsg(MSG_Y+t);
  286. if (Log && HistPrint) {fprintf(tfp_log,"\n"); fflush(tfp_log);}
  287. }        /* end of query_species */
  288.  
  289. /*-----------------------------------------------------------------------*/
  290.  
  291. #if FRONTEND == BASIC
  292.  
  293. void query_spec_d(size,lbl)
  294. I32s size,lbl;
  295. {
  296. I32s l,n,nnn, tcount, SigSaveSet;
  297. I16s empty = 0, a = 0, b = 1;
  298. I8s old_n_star, ns_dlta;
  299.  
  300. if((size > siz_sl) || (size < 0)) return;
  301. if((Hist == NULL)) {query_species(fe_lines);return;}
  302.  
  303. #ifndef __TURBOC__
  304.  SigSaveSet=sigblock(SigBlockSet); 
  305. #endif
  306.  
  307. Buff[0]=  '*'; Buff[1]=  '\0';
  308. /*
  309. if (HistSize > 4)
  310.   {
  311.   l = (int) HistSize/2; 
  312.   n = (size < Hist[l].size)?0:(l-1); 
  313.   }
  314. else
  315.   n=0L;
  316. */
  317. /* for(; n < HistSize; n++) */
  318. for(n =0; n < HistSize; n++)
  319.    {
  320.    if ((I32u)sl[Hist[n].size] < 4L) {empty++; continue;}
  321.    if (IMode == GEN_HIST) 
  322.       {
  323.       if ((I32u)sl[Hist[n].size]->g[Hist[n].lbl] < 4L)
  324.          {
  325.          empty++;
  326.          tcount = 0;
  327.          }
  328.       else tcount = sl[Hist[n].size]->g[Hist[n].lbl]->pop;
  329.       }
  330.    else if (IMode == SIZM_HIST) 
  331.       {
  332.        tcount = size * sl[Hist[n].size]->num_c;
  333.       }
  334.    else
  335.        tcount = sl[Hist[n].size]->num_c;
  336.  
  337.    if ((tcount < 1L)&& (++empty > 3))
  338.       {
  339.       query_species(fe_lines);
  340. #ifdef unix
  341.       (void)sigsetmask(SigSaveSet); 
  342. #endif
  343.       return;
  344.       }
  345.  
  346.    if (Hist[n].size == size)
  347.    {
  348.       if ((IMode == GEN_HIST) && (Hist[n].lbl != lbl)) continue;
  349.       if( tcount > 0L )
  350.       {
  351.      old_n_star    = Hist[n].nstar;
  352.          l             = HistNStars * tcount;
  353.          Hist[n].nstar = (l > 255)?255 :   l;
  354.          ns_dlta = Hist[n].nstar - old_n_star;
  355.       }
  356.       else
  357.       {
  358.          old_n_star = 0L;
  359.          Hist[n].nstar = 0;
  360.          ns_dlta = 0L;
  361.          Buff[0] = ' ';
  362.       }
  363.       if (IMode == GEN_HIST) 
  364.          FEPrintf(MSG_X+10,MSG_Y+n,0,"%6ld", tcount);
  365.       else
  366.          FEPrintf(MSG_X+6,MSG_Y+n,0,"%3hd %6ld",sl[Hist[n].size]->num_g,
  367.                tcount);
  368.       if (Hist[n].nstar && !ns_dlta)  break;
  369.       if (Hist[n].nstar > (fe_width))
  370.          {
  371.          Buff[0] = '+';
  372.          old_n_star = 1+fe_width; 
  373.          ns_dlta = 0;
  374.          Hist[n].nstar=fe_width;
  375.          }
  376.       else
  377.          {
  378.          if ( ns_dlta > 1L) 
  379.             { 
  380.             for(l= 0;l < ns_dlta;l++,strcat(Buff, "*")); 
  381.             ns_dlta=0;
  382.             }
  383.          }
  384.       FEPrintf((MSG_X+19+old_n_star+ns_dlta),MSG_Y+n,0,"%s\n",Buff); 
  385.       break;
  386.    }
  387. }
  388. #ifndef __TURBOC__
  389.  (void)sigsetmask(SigSaveSet); 
  390. #endif
  391. }
  392.  
  393. #endif /* FRONTEND == BASIC */
  394. /*-----------------------------------------------------------------------*/
  395. #ifdef unix
  396. /*-----------------------------------------------------------------------*/
  397. /* THIS CODE IS NOT FINISHED  */
  398.  
  399. void T_sig_read(sig,code,scp,addr)
  400.     I32s  sig,code;
  401.     /* struct sigcontext *scp; */
  402.     I32s *scp; /* DO NOT USE !!!!! */
  403.     I8s  *addr;
  404. {
  405.     FILE *inf;
  406.     I8s data[85];
  407.     I32s i;
  408.     struct s_list **tsl;
  409.     signal(SIGUSR1, T_sig_read);
  410.     FEError(-1506,NOEXIT,NOWRITE,
  411.         "==========================================================");
  412.     FEError(-1507,NOEXIT,NOWRITE,"TIERRA: re-read soup_in (%s) ...",soup_fn);
  413.  
  414.     inf = fopen(soup_fn, "r");
  415.     if (inf == NULL)
  416.     {   FEError(-1508,EXIT,NOWRITE,
  417.             "Tierra T_sig_read() GetSoupIn: file %s not opened, exiting",
  418.                 soup_fn);
  419.     }
  420.     fgets(data, 84, inf);
  421.     sscanf(data, "tierra core:");       /* file header line */
  422.     fgets(data, 84, inf);  /* blank line */
  423.     fgets(data, 84, inf);
  424.     while (strlen(data) > 3)
  425.     {   if (!GetAVar(data))
  426.             FEError(-1509,NOEXIT,NOWRITE,
  427.                 "Tierra T_sig_read() bad soup_in line: %s", data);
  428.         fgets(data, 84, inf);
  429.     }
  430.  
  431.  FEError(-1510,NOEXIT,NOWRITE,
  432.          "==========================================================");
  433.  ToggleLog(0L);
  434. }
  435. #endif /* unix */
  436.  
  437. /*-----------------------------------------------------------------------*/
  438. #ifdef unix
  439. /*-----------------------------------------------------------------------*/
  440. /* THIS CODE IS NOT FINISHED  */
  441.  
  442. void T_sig_write(sig,code,scp,addr)
  443.     I32s  sig,code;
  444.     /* struct sigcontext *scp; */
  445.     I32s *scp; /* DO NOT USE !!!!! */
  446.     I8s  *addr;
  447. {
  448.  
  449. signal(SIGHUP,  T_sig_write);
  450.  FEError(-1511,NOEXIT,NOWRITE,
  451.          "==========================================================");
  452.  FEError(-1512,NOEXIT,WRITE,"TIERRA: writing soup ...");
  453.  FEError(-1513,NOEXIT,NOWRITE,
  454.          "==========================================================");
  455.  
  456. }
  457. #endif /* unix */
  458.  
  459. /*-----------------------------------------------------------------------*/
  460. #ifdef unix
  461. /*-----------------------------------------------------------------------*/
  462. /* THIS CODE IS NOT FINISHED  */
  463.  
  464. void T_sig_info(sig,code,scp,addr)
  465.     I32s  sig,code;
  466.     /* struct sigcontext *scp; */
  467.     I32s *scp; /* DO NOT USE !!!!! */
  468.     I8s  *addr;
  469. {
  470. I32s t_hist_print = HistPrint;
  471. signal(SIGUSR2, T_sig_info);
  472. if(!HistPrint) HistPrint = 1L;
  473.   sprintf(mes[0], 
  474.            "---------------------------------------------------------");
  475.    sprintf(mes[1],
  476. "InstExe.m    = %6ld  InstExec.i = %6ld  NumCells = %4ld ",
  477.            InstExe.m,InstExe.i,NumCells);
  478.   FEMessage(2,mes);
  479.   if(GeneBnker)
  480.      {
  481.    sprintf(mes[0],
  482. "NumGenotypes =   %4ld  NumSizes   =   %4ld", NumGenotypes, NumSizes);
  483.   FEMessage(1,mes);
  484.      }
  485.    sprintf(mes[0],
  486.            "---------------------------------------------------------");
  487.   FEMessage(1,mes);
  488.  query_species(20);
  489.    sprintf(mes[0],
  490.            "---------------------------------------------------------");
  491.   FEMessage(1,mes);
  492. HistPrint = t_hist_print;
  493. }
  494. #endif /* unix */
  495.  
  496. /*-----------------------------------------------------------------------*/
  497.  
  498. void ToggleLog(mode)
  499. I32s mode;
  500. {
  501.              if (Log  && (tfp_log == NULL))
  502.                 {
  503.                 if(!new_soup) tfp_log = fopen("tierra.log","a");
  504.                 else tfp_log = fopen("tierra.log","w");
  505.                 if(tfp_log  == NULL)
  506.                    {
  507.                    FEError(-1514,NOEXIT,NOWRITE,
  508.                        "Tierra ToggleLog() Problem opening - tierra.log ");
  509.                    }
  510.                 }
  511.             if(!Log && ( tfp_log )) {fclose(tfp_log);tfp_log = NULL;} 
  512.             sprintf(mes[0],"TIERRA: LOG = %s, Histogram Logging = %s \n",
  513.                    (Log)? "on" : "off",
  514.                    (HistPrint)? "on" : "off");
  515.             FEMessage(1,mes);
  516. }
  517. /* ----------------------------------------------------------------------*/
  518. #ifdef MICRO
  519. void Micro_Spy(ce)
  520. Pcells ce;
  521. {
  522. I32s tlog,off_int;
  523. I8s  off_char = ' ',d_data[80],cc;
  524.             IMode= PLN_STATS;
  525.             tlog = Log;
  526.             Log = 0;      /*note: file not closed, we just wont scream at it */
  527.  
  528.         if ((MicroSlice) && (ThisSlice != MicroSlice)) return;
  529.  
  530.             off_int = ce->c.ip - ce->mm.p  ;
  531.             if (off_int > (ce->mm.s)) off_char = '+';
  532.             if (ce->md.s >= MinCellSize)
  533.                sprintf(d_data,"Daughter @ %-6ld + %-6ld",ce->md.p,ce->md.s);
  534.             else
  535.                sprintf(d_data,"NO Daughter");
  536.             sprintf(mes[0],
  537.          "Cell %2d:%3d %04ld%3s @ %7ld Slice=%4d  Stack[%7ld]              ",
  538.                  ce->q.this.a, ce->q.this.i,
  539.                  ce->mm.s,Int2Lbl( ce->d.gi),ce->mm.p,
  540.                  ce->d.ib,ce->c.st[0]);
  541.             sprintf(mes[1],
  542.             "IP [%7ld](%c%-7ld) = 0x%02x %9.9s        [%7ld]         ",
  543.                  ce->c.ip, off_char, off_int,
  544.                  soup[ad(ce->c.ip)].inst,
  545.                  id[soup[ad(ce->c.ip)].inst].mn, ce->c.st[1]);
  546.             sprintf(mes[2],
  547.         "AX [%7ld]                                   [%7ld]              ",
  548.                     ce->c.re[0], ce->c.st[2]);
  549.             sprintf(mes[3],
  550.         "BX [%7ld]                                   [%7ld]              ",
  551.                     ce->c.re[1], ce->c.st[3]);
  552.             sprintf(mes[4],
  553.         "CX [%7ld]                                   [%7ld]              ",
  554.                     ce->c.re[2], ce->c.st[4]);
  555.             sprintf(mes[5],
  556.         "DX [%7ld]                                   [%7ld]              ",
  557.                     ce->c.re[3], ce->c.st[5]);
  558.             sprintf(mes[6],
  559.    "Flag = %1.1d                                       [%7ld]             ",
  560.             (int) ce->c.fl,ce->c.st[6]);
  561.             sprintf(mes[7],
  562.         "%-30.30s                 [%7ld]             ",
  563.             d_data, ce->c.st[7]);
  564.             sprintf(mes[8],
  565.         "                                               [%7ld]             ",
  566.             ce->c.st[8]);
  567.             sprintf(mes[9],
  568.         "                                               [%7ld]             ",
  569.             ce->c.st[9]);
  570.             mes[ce->c.sp][57] = '<';
  571.             FEMessage(10,mes);
  572.             Log= tlog;
  573.             if (MC_step > 0L)
  574.                {
  575.                FEPrintf(HLP_X,HLP_Y,1,
  576. "MICRO  |  %15.15s  ESC-Main Menu  n-Next step            ",
  577.            (MicroSlice)?"t-Untrack cell": "T-Track cell");
  578. #if FRONTEND == STDIO
  579.                printf("\n");
  580. #endif /* FRONTEND == STDIO */
  581.                }
  582.             if(( MC_step  > 0L) && ((cc = FEGetc()) == 0x1b)) FEMenu();
  583.         if (cc == 'T') MicroSlice = ThisSlice;
  584.         else if (cc == 't') MicroSlice = NULL;
  585.             if( MC_step  == 0L)
  586.                {
  587.                if (KEYHIT()) FEMenu();
  588.                else sleep(1);
  589.                }
  590. #ifdef ALCOMM
  591.         if ( MIsDFEnabled( TrtIPEvent ) )
  592.            {
  593.            TMoveIP( ThisSlice->mm.p,ThisSlice->c.ip);
  594.            }
  595. #endif /* ALCOMM */
  596. }
  597. #endif /* MICRO */
  598.  
  599. /*-----------------------------------------------------------------------*/
  600.  
  601.