--- xmil/win9x/xmil.cpp 2004/08/12 17:57:36 1.16 +++ xmil/win9x/xmil.cpp 2004/08/13 06:49:31 1.19 @@ -23,7 +23,6 @@ #include "pccore.h" #include "iocore.h" #include "timing.h" -#include "keystat.h" #if defined(SUPPORT_RESUME) || defined(SUPPORT_STATSAVE) #include "statsave.h" #endif @@ -102,9 +101,9 @@ static void winuileave(void) { static void dispbmp(HINSTANCE hinst, HDC hdc, const OEMCHAR *res, int x, int y) { - HBITMAP hbmp; - BITMAP bmp; - HDC hmdc; + HBITMAP hbmp; + BITMAP bmp; + HDC hmdc; hbmp = LoadBitmap(hinst, res); GetObject(hbmp, sizeof(bmp), &bmp); @@ -118,14 +117,18 @@ static void dispbmp(HINSTANCE hinst, HDC // ---- -#if defined(SUPPORT_RESUME) || defined(SUPPORT_STATSAVE) +#if defined(SUPPORT_RESUME) static const OEMCHAR xmilresumeext[] = OEMTEXT(".sav"); +static const OEMCHAR str_resume[] = OEMTEXT("Resume"); #endif #if defined(SUPPORT_STATSAVE) static const OEMCHAR xmilflagext[] = OEMTEXT(".sv%u"); +static const OEMCHAR str_statload[] = OEMTEXT("Status Load"); #endif #if defined(SUPPORT_RESUME) || defined(SUPPORT_STATSAVE) +static const OEMCHAR str_loaderr[] = OEMTEXT("Couldn't restart"); +static const OEMCHAR str_conflict[] = OEMTEXT("Conflict!\n\n%s\nContinue?"); static void getstatfilename(OEMCHAR *path, const OEMCHAR *ext, UINT size) { @@ -157,24 +160,24 @@ static void flagdelete(const OEMCHAR *ex file_delete(path); } -static int flagload(const char *ext, const char *title, BOOL force) { +static int flagload(const OEMCHAR *ext, const OEMCHAR *title, BRESULT force) { int ret; int id; OEMCHAR path[MAX_PATH]; OEMCHAR buf[1024]; + OEMCHAR buf2[1024 + 32]; getstatfilename(path, ext, NELEMENTS(path)); winuienter(); id = IDYES; ret = statsave_check(path, buf, NELEMENTS(buf)); if (ret & (~STATFLAG_DISKCHG)) { - MessageBox(hWndMain, "Couldn't restart", title, MB_OK | MB_ICONSTOP); + MessageBox(hWndMain, str_loaderr, title, MB_OK | MB_ICONSTOP); id = IDNO; } else if ((!force) && (ret & STATFLAG_DISKCHG)) { - char buf2[1024 + 256]; - wsprintf(buf2, "Conflict!\n\n%s\nContinue?", buf); + OEMSPRINTF(buf2, str_conflict, buf); id = MessageBox(hWndMain, buf2, title, MB_YESNOCANCEL | MB_ICONQUESTION); } @@ -196,7 +199,9 @@ static int flagload(const char *ext, con static void xmilcmd(HWND hWnd, UINT cmd) { UINT update; +#if defined(SUPPORT_STATSAVE) OEMCHAR ext[16]; +#endif update = 0; switch(cmd) { @@ -245,6 +250,26 @@ static void xmilcmd(HWND hWnd, UINT cmd) diskdrv_setfdd(1, NULL, 0); break; + case IDM_FDD2OPEN: + winuienter(); + dialog_changefdd(hWnd, 2); + winuileave(); + break; + + case IDM_FDD2EJECT: + diskdrv_setfdd(2, NULL, 0); + break; + + case IDM_FDD3OPEN: + winuienter(); + dialog_changefdd(hWnd, 3); + winuileave(); + break; + + case IDM_FDD3EJECT: + diskdrv_setfdd(3, NULL, 0); + break; + case IDM_TURBOZ: menu_setiplrom(3); update = SYS_UPDATECFG; @@ -422,7 +447,7 @@ static void xmilcmd(HWND hWnd, UINT cmd) else if ((cmd >= IDM_FLAGLOAD) && (cmd < (IDM_FLAGLOAD + SUPPORT_STATSAVE))) { OEMSPRINTF(ext, xmilflagext, cmd - IDM_FLAGLOAD); - flagload(ext, "Status Load", TRUE); + flagload(ext, str_statload, TRUE); } #endif break;