|
|
| version 1.31, 2003/11/21 06:51:14 | version 1.35, 2004/01/22 01:10:05 |
|---|---|
| Line 43 | Line 43 |
| #include "diskdrv.h" | #include "diskdrv.h" |
| #include "fddfile.h" | #include "fddfile.h" |
| #include "timing.h" | #include "timing.h" |
| #include "statsave.h" | |
| #include "debugsub.h" | #include "debugsub.h" |
| #include "keydisp.h" | #include "keydisp.h" |
| #include "kdispwin.h" | #include "kdispwin.h" |
| Line 66 static char szClassName[] = "NP2-MainWi | Line 65 static char szClassName[] = "NP2-MainWi |
| NP2OSCFG np2oscfg = { | NP2OSCFG np2oscfg = { |
| "Neko Project II", "NP2", | "Neko Project II", "NP2", |
| CW_USEDEFAULT, CW_USEDEFAULT, 1, 1, 0, 1, 0, 2, | 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}, |
| {5, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 | {5, 0, 0x3e, 19200, "", "", "", ""}, // ver0.34 |
| Line 74 static char szClassName[] = "NP2-MainWi | Line 73 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}; // ver0.38 | 0, 1, 0, 9801, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // ver0.73 |
| char fddfolder[MAX_PATH]; | char fddfolder[MAX_PATH]; |
| char hddfolder[MAX_PATH]; | char hddfolder[MAX_PATH]; |
| Line 319 static void np2popup(HWND hWnd, LPARAM l | Line 318 static void np2popup(HWND hWnd, LPARAM l |
| DestroyMenu(hMenu); | DestroyMenu(hMenu); |
| } | } |
| // extern "C" void iptrace_out(void); | |
| LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { | LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { |
| PAINTSTRUCT ps; | PAINTSTRUCT ps; |
| Line 504 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 505 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| case IDM_SASI1OPEN: | case IDM_SASI1OPEN: |
| winuienter(); | winuienter(); |
| dialog_changehdd(hWnd, 0); | dialog_changehdd(hWnd, 0x00); |
| winuileave(); | winuileave(); |
| break; | break; |
| case IDM_SASI1EJECT: | case IDM_SASI1EJECT: |
| diskdrv_sethdd(0, NULL); | diskdrv_sethdd(0x00, NULL); |
| break; | break; |
| case IDM_SASI2OPEN: | case IDM_SASI2OPEN: |
| winuienter(); | winuienter(); |
| dialog_changehdd(hWnd, 1); | dialog_changehdd(hWnd, 0x01); |
| winuileave(); | winuileave(); |
| break; | break; |
| case IDM_SASI2EJECT: | case IDM_SASI2EJECT: |
| diskdrv_sethdd(1, NULL); | diskdrv_sethdd(0x01, NULL); |
| break; | break; |
| case IDM_WINDOW: | case IDM_WINDOW: |
| Line 739 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 740 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| break; | break; |
| case IDM_SNDOPT: | case IDM_JASTSOUND: |
| winuienter(); | xmenu_setjastsound(np2oscfg.jastsnd ^ 1); |
| dialog_sndopt(hWnd); | update |= SYS_UPDATEOSCFG; |
| winuileave(); | |
| break; | break; |
| case IDM_SEEKSND: | case IDM_SEEKSND: |
| Line 795 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 795 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| pc9861k_midipanic(); | pc9861k_midipanic(); |
| break; | break; |
| case IDM_SNDOPT: | |
| winuienter(); | |
| dialog_sndopt(hWnd); | |
| winuileave(); | |
| break; | |
| case IDM_BMPSAVE: | case IDM_BMPSAVE: |
| winuienter(); | winuienter(); |
| dialog_writebmp(hWnd); | dialog_writebmp(hWnd); |
| Line 856 LRESULT CALLBACK WndProc(HWND hWnd, UINT | Line 862 LRESULT CALLBACK WndProc(HWND hWnd, UINT |
| case IDM_I286SAVE: | case IDM_I286SAVE: |
| debugsub_status(); | debugsub_status(); |
| // iptrace_out(); | |
| break; | break; |
| case IDM_HELP: | case IDM_HELP: |
| Line 1226 static void processwait(UINT cnt) { | Line 1233 static void processwait(UINT cnt) { |
| else { | else { |
| Sleep(1); | Sleep(1); |
| } | } |
| soundmng_sync(); | |
| } | } |
| Line 1234 int WINAPI WinMain(HINSTANCE hInstance, | Line 1242 int WINAPI WinMain(HINSTANCE hInstance, |
| WNDCLASS wc; | WNDCLASS wc; |
| MSG msg; | MSG msg; |
| HMENU hMenu; | HMENU hMenu; |
| HWND hwndorg; | HWND hWnd; |
| UINT i; | UINT i; |
| #ifdef OPENING_WAIT | #ifdef OPENING_WAIT |
| UINT32 tick; | UINT32 tick; |
| Line 1254 int WINAPI WinMain(HINSTANCE hInstance, | Line 1262 int WINAPI WinMain(HINSTANCE hInstance, |
| CopyMemory(szClassName, np2oscfg.winid, 3); | CopyMemory(szClassName, np2oscfg.winid, 3); |
| if ((hwndorg = FindWindow(szClassName, NULL)) != NULL) { | if ((hWnd = FindWindow(szClassName, NULL)) != NULL) { |
| sstpmsg_running(); | sstpmsg_running(); |
| ShowWindow(hwndorg, SW_RESTORE); | ShowWindow(hWnd, SW_RESTORE); |
| SetForegroundWindow(hwndorg); | SetForegroundWindow(hWnd); |
| dosio_term(); | dosio_term(); |
| return(FALSE); | return(FALSE); |
| } | } |
| Line 1300 int WINAPI WinMain(HINSTANCE hInstance, | Line 1308 int WINAPI WinMain(HINSTANCE hInstance, |
| } | } |
| toolwin_initapp(hInstance); | toolwin_initapp(hInstance); |
| kdispwin_initialize(hPreInst); | kdispwin_initialize(hPreInst); |
| viewer_init(hPreInst); // ver0.30 | viewer_init(hPreInst); |
| hWndMain = CreateWindow(szClassName, np2oscfg.titles, | #if 1 |
| hWndMain = 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 = 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_setsound(np2cfg.SOUND_SW); | xmenu_setroltate(0); |
| xmenu_setbeepvol(np2cfg.BEEP_VOL); | xmenu_setdispmode(np2cfg.DISPSYNC); |
| xmenu_setkey(0); | xmenu_setraster(np2cfg.RASTER); |
| xmenu_setbtnrapid(np2cfg.BTN_RAPID); | |
| xmenu_setbtnmode(np2cfg.BTN_MODE); | |
| xmenu_setmsrapid(np2cfg.MOUSERAPID); | |
| xmenu_setwaitflg(np2oscfg.NOWAIT); | xmenu_setwaitflg(np2oscfg.NOWAIT); |
| xmenu_setframe(np2oscfg.DRAW_SKIP); | xmenu_setframe(np2oscfg.DRAW_SKIP); |
| xmenu_setdispmode(np2cfg.DISPSYNC); | |
| xmenu_setdispclk(np2oscfg.DISPCLK); | xmenu_setkey(0); |
| xmenu_seti286save(np2oscfg.I286SAVE); | |
| xmenu_setmotorflg(np2cfg.MOTOR); | |
| xmenu_setroltate(0); | |
| xmenu_setxshift(0); | xmenu_setxshift(0); |
| xmenu_setf12copy(np2oscfg.F12COPY); | xmenu_setf12copy(np2oscfg.F12COPY); |
| xmenu_setbeepvol(np2cfg.BEEP_VOL); | |
| xmenu_setsound(np2cfg.SOUND_SW); | |
| xmenu_setjastsound(np2oscfg.jastsnd); | |
| xmenu_setmotorflg(np2cfg.MOTOR); | |
| xmenu_setextmem(np2cfg.EXTMEM); | xmenu_setextmem(np2cfg.EXTMEM); |
| xmenu_setraster(np2cfg.RASTER); | |
| xmenu_setshortcut(np2oscfg.shortcut); // ver0.30 | |
| xmenu_setsstp(np2oscfg.sstp); | |
| xmenu_setmouse(np2oscfg.MOUSE_SW); | xmenu_setmouse(np2oscfg.MOUSE_SW); |
| ShowWindow(hWndMain, nCmdShow); | xmenu_setshortcut(np2oscfg.shortcut); |
| UpdateWindow(hWndMain); | xmenu_setdispclk(np2oscfg.DISPCLK); |
| xmenu_setbtnmode(np2cfg.BTN_MODE); | |
| xmenu_setbtnrapid(np2cfg.BTN_RAPID); | |
| xmenu_setmsrapid(np2cfg.MOUSERAPID); | |
| xmenu_setsstp(np2oscfg.sstp); | |
| xmenu_seti286save(np2oscfg.I286SAVE); | |
| ShowWindow(hWnd, nCmdShow); | |
| UpdateWindow(hWnd); | |
| #ifdef OPENING_WAIT | #ifdef OPENING_WAIT |
| tick = GetTickCount(); | tick = GetTickCount(); |
| Line 1340 int WINAPI WinMain(HINSTANCE hInstance, | Line 1362 int WINAPI WinMain(HINSTANCE hInstance, |
| // めにゅー追加 | // めにゅー追加 |
| if (np2oscfg.statsave) { | if (np2oscfg.statsave) { |
| char buf[16]; | char buf[16]; |
| hMenu = GetMenu(hWndMain); | hMenu = GetMenu(hWnd); |
| hStat = CreatePopupMenu(); | hStat = CreatePopupMenu(); |
| for (i=0; i<STATSAVEMAX; i++) { | for (i=0; i<STATSAVEMAX; i++) { |
| wsprintf(buf, "Save %d", i); | wsprintf(buf, "Save %d", i); |
| Line 1354 int WINAPI WinMain(HINSTANCE hInstance, | Line 1376 int WINAPI WinMain(HINSTANCE hInstance, |
| InsertMenu(hMenu, 1, MF_BYPOSITION | MF_POPUP, (UINT)hStat, "S&tat"); | InsertMenu(hMenu, 1, MF_BYPOSITION | MF_POPUP, (UINT)hStat, "S&tat"); |
| } | } |
| sysmenu_initialize(); | sysmenu_initialize(); |
| DrawMenuBar(hWndMain); | DrawMenuBar(hWnd); |
| // ver0.30 | // ver0.30 |
| if (file_attr_c(np2help) == (short)-1) { | if (file_attr_c(np2help) == (short)-1) { |
| EnableMenuItem(GetMenu(hWndMain), IDM_HELP, MF_GRAYED); | EnableMenuItem(GetMenu(hWnd), IDM_HELP, MF_GRAYED); |
| } | } |
| sysmenu_settoolwin(np2oscfg.toolwin); | sysmenu_settoolwin(np2oscfg.toolwin); |
| Line 1379 int WINAPI WinMain(HINSTANCE hInstance, | Line 1401 int WINAPI WinMain(HINSTANCE hInstance, |
| scrnmode ^= SCRNMODE_FULLSCREEN; | scrnmode ^= SCRNMODE_FULLSCREEN; |
| if (scrnmng_create(scrnmode) != SUCCESS) { | if (scrnmng_create(scrnmode) != SUCCESS) { |
| if (sstpmsg_dxerror()) { | if (sstpmsg_dxerror()) { |
| MessageBox(hWndMain, "Couldn't create DirectDraw Object", | MessageBox(hWnd, "Couldn't create DirectDraw Object", |
| np2oscfg.titles, MB_OK | MB_ICONSTOP); | np2oscfg.titles, MB_OK | MB_ICONSTOP); |
| } | } |
| return(FALSE); | return(FALSE); |
| Line 1422 int WINAPI WinMain(HINSTANCE hInstance, | Line 1444 int WINAPI WinMain(HINSTANCE hInstance, |
| pccore_reset(); | pccore_reset(); |
| if (!(scrnmode & SCRNMODE_FULLSCREEN)) { | |
| if (np2oscfg.toolwin) { | |
| toolwin_create(); | |
| } | |
| if (np2oscfg.keydisp) { | |
| kdispwin_create(); | |
| } | |
| } | |
| np2opening = 0; | np2opening = 0; |
| // れじうむ | // れじうむ |
| Line 1442 int WINAPI WinMain(HINSTANCE hInstance, | Line 1455 int WINAPI WinMain(HINSTANCE hInstance, |
| for (i=0; i<4; i++) np2arg.disk[i] = NULL; | for (i=0; i<4; i++) np2arg.disk[i] = NULL; |
| } | } |
| else if (id == IDCANCEL) { | else if (id == IDCANCEL) { |
| DestroyWindow(hWndMain); | DestroyWindow(hWnd); |
| mousemng_disable(MOUSEPROC_WINUI); | mousemng_disable(MOUSEPROC_WINUI); |
| S98_trash(); | S98_trash(); |
| pccore_term(); | pccore_term(); |
| Line 1464 int WINAPI WinMain(HINSTANCE hInstance, | Line 1477 int WINAPI WinMain(HINSTANCE hInstance, |
| } | } |
| } | } |
| if (!(scrnmode & SCRNMODE_FULLSCREEN)) { | |
| if (np2oscfg.toolwin) { | |
| toolwin_create(); | |
| } | |
| if (np2oscfg.keydisp) { | |
| kdispwin_create(); | |
| } | |
| } | |
| while(1) { | while(1) { |
| if (!np2stopemulate) { | if (!np2stopemulate) { |
| if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) { | if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) { |
| if (!GetMessage(&msg, NULL, 0, 0)) { | if (!GetMessage(&msg, NULL, 0, 0)) { |
| break; | break; |
| } | } |
| if ((msg.hwnd != hWndMain) || | if ((msg.hwnd != hWnd) || |
| ((msg.message != WM_SYSKEYDOWN) && | ((msg.message != WM_SYSKEYDOWN) && |
| (msg.message != WM_SYSKEYUP))) { | (msg.message != WM_SYSKEYUP))) { |
| TranslateMessage(&msg); | TranslateMessage(&msg); |