--- np2/win9x/np2.cpp 2004/02/03 08:24:40 1.37 +++ np2/win9x/np2.cpp 2007/01/08 08:52:21 1.71 @@ -8,7 +8,6 @@ #include "parts.h" #include "np2.h" #include "np2arg.h" -#include "cputype.h" #include "dosio.h" #include "extromio.h" #include "commng.h" @@ -23,12 +22,11 @@ #include "winloc.h" #include "sstp.h" #include "sstpmsg.h" -#include "dclock.h" #include "toolwin.h" #include "juliet.h" #include "np2class.h" #include "dialog.h" -#include "memory.h" +#include "cpucore.h" #include "pccore.h" #include "iocore.h" #include "pc9861k.h" @@ -41,54 +39,103 @@ #include "diskdrv.h" #include "fddfile.h" #include "timing.h" +#include "keystat.h" #include "debugsub.h" -#include "keydisp.h" -#include "kdispwin.h" +#include "subwind.h" #include "viewer.h" +#if !defined(_WIN64) +#include "cputype.h" +#endif +#if defined(SUPPORT_DCLOCK) +#include "dclock.h" +#endif #ifdef BETA_RELEASE #define OPENING_WAIT 1500 #endif -static char szClassName[] = "NP2-MainWindow"; +static TCHAR szClassName[] = _T("NP2-MainWindow"); HWND hWndMain; HINSTANCE hInst; HINSTANCE hPrev; +#if !defined(_WIN64) int mmxflag; - BYTE np2break = 0; // ver0.30 +#endif + UINT8 np2break = 0; // ver0.30 BOOL winui_en; NP2OSCFG np2oscfg = { - "Neko Project II", "NP2", - CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 1, 0, 0, + OEMTEXT(PROJECTNAME) OEMTEXT(PROJECTSUBNAME), + OEMTEXT("NP2"), + CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, KEY_UNKNOWN, 0, 0, 0, 0, {1, 2, 2, 1}, - {5, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 - {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 - {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 - {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 + {5, 0, 0x3e, 19200, + OEMTEXT(""), OEMTEXT(""), OEMTEXT(""), OEMTEXT("")}, + {0, 0, 0x3e, 19200, + OEMTEXT(""), OEMTEXT(""), OEMTEXT(""), OEMTEXT("")}, + {0, 0, 0x3e, 19200, + OEMTEXT(""), OEMTEXT(""), OEMTEXT(""), OEMTEXT("")}, + {0, 0, 0x3e, 19200, + OEMTEXT(""), OEMTEXT(""), OEMTEXT(""), OEMTEXT("")}, 0xffffff, 0xffbf6a, 0, 0, - 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - char fddfolder[MAX_PATH]; - char hddfolder[MAX_PATH]; - char bmpfilefolder[MAX_PATH]; - char modulefile[MAX_PATH]; + OEMCHAR fddfolder[MAX_PATH]; + OEMCHAR hddfolder[MAX_PATH]; + OEMCHAR bmpfilefolder[MAX_PATH]; + OEMCHAR modulefile[MAX_PATH]; static UINT framecnt = 0; static UINT waitcnt = 0; static UINT framemax = 1; -static BYTE np2stopemulate = 0; +static UINT8 np2stopemulate = 0; static int np2opening = 1; static int np2quitmsg = 0; static HMENU hStat = NULL; -static BYTE scrnmode; +static UINT8 scrnmode; static WINLOCEX smwlex; +static HMODULE resmod; + +static const OEMCHAR np2help[] = OEMTEXT("np2.chm"); +static const OEMCHAR np2flagext[] = OEMTEXT("S%02d"); +static const OEMCHAR np2resext[] = OEMTEXT(".%u"); -static const char np2help[] = "np2.chm"; -static const char np2flagext[] = "S%02d"; +// ---- + +static HINSTANCE loadextinst(HINSTANCE hInstance) { + + OEMCHAR path[MAX_PATH]; + OEMCHAR cpstr[16]; + HMODULE dll; + + file_cpyname(path, modulefile, NELEMENTS(path)); + file_cutext(path); + OEMSPRINTF(cpstr, np2resext, GetOEMCP()); + file_catname(path, cpstr, NELEMENTS(path)); + dll = LoadLibrary(path); + resmod = dll; + if (dll != NULL) { + hInstance = (HINSTANCE)dll; + } + return(hInstance); +} + +static void unloadextinst(void) { + + HMODULE dll; + + dll = resmod; + if (dll) { + resmod = 0; + FreeLibrary(dll); + } +} + + +// ---- static void winuienter(void) { @@ -106,13 +153,17 @@ static void winuileave(void) { WINLOCEX np2_winlocexallwin(HWND base) { - HWND list[3]; UINT i; + UINT cnt; + HWND list[5]; - list[0] = hWndMain; - list[1] = toolwin_gethwnd(); - list[2] = kdispwin_gethwnd(); - for (i=0; i<3; i++) { + cnt = 0; + list[cnt++] = hWndMain; + list[cnt++] = toolwin_gethwnd(); + list[cnt++] = kdispwin_gethwnd(); + list[cnt++] = skbdwin_gethwnd(); + list[cnt++] = mdbgwin_gethwnd(); + for (i=0; i= IDM_FLAGSAVE) && - (cmd < (IDM_FLAGSAVE + STATSAVEMAX))) { - char ext[4]; - wsprintf(ext, np2flagext, cmd - IDM_FLAGSAVE); + (cmd < (IDM_FLAGSAVE + SUPPORT_STATSAVE))) { + OEMCHAR ext[4]; + OEMSPRINTF(ext, np2flagext, cmd - IDM_FLAGSAVE); flagsave(ext); } - if ((cmd >= IDM_FLAGLOAD) && - (cmd < (IDM_FLAGLOAD + STATSAVEMAX))) { - char ext[4]; - wsprintf(ext, np2flagext, cmd - IDM_FLAGLOAD); - flagload(ext, "Status Load", TRUE); + else if ((cmd >= IDM_FLAGLOAD) && + (cmd < (IDM_FLAGLOAD + SUPPORT_STATSAVE))) { + OEMCHAR ext[4]; + OEMSPRINTF(ext, np2flagext, cmd - IDM_FLAGLOAD); + flagload(ext, OEMTEXT("Status Load"), TRUE); } +#endif break; } sysmng_update(update); @@ -858,6 +1003,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT update |= SYS_UPDATEOSCFG; break; +#if defined(SUPPORT_KEYDISP) case IDM_KEYDISP: sysmenu_setkeydisp(np2oscfg.keydisp ^ 1); if (np2oscfg.keydisp) { @@ -867,7 +1013,17 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT kdispwin_destroy(); } break; - +#endif +#if defined(SUPPORT_SOFTKBD) + case IDM_SOFTKBD: + skbdwin_create(); + break; +#endif +#if defined(CPUCORE_IA32) && defined(SUPPORT_MEMDBG32) + case IDM_MEMDBG32: + mdbgwin_create(); + break; +#endif case IDM_SCREENCENTER: if ((!scrnmng_isfullscreen()) && (!(GetWindowLong(hWnd, GWL_STYLE) & @@ -902,7 +1058,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT viewer_open(); break; - case IDM_SCRNMUL4: // ver0.26 + case IDM_SCRNMUL4: case IDM_SCRNMUL6: case IDM_SCRNMUL8: case IDM_SCRNMUL10: @@ -910,8 +1066,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT case IDM_SCRNMUL16: if ((!scrnmng_isfullscreen()) && !(GetWindowLong(hWndMain, GWL_STYLE) & WS_MINIMIZE)) { - sysmenu_setscrnmul(wParam - IDM_SCRNMUL); - scrnmng_setmultiple(wParam - IDM_SCRNMUL); + sysmenu_setscrnmul((UINT8)(wParam - IDM_SCRNMUL)); + scrnmng_setmultiple((int)(wParam - IDM_SCRNMUL)); } break; @@ -930,6 +1086,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT if (subwin) { ShowWindow(subwin, SW_SHOWNOACTIVATE); } + subwin = skbdwin_gethwnd(); + if (subwin) { + ShowWindow(subwin, SW_SHOWNOACTIVATE); + } + subwin = mdbgwin_gethwnd(); + if (subwin) { + ShowWindow(subwin, SW_SHOWNOACTIVATE); + } return(DefWindowProc(hWnd, msg, wParam, lParam)); default: @@ -967,11 +1131,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT BITMAP bmp; HDC hmdc; HBRUSH hbrush; - hinst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); + hinst = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE); GetClientRect(hWnd, &rect); width = rect.right - rect.left; height = rect.bottom - rect.top; - hbmp = LoadBitmap(hinst, "NP2BMP"); + hbmp = LoadBitmap(hinst, _T("NP2BMP")); GetObject(hbmp, sizeof(BITMAP), &bmp); hbrush = (HBRUSH)SelectObject(hdc, GetStockObject(BLACK_BRUSH)); @@ -997,14 +1161,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT break; case WM_MOVE: - if (!scrnmng_isfullscreen()) { - if (!(GetWindowLong(hWnd, GWL_STYLE) & - (WS_MAXIMIZE | WS_MINIMIZE))) { - GetWindowRect(hWnd, &rc); - np2oscfg.winx = rc.left; - np2oscfg.winy = rc.top; - sysmng_update(SYS_UPDATEOSCFG); - } + if ((!scrnmng_isfullscreen()) && + (!(GetWindowLong(hWnd, GWL_STYLE) & + (WS_MAXIMIZE | WS_MINIMIZE)))) { + GetWindowRect(hWnd, &rc); + np2oscfg.winx = rc.left; + np2oscfg.winy = rc.top; + sysmng_update(SYS_UPDATEOSCFG); } break; @@ -1105,14 +1268,17 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT HTCAPTION, 0L)); } } +#if defined(SUPPORT_DCLOCK) else { POINT p; - if ((GetCursorPos(&p)) && (p.y >= 466)) { + if ((GetCursorPos(&p)) && + (scrnmng_isdispclockclick(&p))) { np2oscfg.clk_x++; sysmng_update(SYS_UPDATEOSCFG); dclock_reset(); } } +#endif return(DefWindowProc(hWnd, msg, wParam, lParam)); } break; @@ -1123,7 +1289,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT } break; - case WM_MBUTTONDOWN: // ver0.26 + case WM_MBUTTONDOWN: mousemng_toggle(MOUSEPROC_SYSTEM); xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); sysmng_update(SYS_UPDATECFG); @@ -1134,15 +1300,18 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT if (!scrnmng_isfullscreen()) { np2popup(hWnd, lParam); } +#if defined(SUPPORT_DCLOCK) else { POINT p; - if ((GetCursorPos(&p)) && (p.y >= 466) && - (np2oscfg.clk_x)) { + if ((GetCursorPos(&p)) && + (scrnmng_isdispclockclick(&p)) && + (np2oscfg.clk_x)) { np2oscfg.clk_fnt++; sysmng_update(SYS_UPDATEOSCFG); dclock_reset(); } } +#endif return(DefWindowProc(hWnd, msg, wParam, lParam)); } break; @@ -1175,7 +1344,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT } else if (sstpconfirm_exit()) { winuienter(); - if (MessageBox(hWnd, "Sure?", "Exit", + if (MessageBox(hWnd, _T("Sure?"), _T("Exit"), MB_ICONQUESTION | MB_YESNO) == IDYES) { b = TRUE; } @@ -1256,9 +1425,13 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT static void framereset(UINT cnt) { framecnt = 0; +#if defined(SUPPORT_DCLOCK) scrnmng_dispclock(); - kdispwin_draw((BYTE)cnt); - toolwin_draw((BYTE)cnt); +#endif + kdispwin_draw((UINT8)cnt); + skbdwin_process(); + mdbgwin_process(); + toolwin_draw((UINT8)cnt); viewer_allreload(FALSE); if (np2oscfg.DISPCLK & 3) { if (sysmng_workclockrenewal()) { @@ -1279,30 +1452,35 @@ static void processwait(UINT cnt) { soundmng_sync(); } - int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, LPSTR lpszCmdLine, int nCmdShow) { WNDCLASS wc; MSG msg; HWND hWnd; UINT i; + DWORD style; #ifdef OPENING_WAIT UINT32 tick; #endif + BOOL xrollkey; _MEM_INIT(); - GetModuleFileName(NULL, modulefile, sizeof(modulefile)); + GetModuleFileName(NULL, modulefile, NELEMENTS(modulefile)); dosio_init(); file_setcd(modulefile); - np2arg_analize(lpszCmdLine); + np2arg_analize(); initload(); toolwin_readini(); kdispwin_readini(); + skbdwin_readini(); + mdbgwin_readini(); rand_setseed((unsigned)time(NULL)); - CopyMemory(szClassName, np2oscfg.winid, 3); + szClassName[0] = (TCHAR)np2oscfg.winid[0]; + szClassName[1] = (TCHAR)np2oscfg.winid[1]; + szClassName[2] = (TCHAR)np2oscfg.winid[2]; if ((hWnd = FindWindow(szClassName, NULL)) != NULL) { sstpmsg_running(); @@ -1312,16 +1490,20 @@ int WINAPI WinMain(HINSTANCE hInstance, return(FALSE); } - hInst = hInstance; + hInst = loadextinst(hInstance); hPrev = hPreInst; +#if !defined(_WIN64) mmxflag = (havemmx())?0:MMXFLAG_NOTSUPPORT; mmxflag += (np2oscfg.disablemmx)?MMXFLAG_DISABLE:0; +#endif TRACEINIT(); - if (np2oscfg.KEYBOARD >= KEY_TYPEMAX) { // ver0.28 + xrollkey = (np2oscfg.xrollkey == 0); + if (np2oscfg.KEYBOARD >= KEY_TYPEMAX) { int keytype = GetKeyboardType(1); if ((keytype & 0xff00) == 0x0d00) { np2oscfg.KEYBOARD = KEY_PC98; + xrollkey = !xrollkey; } else if (!keytype) { np2oscfg.KEYBOARD = KEY_KEY101; @@ -1330,44 +1512,45 @@ int WINAPI WinMain(HINSTANCE hInstance, np2oscfg.KEYBOARD = KEY_KEY106; } } - keystat_reset(); + winkbd_roll(xrollkey); + winkbd_setf12(np2oscfg.F12COPY); + keystat_initialize(); - np2class_initialize(hInstance); + np2class_initialize(hInst); if (!hPreInst) { wc.style = CS_BYTEALIGNCLIENT | CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; - wc.cbWndExtra = NP2GWL_SIZE; - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)); + wc.cbWndExtra = NP2GWLP_SIZE; + wc.hInstance = hInst; + wc.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1)); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH); wc.lpszMenuName = MAKEINTRESOURCE(IDR_MAIN); wc.lpszClassName = szClassName; if (!RegisterClass(&wc)) { + unloadextinst(); + TRACETERM(); + dosio_term(); return(FALSE); } } - toolwin_initapp(hInstance); + toolwin_initapp(hInst); kdispwin_initialize(hPreInst); + skbdwin_initialize(hPreInst); + mdbgwin_initialize(hPreInst); viewer_init(hPreInst); -#if 1 - hWndMain = CreateWindowEx(0, - szClassName, np2oscfg.titles, - WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | - WS_THICKFRAME | WS_MINIMIZEBOX, - np2oscfg.winx, np2oscfg.winy, 640, 400, - NULL, NULL, hInstance, NULL); -#else // テスト - hWndMain = CreateWindowEx(0, - szClassName, np2oscfg.titles, - WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | - WS_MINIMIZEBOX, + mousemng_initialize(); + + style = WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | WS_MINIMIZEBOX; + if (np2oscfg.thickframe) { + style |= WS_THICKFRAME; + } + hWnd = CreateWindowEx(0, szClassName, np2oscfg.titles, style, np2oscfg.winx, np2oscfg.winy, 640, 400, - NULL, NULL, hInstance, NULL); -#endif - hWnd = hWndMain; + NULL, NULL, hInst, NULL); + hWndMain = hWnd; scrnmng_initialize(); xmenu_setroltate(0); @@ -1392,7 +1575,6 @@ int WINAPI WinMain(HINSTANCE hInstance, xmenu_setbtnrapid(np2cfg.BTN_RAPID); xmenu_setmsrapid(np2cfg.MOUSERAPID); xmenu_setsstp(np2oscfg.sstp); - xmenu_seti286save(np2oscfg.I286SAVE); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); @@ -1405,8 +1587,7 @@ int WINAPI WinMain(HINSTANCE hInstance, xmenu_initialize(); DrawMenuBar(hWnd); - // ver0.30 - if (file_attr_c(np2help) == (short)-1) { + if (file_attr_c(np2help) == (short)-1) { // ver0.30 EnableMenuItem(GetMenu(hWnd), IDM_HELP, MF_GRAYED); } @@ -1415,7 +1596,7 @@ int WINAPI WinMain(HINSTANCE hInstance, sysmenu_setwinsnap(np2oscfg.WINSNAP); sysmenu_setbackground(np2oscfg.background); sysmenu_setbgsound(np2oscfg.background); - sysmenu_setscrnmul(8); // ver0.26 + sysmenu_setscrnmul(8); scrnmode = 0; if (np2arg.fullscreen) { @@ -1428,16 +1609,19 @@ int WINAPI WinMain(HINSTANCE hInstance, scrnmode ^= SCRNMODE_FULLSCREEN; if (scrnmng_create(scrnmode) != SUCCESS) { if (sstpmsg_dxerror()) { - MessageBox(hWnd, "Couldn't create DirectDraw Object", + MessageBox(hWnd, _T("Couldn't create DirectDraw Object"), np2oscfg.titles, MB_OK | MB_ICONSTOP); } + unloadextinst(); + TRACETERM(); + dosio_term(); return(FALSE); } } if (soundmng_initialize() == SUCCESS) { - soundmng_pcmload(SOUND_PCMSEEK, "SEEKWAV", EXTROMIO_RES); - soundmng_pcmload(SOUND_PCMSEEK1, "SEEK1WAV", EXTROMIO_RES); + soundmng_pcmload(SOUND_PCMSEEK, OEMTEXT("SEEKWAV"), EXTROMIO_RES); + soundmng_pcmload(SOUND_PCMSEEK1, OEMTEXT("SEEK1WAV"), EXTROMIO_RES); soundmng_pcmvolume(SOUND_PCMSEEK, np2cfg.MOTORVOL); soundmng_pcmvolume(SOUND_PCMSEEK1, np2cfg.MOTORVOL); } @@ -1446,17 +1630,14 @@ int WINAPI WinMain(HINSTANCE hInstance, juliet_initialize(); } - mousemng_initialize(); if (np2oscfg.MOUSE_SW) { // ver0.30 mousemng_enable(MOUSEPROC_SYSTEM); } -// mousemng_enable(MOUSEPROC_WINUI); -// mousemng_enable(MOUSEPROC_BG); commng_initialize(); sysmng_initialize(); - joy_init(); + joymng_initialize(); pccore_init(); S98_init(); @@ -1473,12 +1654,15 @@ int WINAPI WinMain(HINSTANCE hInstance, np2opening = 0; // れじうむ +#if defined(SUPPORT_RESUME) if (np2oscfg.resume) { int id; id = flagload(str_sav, str_resume, FALSE); if (id == IDYES) { - for (i=0; i<4; i++) np2arg.disk[i] = NULL; + for (i=0; i<4; i++) { + np2arg.disk[i] = NULL; + } } else if (id == IDCANCEL) { DestroyWindow(hWnd); @@ -1488,18 +1672,19 @@ int WINAPI WinMain(HINSTANCE hInstance, sstp_destruct(); soundmng_deinitialize(); scrnmng_destroy(); + unloadextinst(); TRACETERM(); dosio_term(); viewer_term(); - return(0); + return(FALSE); } } +#endif -// リセットしてから… コマンドラインのディスク挿入。 // ver0.29 +// リセットしてから… コマンドラインのディスク挿入。 for (i=0; i<4; i++) { if (np2arg.disk[i]) { - milstr_ncpy(diskdrv_fname[i], np2arg.disk[i], MAX_PATH); - diskdrv_delay[i] = 1; + diskdrv_readyfdd((REG8)i, np2arg.disk[i], 0); } } @@ -1527,10 +1712,12 @@ int WINAPI WinMain(HINSTANCE hInstance, } else { if (np2oscfg.NOWAIT) { - joy_flash(); - mousemng_callback(); + joymng_sync(); + mousemng_sync(); pccore_exec(framecnt == 0); +#if defined(SUPPORT_DCLOCK) dclock_callback(); +#endif if (np2oscfg.DRAW_SKIP) { // nowait frame skip framecnt++; if (framecnt >= np2oscfg.DRAW_SKIP) { @@ -1546,10 +1733,12 @@ int WINAPI WinMain(HINSTANCE hInstance, } else if (np2oscfg.DRAW_SKIP) { // frame skip if (framecnt < np2oscfg.DRAW_SKIP) { - joy_flash(); - mousemng_callback(); + joymng_sync(); + mousemng_sync(); pccore_exec(framecnt == 0); +#if defined(SUPPORT_DCLOCK) dclock_callback(); +#endif framecnt++; } else { @@ -1559,10 +1748,12 @@ int WINAPI WinMain(HINSTANCE hInstance, else { // auto skip if (!waitcnt) { UINT cnt; - joy_flash(); - mousemng_callback(); + joymng_sync(); + mousemng_sync(); pccore_exec(framecnt == 0); +#if defined(SUPPORT_DCLOCK) dclock_callback(); +#endif framecnt++; cnt = timing_getcount(); if (framecnt > cnt) { @@ -1602,18 +1793,22 @@ int WINAPI WinMain(HINSTANCE hInstance, } toolwin_destroy(); kdispwin_destroy(); + skbdwin_destroy(); + mdbgwin_destroy(); pccore_cfgupdate(); mousemng_disable(MOUSEPROC_WINUI); S98_trash(); +#if defined(SUPPORT_RESUME) if (np2oscfg.resume) { flagsave(str_sav); } else { flagdelete(str_sav); } +#endif juliet_YMF288Reset(); pccore_term(); @@ -1629,14 +1824,19 @@ int WINAPI WinMain(HINSTANCE hInstance, initsave(); toolwin_writeini(); kdispwin_writeini(); + skbdwin_writeini(); + mdbgwin_writeini(); } + skbdwin_deinitialize(); + + unloadextinst(); TRACETERM(); _MEM_USED("report.txt"); dosio_term(); - viewer_term(); // ver0.30 + viewer_term(); // ver0.30 - return(msg.wParam); + return((int)msg.wParam); }