|
|
| version 1.12, 2004/02/18 03:24:48 | version 1.18, 2004/06/20 04:32:18 |
|---|---|
| Line 33 | Line 33 |
| #include "vramhdl.h" | #include "vramhdl.h" |
| #include "menubase.h" | #include "menubase.h" |
| #include "sysmenu.h" | #include "sysmenu.h" |
| #if defined(SUPPORT_SOFTKBD) | |
| #include "softkbd.h" | #include "softkbd.h" |
| #endif | |
| static const TCHAR szAppCaption[] = STRLITERAL("Neko Project II"); | static const TCHAR szAppCaption[] = STRLITERAL("Neko Project II"); |
| Line 53 static const TCHAR szClassName[] = STRLI | Line 51 static const TCHAR szClassName[] = STRLI |
| HWND hWndMain; | HWND hWndMain; |
| HINSTANCE hInst; | HINSTANCE hInst; |
| HINSTANCE hPrev; | HINSTANCE hPrev; |
| char modulefile[MAX_PATH]; | OEMCHAR modulefile[MAX_PATH]; |
| GXKeyList gx_keylist; | GXKeyList gx_keylist; |
| enum { | enum { |
| Line 109 static int flagload(const char *ext, con | Line 107 static int flagload(const char *ext, con |
| getstatfilename(path, ext, sizeof(path)); | getstatfilename(path, ext, sizeof(path)); |
| id = DID_YES; | id = DID_YES; |
| ret = statsave_check(path, buf, sizeof(buf)); | ret = statsave_check(path, buf, sizeof(buf)); |
| if (ret & (~NP2FLAG_DISKCHG)) { | if (ret & (~STATFLAG_DISKCHG)) { |
| menumbox("Couldn't restart", title, MBOX_OK | MBOX_ICONSTOP); | menumbox("Couldn't restart", title, MBOX_OK | MBOX_ICONSTOP); |
| id = DID_NO; | id = DID_NO; |
| } | } |
| else if ((!force) && (ret & NP2FLAG_DISKCHG)) { | else if ((!force) && (ret & STATFLAG_DISKCHG)) { |
| SPRINTF(buf2, "Conflict!\n\n%s\nContinue?", buf); | SPRINTF(buf2, "Conflict!\n\n%s\nContinue?", buf); |
| id = menumbox(buf2, title, MBOX_YESNOCAN | MBOX_ICONQUESTION); | id = menumbox(buf2, title, MBOX_YESNOCAN | MBOX_ICONQUESTION); |
| } | } |
| Line 202 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 200 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| } | } |
| else { | else { |
| #if defined(SUPPORT_SOFTKBD) | #if defined(SUPPORT_SOFTKBD) |
| softkbd_down(LOWORD(lParam), HIWORD(lParam)); | softkbd_down(LOWORD(lParam), HIWORD(lParam) - 200); |
| #endif | #endif |
| } | } |
| } | } |
| Line 318 static void processwait(UINT cnt) { | Line 316 static void processwait(UINT cnt) { |
| // ---- | // ---- |
| #if !defined(UNICODE) | #if defined(UNICODE) && defined(OSLANG_SJIS) |
| #define GetModuleFileName_A(a, b, c) GetModuleFileName(a, b, c) | static DWORD _GetModuleFileName(HMODULE hModule, |
| #else | OEMCHAR *lpFileName, DWORD nSize) { |
| static DWORD GetModuleFileName_A(HMODULE hModule, | |
| LPSTR lpFileName, DWORD nSize) { | |
| TCHAR *FileNameW; | UINT16 ucs2[MAX_PATH]; |
| DWORD len; | |
| if (nSize) { | GetModuleFileName(hModule, ucs2, NELEMENTS(ucs2)); |
| FileNameW = (TCHAR *)_MALLOC(nSize * sizeof(TCHAR), "ModuleFile"); | nSize = WideCharToMultiByte(CP_ACP, 0, ucs2, -1, |
| if (FileNameW) { | |
| len = GetModuleFileName(hModule, FileNameW, nSize); | |
| nSize = WideCharToMultiByte(CP_ACP, 0, FileNameW, -1, | |
| lpFileName, nSize, NULL, NULL); | lpFileName, nSize, NULL, NULL); |
| if (nSize) { | if (nSize) { |
| nSize--; | nSize--; |
| } | |
| _MFREE(FileNameW); | |
| } | |
| else { | |
| nSize = 0; | |
| } | |
| } | } |
| return(nSize); | return(nSize); |
| } | } |
| #elif defined(OSLANG_UTF8) | |
| static DWORD _GetModuleFileName(HMODULE hModule, | |
| OEMCHAR *lpFileName, DWORD nSize) { | |
| UINT16 ucs2[MAX_PATH]; | |
| GetModuleFileName(hModule, ucs2, NELEMENTS(ucs2)); | |
| nSize = ucscnv_ucs2toutf8(lpFileName, nSize, ucs2, (UINT)-1); | |
| if (nSize) { | |
| nSize--; | |
| } | |
| return(nSize); | |
| } | |
| #else | |
| #define _GetModuleFileName(a, b, c) GetModuleFileName(a, b, c) | |
| #endif | #endif |
| int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | |
| LPTSTR lpszCmdLine, int nCmdShow) { | |
| #if defined(_WIN32_WCE) | |
| int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | |
| LPWSTR lpszCmdLine, int nCmdShow) | |
| #elif defined(UNICODE) | |
| int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | |
| LPSTR lpszCmdLine, int nCmdShow) | |
| #else | |
| int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPreInst, | |
| LPSTR lpszCmdLine, int nCmdShow) | |
| #endif | |
| { | |
| HWND hWnd; | HWND hWnd; |
| WNDCLASS np2; | WNDCLASS np2; |
| int id; | int id; |
| Line 366 int WINAPI WinMain(HINSTANCE hInstance, | Line 376 int WINAPI WinMain(HINSTANCE hInstance, |
| return(0); | return(0); |
| } | } |
| GetModuleFileName_A(NULL, modulefile, sizeof(modulefile)); | _GetModuleFileName(NULL, modulefile, sizeof(modulefile)); |
| dosio_init(); | dosio_init(); |
| file_setcd(modulefile); | file_setcd(modulefile); |
| initload(); | initload(); |
| Line 378 int WINAPI WinMain(HINSTANCE hInstance, | Line 388 int WINAPI WinMain(HINSTANCE hInstance, |
| TRACEINIT(); | TRACEINIT(); |
| inputmng_init(); | inputmng_init(); |
| keystat_reset(); | keystat_initialize(); |
| // if (!hPreInst) { | // if (!hPreInst) { |
| np2.style = CS_HREDRAW | CS_VREDRAW; | np2.style = CS_HREDRAW | CS_VREDRAW; |