|
|
| version 1.36, 2004/01/24 18:20:06 | version 1.52, 2004/05/21 08:40:27 |
|---|---|
| Line 25 | Line 25 |
| #include "sstpmsg.h" | #include "sstpmsg.h" |
| #include "dclock.h" | #include "dclock.h" |
| #include "toolwin.h" | #include "toolwin.h" |
| #ifdef USE_ROMEO | |
| #include "juliet.h" | #include "juliet.h" |
| #endif | |
| #include "np2class.h" | #include "np2class.h" |
| #include "dialog.h" | #include "dialog.h" |
| #include "memory.h" | #include "cpucore.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "pc9861k.h" | #include "pc9861k.h" |
| Line 43 | Line 41 |
| #include "diskdrv.h" | #include "diskdrv.h" |
| #include "fddfile.h" | #include "fddfile.h" |
| #include "timing.h" | #include "timing.h" |
| #include "keystat.h" | |
| #include "debugsub.h" | #include "debugsub.h" |
| #include "keydisp.h" | #include "subwind.h" |
| #include "kdispwin.h" | |
| #include "viewer.h" | #include "viewer.h" |
| Line 62 static char szClassName[] = "NP2-MainWi | Line 60 static char szClassName[] = "NP2-MainWi |
| BOOL winui_en; | BOOL winui_en; |
| NP2OSCFG np2oscfg = { | NP2OSCFG np2oscfg = { |
| "Neko Project II", "NP2", | #if !defined(SUPPORT_PC9821) |
| "Neko Project II", | |
| #else | |
| "Neko Project 21", | |
| #endif | |
| "NP2", | |
| CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 1, 0, 0, | CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 1, 0, 0, |
| 0, 0, KEY_UNKNOWN, 0, | 0, 0, KEY_UNKNOWN, 0, |
| 0, 0, 0, {1, 2, 2, 1}, | 0, 0, 0, {1, 2, 2, 1}, |
| Line 71 static char szClassName[] = "NP2-MainWi | Line 74 static char szClassName[] = "NP2-MainWi |
| {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 | {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 |
| {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 | {0, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 |
| 0xffffff, 0xffbf6a, 0, 0, | 0xffffff, 0xffbf6a, 0, 0, |
| 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // ver0.73 | 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
| char fddfolder[MAX_PATH]; | char fddfolder[MAX_PATH]; |
| char hddfolder[MAX_PATH]; | char hddfolder[MAX_PATH]; |
| Line 108 static void winuileave(void) { | Line 111 static void winuileave(void) { |
| WINLOCEX np2_winlocexallwin(HWND base) { | WINLOCEX np2_winlocexallwin(HWND base) { |
| HWND list[3]; | |
| UINT i; | UINT i; |
| UINT cnt; | |
| HWND list[5]; | |
| list[0] = hWndMain; | cnt = 0; |
| list[1] = toolwin_gethwnd(); | list[cnt++] = hWndMain; |
| list[2] = kdispwin_gethwnd(); | list[cnt++] = toolwin_gethwnd(); |
| for (i=0; i<3; i++) { | list[cnt++] = kdispwin_gethwnd(); |
| list[cnt++] = skbdwin_gethwnd(); | |
| list[cnt++] = mdbgwin_gethwnd(); | |
| for (i=0; i<cnt; i++) { | |
| if (list[i] == base) { | if (list[i] == base) { |
| list[i] = NULL; | list[i] = NULL; |
| } | } |
| Line 122 WINLOCEX np2_winlocexallwin(HWND base) { | Line 129 WINLOCEX np2_winlocexallwin(HWND base) { |
| if (base != hWndMain) { // hWndMainのみ全体移動 | if (base != hWndMain) { // hWndMainのみ全体移動 |
| base = NULL; | base = NULL; |
| } | } |
| return(winlocex_create(base, list, 3)); | return(winlocex_create(base, list, cnt)); |
| } | } |
| static void changescreen(BYTE newmode) { | static void changescreen(BYTE newmode) { |
| Line 144 static void changescreen(BYTE newmode) { | Line 151 static void changescreen(BYTE newmode) { |
| if (renewal & SCRNMODE_FULLSCREEN) { | if (renewal & SCRNMODE_FULLSCREEN) { |
| toolwin_destroy(); | toolwin_destroy(); |
| kdispwin_destroy(); | kdispwin_destroy(); |
| skbdwin_destroy(); | |
| mdbgwin_destroy(); | |
| } | } |
| else if (renewal & SCRNMODE_ROTATEMASK) { | else if (renewal & SCRNMODE_ROTATEMASK) { |
| wlex = np2_winlocexallwin(hWndMain); | wlex = np2_winlocexallwin(hWndMain); |
| Line 205 static void wincentering(HWND hWnd) { | Line 214 static void wincentering(HWND hWnd) { |
| MoveWindow(hWndMain, np2oscfg.winx, np2oscfg.winy, width, height, TRUE); | MoveWindow(hWndMain, np2oscfg.winx, np2oscfg.winy, width, height, TRUE); |
| } | } |
| void np2active_renewal(void) { // ver0.30 | void np2active_renewal(void) { // ver0.30 |
| if (np2break & (~NP2BREAK_MAIN)) { | if (np2break & (~NP2BREAK_MAIN)) { |
| np2stopemulate = 2; | np2stopemulate = 2; |
| Line 231 void np2active_renewal(void) { / | Line 240 void np2active_renewal(void) { / |
| } | } |
| } | } |
| // ---- resume and statsave | |
| #if defined(SUPPORT_RESUME) || defined(SUPPORT_STATSAVE) | |
| static void getstatfilename(char *path, const char *ext, int size) { | static void getstatfilename(char *path, const char *ext, int size) { |
| file_cpyname(path, modulefile, size); | file_cpyname(path, modulefile, size); |
| Line 273 static int flagload(const char *ext, con | Line 286 static int flagload(const char *ext, con |
| winuienter(); | winuienter(); |
| id = IDYES; | id = IDYES; |
| ret = statsave_check(path, buf, sizeof(buf)); | ret = statsave_check(path, buf, sizeof(buf)); |
| if (ret & (~NP2FLAG_DISKCHG)) { | if (ret & (~STATFLAG_DISKCHG)) { |
| MessageBox(hWndMain, "Couldn't restart", title, MB_OK | MB_ICONSTOP); | MessageBox(hWndMain, "Couldn't restart", title, MB_OK | MB_ICONSTOP); |
| id = IDNO; | id = IDNO; |
| } | } |
| else if ((!force) && (ret & NP2FLAG_DISKCHG)) { | else if ((!force) && (ret & STATFLAG_DISKCHG)) { |
| char buf2[1024 + 256]; | char buf2[1024 + 256]; |
| wsprintf(buf2, "Conflict!\n\n%s\nContinue?", buf); | wsprintf(buf2, "Conflict!\n\n%s\nContinue?", buf); |
| id = MessageBox(hWndMain, buf2, title, | id = MessageBox(hWndMain, buf2, title, |
| Line 293 static int flagload(const char *ext, con | Line 306 static int flagload(const char *ext, con |
| winuileave(); | winuileave(); |
| return(id); | return(id); |
| } | } |
| #endif | |
| // ---- proc | // ---- proc |
| Line 316 static void np2popup(HWND hWnd, LPARAM l | Line 330 static void np2popup(HWND hWnd, LPARAM l |
| DestroyMenu(hMenu); | DestroyMenu(hMenu); |
| } | } |
| // extern "C" void iptrace_out(void); | |
| static void np2cmd(HWND hWnd, UINT16 cmd) { | static void np2cmd(HWND hWnd, UINT16 cmd) { |
| UINT update; | UINT update; |
| Line 340 static void np2cmd(HWND hWnd, UINT16 cmd | Line 352 static void np2cmd(HWND hWnd, UINT16 cmd |
| } | } |
| if (b) { | if (b) { |
| sstpmsg_reset(); | sstpmsg_reset(); |
| juliet_YMF288Reset(); | |
| pccore_cfgupdate(); | pccore_cfgupdate(); |
| pccore_reset(); | pccore_reset(); |
| } | } |
| Line 391 static void np2cmd(HWND hWnd, UINT16 cmd | Line 404 static void np2cmd(HWND hWnd, UINT16 cmd |
| toolwin_setfdd(1, NULL); | toolwin_setfdd(1, NULL); |
| break; | break; |
| case IDM_FDD3OPEN: | |
| winuienter(); | |
| dialog_changefdd(hWnd, 2); | |
| winuileave(); | |
| break; | |
| case IDM_FDD3EJECT: | |
| diskdrv_setfdd(2, NULL, 0); | |
| toolwin_setfdd(2, NULL); | |
| break; | |
| case IDM_FDD4OPEN: | |
| winuienter(); | |
| dialog_changefdd(hWnd, 3); | |
| winuileave(); | |
| break; | |
| case IDM_FDD4EJECT: | |
| diskdrv_setfdd(3, NULL, 0); | |
| toolwin_setfdd(3, NULL); | |
| break; | |
| case IDM_SASI1OPEN: | case IDM_SASI1OPEN: |
| winuienter(); | winuienter(); |
| dialog_changehdd(hWnd, 0x00); | dialog_changehdd(hWnd, 0x00); |
| Line 567 static void np2cmd(HWND hWnd, UINT16 cmd | Line 602 static void np2cmd(HWND hWnd, UINT16 cmd |
| case IDM_F12MOUSE: | case IDM_F12MOUSE: |
| xmenu_setf12copy(0); | xmenu_setf12copy(0); |
| winkbd_resetf12(); | winkbd_resetf12(); |
| winkbd_setf12(0); | |
| update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; |
| break; | break; |
| case IDM_F12COPY: | case IDM_F12COPY: |
| xmenu_setf12copy(1); | xmenu_setf12copy(1); |
| winkbd_resetf12(); | winkbd_resetf12(); |
| winkbd_setf12(1); | |
| update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; |
| break; | break; |
| case IDM_F12STOP: | case IDM_F12STOP: |
| xmenu_setf12copy(2); | xmenu_setf12copy(2); |
| winkbd_resetf12(); | winkbd_resetf12(); |
| winkbd_setf12(2); | |
| update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; |
| break; | break; |
| case IDM_F12EQU: | case IDM_F12EQU: |
| xmenu_setf12copy(3); | xmenu_setf12copy(3); |
| winkbd_resetf12(); | winkbd_resetf12(); |
| winkbd_setf12(3); | |
| update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; |
| break; | break; |
| case IDM_F12COMMA: | case IDM_F12COMMA: |
| xmenu_setf12copy(4); | xmenu_setf12copy(4); |
| winkbd_resetf12(); | winkbd_resetf12(); |
| winkbd_setf12(4); | |
| update |= SYS_UPDATEOSCFG; | |
| break; | |
| case IDM_USERKEY1: | |
| xmenu_setf12copy(5); | |
| winkbd_resetf12(); | |
| winkbd_setf12(5); | |
| update |= SYS_UPDATEOSCFG; | |
| break; | |
| case IDM_USERKEY2: | |
| xmenu_setf12copy(6); | |
| winkbd_resetf12(); | |
| winkbd_setf12(6); | |
| update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; |
| break; | break; |
| Line 698 static void np2cmd(HWND hWnd, UINT16 cmd | Line 752 static void np2cmd(HWND hWnd, UINT16 cmd |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| break; | break; |
| case IDM_MEM116: | |
| xmenu_setextmem(11); | |
| update |= SYS_UPDATECFG; | |
| break; | |
| case IDM_MEM136: | |
| xmenu_setextmem(13); | |
| update |= SYS_UPDATECFG; | |
| break; | |
| case IDM_MOUSE: | case IDM_MOUSE: |
| mousemng_toggle(MOUSEPROC_SYSTEM); | mousemng_toggle(MOUSEPROC_SYSTEM); |
| xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); |
| Line 717 static void np2cmd(HWND hWnd, UINT16 cmd | Line 781 static void np2cmd(HWND hWnd, UINT16 cmd |
| winuileave(); | winuileave(); |
| break; | break; |
| case IDM_MIDIPANIC: // ver0.29 | case IDM_MIDIPANIC: |
| rs232c_midipanic(); | rs232c_midipanic(); |
| mpu98ii_midipanic(); | mpu98ii_midipanic(); |
| pc9861k_midipanic(); | pc9861k_midipanic(); |
| Line 734 static void np2cmd(HWND hWnd, UINT16 cmd | Line 798 static void np2cmd(HWND hWnd, UINT16 cmd |
| dialog_writebmp(hWnd); | dialog_writebmp(hWnd); |
| winuileave(); | winuileave(); |
| break; | break; |
| #if defined(SUPPPORT_S98) | |
| case IDM_S98LOGGING: | case IDM_S98LOGGING: |
| winuienter(); | winuienter(); |
| dialog_s98(hWnd); | dialog_s98(hWnd); |
| winuileave(); | winuileave(); |
| break; | break; |
| #endif | |
| #if defined(SUPPORT_WAVEREC) | |
| case IDM_WAVEREC: | |
| winuienter(); | |
| dialog_waverec(hWnd); | |
| winuileave(); | |
| break; | |
| #endif | |
| case IDM_DISPCLOCK: | case IDM_DISPCLOCK: |
| xmenu_setdispclk(np2oscfg.DISPCLK ^ 1); | xmenu_setdispclk(np2oscfg.DISPCLK ^ 1); |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| Line 808 static void np2cmd(HWND hWnd, UINT16 cmd | Line 879 static void np2cmd(HWND hWnd, UINT16 cmd |
| break; | break; |
| default: | default: |
| #if defined(SUPPORT_STATSAVE) | |
| if ((cmd >= IDM_FLAGSAVE) && | if ((cmd >= IDM_FLAGSAVE) && |
| (cmd < (IDM_FLAGSAVE + STATSAVEMAX))) { | (cmd < (IDM_FLAGSAVE + SUPPORT_STATSAVE))) { |
| char ext[4]; | char ext[4]; |
| wsprintf(ext, np2flagext, cmd - IDM_FLAGSAVE); | SPRINTF(ext, np2flagext, cmd - IDM_FLAGSAVE); |
| flagsave(ext); | flagsave(ext); |
| } | } |
| if ((cmd >= IDM_FLAGLOAD) && | else if ((cmd >= IDM_FLAGLOAD) && |
| (cmd < (IDM_FLAGLOAD + STATSAVEMAX))) { | (cmd < (IDM_FLAGLOAD + SUPPORT_STATSAVE))) { |
| char ext[4]; | char ext[4]; |
| wsprintf(ext, np2flagext, cmd - IDM_FLAGLOAD); | SPRINTF(ext, np2flagext, cmd - IDM_FLAGLOAD); |
| flagload(ext, "Status Load", TRUE); | flagload(ext, "Status Load", TRUE); |
| } | } |
| #endif | |
| break; | break; |
| } | } |
| sysmng_update(update); | sysmng_update(update); |
| Line 859 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 932 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| update |= SYS_UPDATEOSCFG; | update |= SYS_UPDATEOSCFG; |
| break; | break; |
| #if defined(SUPPORT_KEYDISP) | |
| case IDM_KEYDISP: | case IDM_KEYDISP: |
| sysmenu_setkeydisp(np2oscfg.keydisp ^ 1); | sysmenu_setkeydisp(np2oscfg.keydisp ^ 1); |
| if (np2oscfg.keydisp) { | if (np2oscfg.keydisp) { |
| Line 868 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 942 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| kdispwin_destroy(); | kdispwin_destroy(); |
| } | } |
| break; | 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: | case IDM_SCREENCENTER: |
| if ((!scrnmng_isfullscreen()) && | if ((!scrnmng_isfullscreen()) && |
| (!(GetWindowLong(hWnd, GWL_STYLE) & | (!(GetWindowLong(hWnd, GWL_STYLE) & |
| Line 903 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 987 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| viewer_open(); | viewer_open(); |
| break; | break; |
| case IDM_SCRNMUL4: // ver0.26 | case IDM_SCRNMUL4: |
| case IDM_SCRNMUL6: | case IDM_SCRNMUL6: |
| case IDM_SCRNMUL8: | case IDM_SCRNMUL8: |
| case IDM_SCRNMUL10: | case IDM_SCRNMUL10: |
| Line 931 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1015 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| if (subwin) { | if (subwin) { |
| ShowWindow(subwin, SW_SHOWNOACTIVATE); | 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)); | return(DefWindowProc(hWnd, msg, wParam, lParam)); |
| default: | default: |
| Line 998 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1090 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| break; | break; |
| case WM_MOVE: | case WM_MOVE: |
| if (!scrnmng_isfullscreen()) { | if ((!scrnmng_isfullscreen()) && |
| if (!(GetWindowLong(hWnd, GWL_STYLE) & | (!(GetWindowLong(hWnd, GWL_STYLE) & |
| (WS_MAXIMIZE | WS_MINIMIZE))) { | (WS_MAXIMIZE | WS_MINIMIZE)))) { |
| GetWindowRect(hWnd, &rc); | GetWindowRect(hWnd, &rc); |
| np2oscfg.winx = rc.left; | np2oscfg.winx = rc.left; |
| np2oscfg.winy = rc.top; | np2oscfg.winy = rc.top; |
| sysmng_update(SYS_UPDATEOSCFG); | sysmng_update(SYS_UPDATEOSCFG); |
| } | |
| } | } |
| break; | break; |
| Line 1124 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1215 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| } | } |
| break; | break; |
| case WM_MBUTTONDOWN: // ver0.26 | case WM_MBUTTONDOWN: |
| mousemng_toggle(MOUSEPROC_SYSTEM); | mousemng_toggle(MOUSEPROC_SYSTEM); |
| xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); | xmenu_setmouse(np2oscfg.MOUSE_SW ^ 1); |
| sysmng_update(SYS_UPDATECFG); | sysmng_update(SYS_UPDATECFG); |
| Line 1207 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 1298 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| break; | break; |
| case NP2CMD_RESET: | case NP2CMD_RESET: |
| juliet_YMF288Reset(); | |
| pccore_cfgupdate(); | pccore_cfgupdate(); |
| pccore_reset(); | pccore_reset(); |
| break; | break; |
| Line 1258 static void framereset(UINT cnt) { | Line 1350 static void framereset(UINT cnt) { |
| framecnt = 0; | framecnt = 0; |
| scrnmng_dispclock(); | scrnmng_dispclock(); |
| kdispwin_draw((BYTE)cnt); | kdispwin_draw((BYTE)cnt); |
| skbdwin_process(); | |
| mdbgwin_process(); | |
| toolwin_draw((BYTE)cnt); | toolwin_draw((BYTE)cnt); |
| viewer_allreload(FALSE); | viewer_allreload(FALSE); |
| if (np2oscfg.DISPCLK & 3) { | if (np2oscfg.DISPCLK & 3) { |
| Line 1299 int WINAPI WinMain(HINSTANCE hInstance, | Line 1393 int WINAPI WinMain(HINSTANCE hInstance, |
| initload(); | initload(); |
| toolwin_readini(); | toolwin_readini(); |
| kdispwin_readini(); | kdispwin_readini(); |
| skbdwin_readini(); | |
| mdbgwin_readini(); | |
| rand_setseed((unsigned)time(NULL)); | rand_setseed((unsigned)time(NULL)); |
| Line 1318 int WINAPI WinMain(HINSTANCE hInstance, | Line 1414 int WINAPI WinMain(HINSTANCE hInstance, |
| mmxflag += (np2oscfg.disablemmx)?MMXFLAG_DISABLE:0; | mmxflag += (np2oscfg.disablemmx)?MMXFLAG_DISABLE:0; |
| TRACEINIT(); | TRACEINIT(); |
| if (np2oscfg.KEYBOARD >= KEY_TYPEMAX) { // ver0.28 | if (np2oscfg.KEYBOARD >= KEY_TYPEMAX) { |
| int keytype = GetKeyboardType(1); | int keytype = GetKeyboardType(1); |
| if ((keytype & 0xff00) == 0x0d00) { | if ((keytype & 0xff00) == 0x0d00) { |
| np2oscfg.KEYBOARD = KEY_PC98; | np2oscfg.KEYBOARD = KEY_PC98; |
| Line 1330 int WINAPI WinMain(HINSTANCE hInstance, | Line 1426 int WINAPI WinMain(HINSTANCE hInstance, |
| np2oscfg.KEYBOARD = KEY_KEY106; | np2oscfg.KEYBOARD = KEY_KEY106; |
| } | } |
| } | } |
| keystat_reset(); | winkbd_roll(np2oscfg.KEYBOARD != KEY_PC98); |
| winkbd_setf12(np2oscfg.F12COPY); | |
| keystat_initialize(); | |
| np2class_initialize(hInstance); | np2class_initialize(hInstance); |
| if (!hPreInst) { | if (!hPreInst) { |
| Line 1350 int WINAPI WinMain(HINSTANCE hInstance, | Line 1448 int WINAPI WinMain(HINSTANCE hInstance, |
| } | } |
| toolwin_initapp(hInstance); | toolwin_initapp(hInstance); |
| kdispwin_initialize(hPreInst); | kdispwin_initialize(hPreInst); |
| skbdwin_initialize(hPreInst); | |
| mdbgwin_initialize(hPreInst); | |
| viewer_init(hPreInst); | viewer_init(hPreInst); |
| #if 1 | mousemng_initialize(); |
| hWndMain = CreateWindowEx(0, | |
| szClassName, np2oscfg.titles, | hWnd = CreateWindowEx(0, szClassName, np2oscfg.titles, |
| WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | | WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | |
| WS_THICKFRAME | WS_MINIMIZEBOX, | WS_THICKFRAME | WS_MINIMIZEBOX, |
| np2oscfg.winx, np2oscfg.winy, 640, 400, | np2oscfg.winx, np2oscfg.winy, 640, 400, |
| NULL, NULL, hInstance, NULL); | NULL, NULL, hInstance, NULL); |
| #else // テスト | hWndMain = hWnd; |
| hWndMain = CreateWindowEx(0, | |
| szClassName, np2oscfg.titles, | |
| WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | | |
| WS_MINIMIZEBOX, | |
| np2oscfg.winx, np2oscfg.winy, 640, 400, | |
| NULL, NULL, hInstance, NULL); | |
| #endif | |
| hWnd = hWndMain; | |
| scrnmng_initialize(); | scrnmng_initialize(); |
| xmenu_setroltate(0); | xmenu_setroltate(0); |
| Line 1392 int WINAPI WinMain(HINSTANCE hInstance, | Line 1484 int WINAPI WinMain(HINSTANCE hInstance, |
| xmenu_setbtnrapid(np2cfg.BTN_RAPID); | xmenu_setbtnrapid(np2cfg.BTN_RAPID); |
| xmenu_setmsrapid(np2cfg.MOUSERAPID); | xmenu_setmsrapid(np2cfg.MOUSERAPID); |
| xmenu_setsstp(np2oscfg.sstp); | xmenu_setsstp(np2oscfg.sstp); |
| xmenu_seti286save(np2oscfg.I286SAVE); | |
| ShowWindow(hWnd, nCmdShow); | ShowWindow(hWnd, nCmdShow); |
| UpdateWindow(hWnd); | UpdateWindow(hWnd); |
| Line 1405 int WINAPI WinMain(HINSTANCE hInstance, | Line 1496 int WINAPI WinMain(HINSTANCE hInstance, |
| xmenu_initialize(); | xmenu_initialize(); |
| DrawMenuBar(hWnd); | DrawMenuBar(hWnd); |
| // ver0.30 | if (file_attr_c(np2help) == (short)-1) { // ver0.30 |
| if (file_attr_c(np2help) == (short)-1) { | |
| EnableMenuItem(GetMenu(hWnd), IDM_HELP, MF_GRAYED); | EnableMenuItem(GetMenu(hWnd), IDM_HELP, MF_GRAYED); |
| } | } |
| Line 1415 int WINAPI WinMain(HINSTANCE hInstance, | Line 1505 int WINAPI WinMain(HINSTANCE hInstance, |
| sysmenu_setwinsnap(np2oscfg.WINSNAP); | sysmenu_setwinsnap(np2oscfg.WINSNAP); |
| sysmenu_setbackground(np2oscfg.background); | sysmenu_setbackground(np2oscfg.background); |
| sysmenu_setbgsound(np2oscfg.background); | sysmenu_setbgsound(np2oscfg.background); |
| sysmenu_setscrnmul(8); // ver0.26 | sysmenu_setscrnmul(8); |
| scrnmode = 0; | scrnmode = 0; |
| if (np2arg.fullscreen) { | if (np2arg.fullscreen) { |
| Line 1442 int WINAPI WinMain(HINSTANCE hInstance, | Line 1532 int WINAPI WinMain(HINSTANCE hInstance, |
| soundmng_pcmvolume(SOUND_PCMSEEK1, np2cfg.MOTORVOL); | soundmng_pcmvolume(SOUND_PCMSEEK1, np2cfg.MOTORVOL); |
| } | } |
| #ifdef USE_ROMEO | if (np2oscfg.useromeo) { |
| juliet_load(); | juliet_initialize(); |
| juliet_prepare(); | } |
| #endif | |
| mousemng_initialize(); | |
| if (np2oscfg.MOUSE_SW) { // ver0.30 | if (np2oscfg.MOUSE_SW) { // ver0.30 |
| mousemng_enable(MOUSEPROC_SYSTEM); | mousemng_enable(MOUSEPROC_SYSTEM); |
| } | } |
| // mousemng_enable(MOUSEPROC_WINUI); | |
| // mousemng_enable(MOUSEPROC_BG); | |
| commng_initialize(); | commng_initialize(); |
| sysmng_initialize(); | sysmng_initialize(); |
| joy_init(); | joymng_initialize(); |
| pccore_init(); | pccore_init(); |
| S98_init(); | S98_init(); |
| Line 1474 int WINAPI WinMain(HINSTANCE hInstance, | Line 1560 int WINAPI WinMain(HINSTANCE hInstance, |
| np2opening = 0; | np2opening = 0; |
| // れじうむ | // れじうむ |
| #if defined(SUPPORT_RESUME) | |
| if (np2oscfg.resume) { | if (np2oscfg.resume) { |
| int id; | int id; |
| Line 1495 int WINAPI WinMain(HINSTANCE hInstance, | Line 1582 int WINAPI WinMain(HINSTANCE hInstance, |
| return(0); | return(0); |
| } | } |
| } | } |
| #endif | |
| // リセットしてから… コマンドラインのディスク挿入。 // ver0.29 | // リセットしてから… コマンドラインのディスク挿入。 |
| for (i=0; i<4; i++) { | for (i=0; i<4; i++) { |
| if (np2arg.disk[i]) { | if (np2arg.disk[i]) { |
| milstr_ncpy(diskdrv_fname[i], np2arg.disk[i], MAX_PATH); | milstr_ncpy(diskdrv_fname[i], np2arg.disk[i], MAX_PATH); |
| Line 1528 int WINAPI WinMain(HINSTANCE hInstance, | Line 1616 int WINAPI WinMain(HINSTANCE hInstance, |
| } | } |
| else { | else { |
| if (np2oscfg.NOWAIT) { | if (np2oscfg.NOWAIT) { |
| joy_flash(); | joymng_sync(); |
| mousemng_callback(); | mousemng_sync(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| dclock_callback(); | dclock_callback(); |
| if (np2oscfg.DRAW_SKIP) { // nowait frame skip | if (np2oscfg.DRAW_SKIP) { // nowait frame skip |
| Line 1547 int WINAPI WinMain(HINSTANCE hInstance, | Line 1635 int WINAPI WinMain(HINSTANCE hInstance, |
| } | } |
| else if (np2oscfg.DRAW_SKIP) { // frame skip | else if (np2oscfg.DRAW_SKIP) { // frame skip |
| if (framecnt < np2oscfg.DRAW_SKIP) { | if (framecnt < np2oscfg.DRAW_SKIP) { |
| joy_flash(); | joymng_sync(); |
| mousemng_callback(); | mousemng_sync(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| dclock_callback(); | dclock_callback(); |
| framecnt++; | framecnt++; |
| Line 1560 int WINAPI WinMain(HINSTANCE hInstance, | Line 1648 int WINAPI WinMain(HINSTANCE hInstance, |
| else { // auto skip | else { // auto skip |
| if (!waitcnt) { | if (!waitcnt) { |
| UINT cnt; | UINT cnt; |
| joy_flash(); | joymng_sync(); |
| mousemng_callback(); | mousemng_sync(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| dclock_callback(); | dclock_callback(); |
| framecnt++; | framecnt++; |
| Line 1603 int WINAPI WinMain(HINSTANCE hInstance, | Line 1691 int WINAPI WinMain(HINSTANCE hInstance, |
| } | } |
| toolwin_destroy(); | toolwin_destroy(); |
| kdispwin_destroy(); | kdispwin_destroy(); |
| skbdwin_destroy(); | |
| mdbgwin_destroy(); | |
| pccore_cfgupdate(); | pccore_cfgupdate(); |
| mousemng_disable(MOUSEPROC_WINUI); | mousemng_disable(MOUSEPROC_WINUI); |
| S98_trash(); | S98_trash(); |
| #if defined(SUPPORT_RESUME) | |
| if (np2oscfg.resume) { | if (np2oscfg.resume) { |
| flagsave(str_sav); | flagsave(str_sav); |
| } | } |
| else { | else { |
| flagdelete(str_sav); | flagdelete(str_sav); |
| } | } |
| #endif | |
| #ifdef USE_ROMEO | |
| juliet_YMF288Reset(); | juliet_YMF288Reset(); |
| #endif | |
| pccore_term(); | pccore_term(); |
| sstp_destruct(); | sstp_destruct(); |
| #ifdef USE_ROMEO | juliet_deinitialize(); |
| juliet_unload(); | |
| #endif | |
| soundmng_deinitialize(); | soundmng_deinitialize(); |
| scrnmng_destroy(); | scrnmng_destroy(); |
| Line 1634 int WINAPI WinMain(HINSTANCE hInstance, | Line 1722 int WINAPI WinMain(HINSTANCE hInstance, |
| initsave(); | initsave(); |
| toolwin_writeini(); | toolwin_writeini(); |
| kdispwin_writeini(); | kdispwin_writeini(); |
| skbdwin_writeini(); | |
| mdbgwin_writeini(); | |
| } | } |
| skbdwin_deinitialize(); | |
| TRACETERM(); | TRACETERM(); |
| _MEM_USED("report.txt"); | _MEM_USED("report.txt"); |
| dosio_term(); | dosio_term(); |
| viewer_term(); // ver0.30 | viewer_term(); // ver0.30 |
| return(msg.wParam); | return(msg.wParam); |
| } | } |