Diff for /np2/win9xc/trace.cpp between versions 1.2 and 1.8

version 1.2, 2003/11/13 15:33:06 version 1.8, 2004/03/06 18:25:36
Line 38  extern HINSTANCE hPrev; Line 38  extern HINSTANCE hPrev;
   
 enum {  enum {
         IDM_TRACEEN             = 3300,          IDM_TRACEEN             = 3300,
         IDM_TRACEFH          IDM_TRACEFH,
           IDM_TRACECL
 };  };
   
 static const char       ProgTitle[] = "console";  static const char       ProgTitle[] = "console";
Line 46  static const char ClassName[] = "TRACE-c Line 47  static const char ClassName[] = "TRACE-c
 static const char       ClassEdit[] = "EDIT";  static const char       ClassEdit[] = "EDIT";
 static const char       traceen[] = "Enable";  static const char       traceen[] = "Enable";
 static const char       tracefh[] = "File out";  static const char       tracefh[] = "File out";
   static const char       tracecl[] = "Clear";
 static const char       crlf[] = "\r\n";  static const char       crlf[] = "\r\n";
   
 static  TRACEWIN        tracewin;  static  TRACEWIN        tracewin;
Line 72  static void View_ScrollToBottom(HWND hWn Line 74  static void View_ScrollToBottom(HWND hWn
         PostMessage(hWnd, EM_LINESCROLL, 0, MaxPos);          PostMessage(hWnd, EM_LINESCROLL, 0, MaxPos);
 }  }
   
   static void View_ClrString(void) {
   
           szView[0] = '\0';
           SetWindowText(hView, szView);
   }
   
 static void View_AddString(const char *lpszString) {  static void View_AddString(const char *lpszString) {
   
         int             len, vlen;          int             len, vlen;
Line 110  static LRESULT CALLBACK traceproc(HWND h Line 118  static LRESULT CALLBACK traceproc(HWND h
                                                                                                                 IDM_TRACEEN, traceen);                                                                                                                  IDM_TRACEEN, traceen);
                         InsertMenu(hmenu, 1, MF_BYPOSITION | MF_STRING,                          InsertMenu(hmenu, 1, MF_BYPOSITION | MF_STRING,
                                                                                                                 IDM_TRACEFH, tracefh);                                                                                                                  IDM_TRACEFH, tracefh);
                         InsertMenu(hmenu, 2, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);                          InsertMenu(hmenu, 2, MF_BYPOSITION | MF_STRING,
                                                                                                                   IDM_TRACECL, tracecl);
                           InsertMenu(hmenu, 3, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
   
                         CheckMenuItem(hmenu, IDM_TRACEEN,                          CheckMenuItem(hmenu, IDM_TRACEEN,
                                                                 (tracewin.en & 1)?MF_CHECKED:MF_UNCHECKED);                                                                  (tracewin.en & 1)?MF_CHECKED:MF_UNCHECKED);
Line 162  static LRESULT CALLBACK traceproc(HWND h Line 172  static LRESULT CALLBACK traceproc(HWND h
                                                                                                         MF_CHECKED:MF_UNCHECKED);                                                                                                          MF_CHECKED:MF_UNCHECKED);
                                         break;                                          break;
   
                                   case IDM_TRACECL:
                                           View_ClrString();
                                           break;
   
                                 default:                                  default:
                                         return(DefWindowProc(hWnd, msg, wp, lp));                                          return(DefWindowProc(hWnd, msg, wp, lp));
                         }                          }
Line 250  void trace_init(void) { Line 264  void trace_init(void) {
                 }                  }
         }          }
   
         tracewin.en = 1;  #if 1
           tracewin.en = 0;
         tracewin.fh = FILEH_INVALID;          tracewin.fh = FILEH_INVALID;
   #else
           tracewin.en = 0;
           tracewin.fh = file_create_c("traces.txt");
   #endif
   
         tracecfg.posx = CW_USEDEFAULT;          tracecfg.posx = CW_USEDEFAULT;
         tracecfg.posy = CW_USEDEFAULT;          tracecfg.posy = CW_USEDEFAULT;
Line 292  void trace_fmt(const char *fmt, ...) { Line 311  void trace_fmt(const char *fmt, ...) {
         va_list ap;          va_list ap;
         char    buf[0x1000];          char    buf[0x1000];
   
           va_start(ap, fmt);
           vsprintf(buf, fmt, ap);
           va_end(ap);
           if (hView) {
                   View_AddString(buf);
           }
           if (tracewin.fh != FILEH_INVALID) {
                   file_write(tracewin.fh, buf, strlen(buf));
                   file_write(tracewin.fh, crlf, strlen(crlf));
           }
   }
   
   void trace_fmt2(const char *fmt, ...) {
   
           BOOL    en;
           va_list ap;
           char    buf[0x1000];
   
         en = (tracewin.en & 1) || (tracewin.fh != FILEH_INVALID);          en = (tracewin.en & 1) || (tracewin.fh != FILEH_INVALID);
         if (en) {          if (en) {
                 va_start(ap, fmt);                  va_start(ap, fmt);

Removed from v.1.2  
changed lines
  Added in v.1.8


RetroPC.NET-CVS <cvs@retropc.net>