--- np2/win9x/np2.cpp 2005/03/19 20:46:07 1.60 +++ np2/win9x/np2.cpp 2006/12/17 02:30:11 1.65 @@ -51,7 +51,7 @@ #define OPENING_WAIT 1500 #endif -static OEMCHAR szClassName[] = OEMTEXT("NP2-MainWindow"); +static TCHAR szClassName[] = _T("NP2-MainWindow"); HWND hWndMain; HINSTANCE hInst; HINSTANCE hPrev; @@ -291,7 +291,8 @@ static int flagload(const OEMCHAR *ext, id = IDYES; ret = statsave_check(path, buf, NELEMENTS(buf)); if (ret & (~STATFLAG_DISKCHG)) { - MessageBox(hWndMain, OEMTEXT("Couldn't restart"), title, MB_OK | MB_ICONSTOP); + MessageBox(hWndMain, _T("Couldn't restart"), title, + MB_OK | MB_ICONSTOP); id = IDNO; } else if ((!force) && (ret & STATFLAG_DISKCHG)) { @@ -336,9 +337,11 @@ static void np2popup(HWND hWnd, LPARAM l static void np2cmd(HWND hWnd, UINT16 cmd) { - UINT update; - BOOL b; + HINSTANCE hInst; + UINT update; + BOOL b; + hInst = (HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE); update = 0; switch(cmd) { case IDM_RESET: @@ -442,25 +445,38 @@ static void np2cmd(HWND hWnd, UINT16 cmd toolwin_setfdd(3, NULL); break; - case IDM_SASI1OPEN: + case IDM_IDE0OPEN: winuienter(); dialog_changehdd(hWnd, 0x00); winuileave(); break; - case IDM_SASI1EJECT: + case IDM_IDE0EJECT: diskdrv_sethdd(0x00, NULL); break; - case IDM_SASI2OPEN: + case IDM_IDE1OPEN: winuienter(); dialog_changehdd(hWnd, 0x01); winuileave(); break; - case IDM_SASI2EJECT: + case IDM_IDE1EJECT: diskdrv_sethdd(0x01, NULL); break; + +#if defined(SUPPORT_IDEIO) + case IDM_IDE2OPEN: + winuienter(); + dialog_changehdd(hWnd, 0x02); + winuileave(); + break; + + case IDM_IDE2EJECT: + diskdrv_sethdd(0x02, NULL); + break; +#endif + #if defined(SUPPORT_SCSI) case IDM_SCSI0OPEN: winuienter(); @@ -502,6 +518,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd diskdrv_sethdd(0x23, NULL); break; #endif + case IDM_WINDOW: changescreen(scrnmode & (~SCRNMODE_FULLSCREEN)); break; @@ -875,7 +892,7 @@ static void np2cmd(HWND hWnd, UINT16 cmd update |= SYS_UPDATECFG; break; - case IDM_I286SAVE: + case IDM_CPUSAVE: debugsub_status(); break; @@ -1080,7 +1097,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT GetClientRect(hWnd, &rect); width = rect.right - rect.left; height = rect.bottom - rect.top; - hbmp = LoadBitmap(hinst, OEMTEXT("NP2BMP")); + hbmp = LoadBitmap(hinst, _T("NP2BMP")); GetObject(hbmp, sizeof(BITMAP), &bmp); hbrush = (HBRUSH)SelectObject(hdc, GetStockObject(BLACK_BRUSH)); @@ -1283,7 +1300,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT } else if (sstpconfirm_exit()) { winuienter(); - if (MessageBox(hWnd, OEMTEXT("Sure?"), OEMTEXT("Exit"), + if (MessageBox(hWnd, _T("Sure?"), _T("Exit"), MB_ICONQUESTION | MB_YESNO) == IDYES) { b = TRUE; } @@ -1416,7 +1433,9 @@ int WINAPI WinMain(HINSTANCE hInstance, rand_setseed((unsigned)time(NULL)); - CopyMemory(szClassName, np2oscfg.winid, 3 * sizeof(OEMCHAR)); + 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();