--- np2/macosx/np2.cpp 2003/10/19 14:48:07 1.5 +++ np2/macosx/np2.cpp 2003/10/22 16:22:43 1.9 @@ -122,13 +122,11 @@ static void MenuBarInit(void) { DrawMenuBar(); } - static void changescreen(BYTE mode) { (void)mode; } - static void HandleMenuChoice(long wParam) { UINT update; @@ -248,6 +246,14 @@ static void HandleMenuChoice(long wParam update |= SYS_UPDATECFG; break; +#if defined(NP2GCC) + case IDM_MOUSE: + mouse_running(MOUSE_XOR); + menu_setmouse(np2oscfg.MOUSE_SW ^ 1); + sysmng_update(SYS_UPDATECFG); + break; +#endif + case IDM_KEY: menu_setkey(0); keystat_resetjoykey(); @@ -500,30 +506,16 @@ static void eventproc(EventRecord *event case keyDown: case autoKey: + mackbd_f12down(((event->message) & keyCodeMask) >> 8); if (event->modifiers & cmdKey) { - if (!mackbd_down(1, ((event->message) & keyCodeMask) >> 8)) { - HandleMenuChoice(MenuKey(event->message & charCodeMask)); - } - } - else { -#if defined(NP2GCC) - if ((((event->message) & keyCodeMask) >> 8 == 0x6f) && (!np2oscfg.F12COPY)) { - mouse_running(MOUSE_XOR); - menu_setmouse(np2oscfg.MOUSE_SW ^ 1); - sysmng_update(SYS_UPDATECFG); - } - else { - mackbd_down(0, ((event->message) & keyCodeMask) >> 8); - } -#else - mackbd_down(0, ((event->message) & keyCodeMask) >> 8); -#endif + HandleMenuChoice(MenuKey(event->message & charCodeMask)); } break; case keyUp: - mackbd_up(((event->message) & keyCodeMask) >> 8); + mackbd_f12up(((event->message) & keyCodeMask) >> 8); break; + #if defined(NP2GCC) case mouseUp: if (controlKey & GetCurrentKeyModifiers()) { @@ -538,6 +530,8 @@ static void eventproc(EventRecord *event } +// ---- + static void processwait(UINT waitcnt) { if (timing_getcount() >= waitcnt) { @@ -593,10 +587,13 @@ int main(int argc, char *argv[]) { initload(); + TRACEINIT(); + SetRect(&wRect, 100, 100, 100, 100); hWndMain = NewWindow(0, &wRect, "\pNeko Project II", FALSE, noGrowDocProc, (WindowPtr)-1, TRUE, 0); if (!hWndMain) { + TRACETERM(); macossub_term(); dosio_term(); return(0); @@ -622,6 +619,7 @@ int main(int argc, char *argv[]) { scrnmode = 0; if (scrnmng_create(scrnmode) != SUCCESS) { + TRACETERM(); macossub_term(); dosio_term(); DisposeWindow(hWndMain); @@ -629,6 +627,7 @@ int main(int argc, char *argv[]) { } sysmng_initialize(); + mackbd_initialize(); pccore_init(); S98_init(); @@ -692,17 +691,12 @@ int main(int argc, char *argv[]) { mackbd_callback(); pccore_exec(framecnt == 0); framecnt++; - if (timing_getcount() < framecnt) { + // ¥Æ¥¹¥È + if (framecnt > timing_getcount()) { waitcnt = framecnt; - if (framemax > 1) { - framemax--; - } } - else if (framecnt >= framemax) { + else if (framecnt >= 12) { waitcnt = framecnt; - if (framemax < 12) { - framemax++; - } } } else {