| version 1.3, 2003/11/04 15:44:59 | version 1.9, 2007/01/08 08:52:22 | 
| Line 3 | Line 3 | 
 | #include        "np2.h" | #include        "np2.h" | 
 | #include        "viewer.h" | #include        "viewer.h" | 
 | #include        "viewcmn.h" | #include        "viewcmn.h" | 
| #include        "i286.h" | #include        "cpucore.h" | 
 |  |  | 
 |  |  | 
| static  char            np2viewclass[] = "NP2-ViewWindow"; | static  const TCHAR             np2viewclass[] = _T("NP2-ViewWindow"); | 
| NP2VIEW_T       np2view[NP2VIEW_MAX]; | const TCHAR             np2viewfont[] = _T("£Í£Ó ¥´¥·¥Ã¥¯"); | 
| extern  HINSTANCE       hInst; | NP2VIEW_T               np2view[NP2VIEW_MAX]; | 
|  | extern  HINSTANCE               hInst; | 
 |  |  | 
 |  |  | 
| static void viewer_segmode(HWND hwnd, BYTE type) { | static void viewer_segmode(HWND hwnd, UINT8 type) { | 
 |  |  | 
 | NP2VIEW_T       *view; | NP2VIEW_T       *view; | 
 |  |  | 
| Line 105  LRESULT CALLBACK ViewProc(HWND hWnd, UIN | Line 106  LRESULT CALLBACK ViewProc(HWND hWnd, UIN | 
 | if (view) { | if (view) { | 
 | RECT    rc; | RECT    rc; | 
 | GetClientRect(hWnd, &rc); | GetClientRect(hWnd, &rc); | 
| view->step = rc.bottom / 16; | view->step = (UINT16)(rc.bottom / 16); | 
 | viewcmn_setvscroll(hWnd, view); | viewcmn_setvscroll(hWnd, view); | 
 | } | } | 
 | break; | break; | 
| Line 113  LRESULT CALLBACK ViewProc(HWND hWnd, UIN | Line 114  LRESULT CALLBACK ViewProc(HWND hWnd, UIN | 
 | case WM_VSCROLL: | case WM_VSCROLL: | 
 | view = viewcmn_find(hWnd); | view = viewcmn_find(hWnd); | 
 | if (view) { | if (view) { | 
| DWORD newpos = view->pos; | UINT32 newpos = view->pos; | 
 | switch(LOWORD(wParam)) { | switch(LOWORD(wParam)) { | 
 | case SB_LINEUP: | case SB_LINEUP: | 
 | if (newpos) { | if (newpos) { | 
| Line 225  void viewer_open(void) { | Line 226  void viewer_open(void) { | 
 | view = np2view; | view = np2view; | 
 | for (i=0; i<NP2VIEW_MAX; i++, view++) { | for (i=0; i<NP2VIEW_MAX; i++, view++) { | 
 | if (!view->alive) { | if (!view->alive) { | 
| char buf[256]; | TCHAR buf[256]; | 
 | viewcmn_caption(view, buf); | viewcmn_caption(view, buf); | 
 | ZeroMemory(view, sizeof(NP2VIEW_T)); | ZeroMemory(view, sizeof(NP2VIEW_T)); | 
 | view->alive = TRUE; | view->alive = TRUE; | 
| Line 262  void viewer_allclose(void) { | Line 263  void viewer_allclose(void) { | 
 |  |  | 
 | void viewer_allreload(BOOL force) { | void viewer_allreload(BOOL force) { | 
 |  |  | 
| static  DWORD   last = 0; | static UINT32   last = 0; | 
| DWORD   now; | UINT32          now; | 
 |  |  | 
 | now = GetTickCount(); | now = GetTickCount(); | 
 | if ((force) || ((now - last) >= 200)) { | if ((force) || ((now - last) >= 200)) { | 
| Line 275  static DWORD last = 0; | Line 276  static DWORD last = 0; | 
 | for (i=0; i<NP2VIEW_MAX; i++, view++) { | for (i=0; i<NP2VIEW_MAX; i++, view++) { | 
 | if ((view->alive) && (!view->lock)) { | if ((view->alive) && (!view->lock)) { | 
 | if (view->type == VIEWMODE_ASM) { | if (view->type == VIEWMODE_ASM) { | 
| view->seg = I286_CS; | view->seg = CPU_CS; | 
| view->off = I286_IP; | view->off = CPU_IP; | 
 | view->pos = 0; | view->pos = 0; | 
 | viewcmn_setvscroll(view->hwnd, view); | viewcmn_setvscroll(view->hwnd, view); | 
 | } | } |