Diff for /np2/win9x/debuguty/viewasm.cpp between versions 1.4 and 1.7

version 1.4, 2004/02/18 02:03:37 version 1.7, 2005/02/09 20:11:36
Line 10 Line 10
 #include        "cpucore.h"  #include        "cpucore.h"
   
   
 static void set_viewseg(HWND hwnd, NP2VIEW_T *view, WORD seg) {  static void set_viewseg(HWND hwnd, NP2VIEW_T *view, UINT16 seg) {
   
         if (view->seg != seg) {          if (view->seg != seg) {
                 view->seg = seg;                  view->seg = seg;
Line 23  static void viewasm_paint(NP2VIEW_T *vie Line 23  static void viewasm_paint(NP2VIEW_T *vie
   
         LONG            y;          LONG            y;
         DWORD           seg4;          DWORD           seg4;
         WORD            off;          UINT16          off;
         DWORD           pos;          DWORD           pos;
         BYTE            *p;          BYTE            *p;
         BYTE            buf[16];          BYTE            buf[16];
         char            str[16];          OEMCHAR         str[16];
         HFONT           hfont;          HFONT           hfont;
           BOOL            opsize;
         _UNASM          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, 
                                         SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,                                          SHIFTJIS_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
                                         DEFAULT_QUALITY, FIXED_PITCH, "£Í£Ó¥´¥·¥Ã¥¯");                                          DEFAULT_QUALITY, FIXED_PITCH, np2viewfont);
         SetTextColor(hdc, 0xffffff);          SetTextColor(hdc, 0xffffff);
         SetBkColor(hdc, 0x400000);          SetBkColor(hdc, 0x400000);
         hfont = (HFONT)SelectObject(hdc, hfont);          hfont = (HFONT)SelectObject(hdc, hfont);
Line 67  static void viewasm_paint(NP2VIEW_T *vie Line 68  static void viewasm_paint(NP2VIEW_T *vie
                         }                          }
                         else {                          else {
                                 int i;                                  int i;
                                 WORD *r;                                  UINT16 *r;
                                 r = (WORD *)view->buf2.ptr;                                  r = (UINT16 *)view->buf2.ptr;
                                 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;
Line 90  static void viewasm_paint(NP2VIEW_T *vie Line 91  static void viewasm_paint(NP2VIEW_T *vie
                                                 viewmem_read(&(view->dmem), seg4 + off, buf, 16);                                                  viewmem_read(&(view->dmem), seg4 + off, buf, 16);
                                         }                                          }
                                         step = unasm(NULL, p, 16, FALSE, off);                                          step = unasm(NULL, p, 16, FALSE, off);
                                         off += (WORD)step;                                          off += (UINT16)step;
                                 }                                  }
                                 *r = off;                                  *r = off;
                         }                          }
Line 98  static void viewasm_paint(NP2VIEW_T *vie Line 99  static void viewasm_paint(NP2VIEW_T *vie
         }          }
   
         if ((pos) && (pos < 256)) {          if ((pos) && (pos < 256)) {
                 off = *(((WORD *)view->buf2.ptr) + pos);                  off = *(((UINT16 *)view->buf2.ptr) + pos);
         }          }
         else {          else {
                 off = view->off;                  off = view->off;
         }          }
   
         for (y=0; y<rc->bottom; y+=16) {          for (y=0; y<rc->bottom; y+=16) {
                 wsprintf(str, "%04x:%04x", view->seg, off);                  OEMSPRINTF(str, OEMTEXT("%04x:%04x"), view->seg, off);
                 TextOut(hdc, 0, y, str, 9);                  TextOut(hdc, 0, y, str, 9);
                 off &= 0xffff;                  off &= 0xffff;
                 if (view->lock) {                  if (view->lock) {
Line 126  static void viewasm_paint(NP2VIEW_T *vie Line 127  static void viewasm_paint(NP2VIEW_T *vie
                 if (!step) {                  if (!step) {
                         break;                          break;
                 }                  }
                 TextOut(hdc, 11 * 8, y, una.mnemonic, strlen(una.mnemonic));                  TextOut(hdc, 11 * 8, y, una.mnemonic, OEMSTRLEN(una.mnemonic));
                 if (una.operand[0]) {                  if (una.operand[0]) {
                         TextOut(hdc, (11 + 7) * 8, y, una.operand, strlen(una.operand));                          TextOut(hdc, (11 + 7) * 8, y, una.operand, OEMSTRLEN(una.operand));
                 }                  }
                 off += (WORD)step;                  off += (UINT16)step;
         }          }
   
         DeleteObject(SelectObject(hdc, hfont));          DeleteObject(SelectObject(hdc, hfont));
Line 187  void viewasm_init(NP2VIEW_T *dst, NP2VIE Line 188  void viewasm_init(NP2VIEW_T *dst, NP2VIE
                 switch(src->type) {                  switch(src->type) {
                         case VIEWMODE_SEG:                          case VIEWMODE_SEG:
                                 dst->seg = dst->seg;                                  dst->seg = dst->seg;
                                 dst->off = (WORD)(dst->pos << 4);                                  dst->off = (UINT16)(dst->pos << 4);
                                 break;                                  break;
   
                         case VIEWMODE_1MB:                          case VIEWMODE_1MB:
                                 if (dst->pos < 0x10000) {                                  if (dst->pos < 0x10000) {
                                         dst->seg = (WORD)dst->pos;                                          dst->seg = (UINT16)dst->pos;
                                         dst->off = 0;                                          dst->off = 0;
                                 }                                  }
                                 else {                                  else {
                                         dst->seg = 0xffff;                                          dst->seg = 0xffff;
                                         dst->off = (WORD)((dst->pos - 0xffff) << 4);                                          dst->off = (UINT16)((dst->pos - 0xffff) << 4);
                                 }                                  }
                                 break;                                  break;
   
Line 220  void viewasm_init(NP2VIEW_T *dst, NP2VIE Line 221  void viewasm_init(NP2VIEW_T *dst, NP2VIE
         dst->mul = 1;          dst->mul = 1;
         dst->pos = 0;          dst->pos = 0;
 }  }
   

Removed from v.1.4  
changed lines
  Added in v.1.7


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