Diff for /np2/win9x/debuguty/viewasm.cpp between versions 1.1 and 1.5

version 1.1, 2003/10/16 17:59:10 version 1.5, 2004/04/08 13:08:23
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "resource.h"  #include        "resource.h"
 #include        "np2.h"  #include        "np2.h"
 #include        "i286.h"  
 #include        "viewer.h"  #include        "viewer.h"
 #include        "viewcmn.h"  #include        "viewcmn.h"
 #include        "viewmenu.h"  #include        "viewmenu.h"
 #include        "viewmem.h"  #include        "viewmem.h"
 #include        "viewasm.h"  #include        "viewasm.h"
 #include        "unasm.h"  #include        "unasm.h"
   #include        "cpucore.h"
   
   
 static void set_viewseg(HWND hwnd, NP2VIEW_T *view, WORD seg) {  static void set_viewseg(HWND hwnd, NP2VIEW_T *view, WORD seg) {
Line 29  static void viewasm_paint(NP2VIEW_T *vie Line 29  static void viewasm_paint(NP2VIEW_T *vie
         BYTE            buf[16];          BYTE            buf[16];
         char            str[16];          char            str[16];
         HFONT           hfont;          HFONT           hfont;
         PREFIX_T        fix;          BOOL            opsize;
         UNASM_T         una;          _UNASM          una;
         int                     step;          int                     step;
   
         hfont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0,           hfont = CreateFont(16, 0, 0, 0, 0, 0, 0, 0, 
Line 73  static void viewasm_paint(NP2VIEW_T *vie Line 73  static void viewasm_paint(NP2VIEW_T *vie
                                 view->buf2.type = ALLOCTYPE_ASM;                                  view->buf2.type = ALLOCTYPE_ASM;
                                 view->buf2.arg = seg4 + view->off;                                  view->buf2.arg = seg4 + view->off;
                                 off = view->off;                                  off = view->off;
                                 unasm_reset(&fix);  
                                 for (i=0; i<255; i++) {                                  for (i=0; i<255; i++) {
                                         off &= 0xffff;                                          off &= 0xffff;
                                         *r++ = off;                                          *r++ = off;
Line 91  static void viewasm_paint(NP2VIEW_T *vie Line 90  static void viewasm_paint(NP2VIEW_T *vie
                                                 p = buf;                                                  p = buf;
                                                 viewmem_read(&(view->dmem), seg4 + off, buf, 16);                                                  viewmem_read(&(view->dmem), seg4 + off, buf, 16);
                                         }                                          }
                                         step = unasm(off, p, &fix, NULL);                                          step = unasm(NULL, p, 16, FALSE, off);
                                         off += (WORD)step;                                          off += (WORD)step;
                                 }                                  }
                                 *r = off;                                  *r = off;
Line 106  static void viewasm_paint(NP2VIEW_T *vie Line 105  static void viewasm_paint(NP2VIEW_T *vie
                 off = view->off;                  off = view->off;
         }          }
   
         unasm_reset(&fix);  
         for (y=0; y<rc->bottom; y+=16) {          for (y=0; y<rc->bottom; y+=16) {
                 wsprintf(str, "%04x:%04x", view->seg, off);                  wsprintf(str, "%04x:%04x", view->seg, off);
                 TextOut(hdc, 0, y, str, 9);                  TextOut(hdc, 0, y, str, 9);
Line 125  static void viewasm_paint(NP2VIEW_T *vie Line 123  static void viewasm_paint(NP2VIEW_T *vie
                         p = buf;                          p = buf;
                         viewmem_read(&(view->dmem), seg4 + off, buf, 16);                          viewmem_read(&(view->dmem), seg4 + off, buf, 16);
                 }                  }
                 step = unasm(off, p, &fix, &una);                  step = unasm(&una, p, 16, FALSE, off);
                 if (!step) {                  if (!step) {
                         break;                          break;
                 }                  }
Line 147  LRESULT CALLBACK viewasm_proc(NP2VIEW_T  Line 145  LRESULT CALLBACK viewasm_proc(NP2VIEW_T 
                 case WM_COMMAND:                  case WM_COMMAND:
                         switch(LOWORD(wp)) {                          switch(LOWORD(wp)) {
                                 case IDM_SEGCS:                                  case IDM_SEGCS:
                                         set_viewseg(hwnd, view, I286_CS);                                          set_viewseg(hwnd, view, CPU_CS);
                                         break;                                          break;
   
                                 case IDM_SEGDS:                                  case IDM_SEGDS:
                                         set_viewseg(hwnd, view, I286_DS);                                          set_viewseg(hwnd, view, CPU_DS);
                                         break;                                          break;
   
                                 case IDM_SEGES:                                  case IDM_SEGES:
                                         set_viewseg(hwnd, view, I286_ES);                                          set_viewseg(hwnd, view, CPU_ES);
                                         break;                                          break;
   
                                 case IDM_SEGSS:                                  case IDM_SEGSS:
                                         set_viewseg(hwnd, view, I286_SS);                                          set_viewseg(hwnd, view, CPU_SS);
                                         break;                                          break;
   
                                 case IDM_SEGTEXT:                                  case IDM_SEGTEXT:
Line 215  void viewasm_init(NP2VIEW_T *dst, NP2VIE Line 213  void viewasm_init(NP2VIEW_T *dst, NP2VIE
                 }                  }
         }          }
         if (!src) {          if (!src) {
                 dst->seg = I286_CS;                  dst->seg = CPU_CS;
                 dst->off = I286_IP;                  dst->off = CPU_IP;
         }          }
         dst->type = VIEWMODE_ASM;          dst->type = VIEWMODE_ASM;
         dst->maxline = 256;          dst->maxline = 256;
         dst->mul = 1;          dst->mul = 1;
         dst->pos = 0;          dst->pos = 0;
 }  }
   

Removed from v.1.1  
changed lines
  Added in v.1.5


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