--- np2/macos9/np2.cpp 2003/10/24 10:58:47 1.7 +++ np2/macos9/np2.cpp 2003/11/06 01:58:36 1.10 @@ -3,6 +3,7 @@ #include "strres.h" #include "np2.h" #include "dosio.h" +#include "commng.h" #include "scrnmng.h" #include "soundmng.h" #include "sysmng.h" @@ -257,6 +258,12 @@ static void HandleMenuChoice(long wParam break; #endif + case IDM_MIDIPANIC: + rs232c_midipanic(); + mpu98ii_midipanic(); + pc9861k_midipanic(); + break; + case IDM_KEY: menu_setkey(0); keystat_resetjoykey(); @@ -471,6 +478,7 @@ static void HandleMouseDown(EventRecord if (np2running) { soundmng_stop(); HandleMenuChoice(MenuSelect(pevent->where)); + soundmng_play(); } break; @@ -524,7 +532,9 @@ static void eventproc(EventRecord *event if (np2running) { mackbd_f12down(((event->message) & keyCodeMask) >> 8); if (event->modifiers & cmdKey) { + soundmng_stop(); HandleMenuChoice(MenuKey(event->message & charCodeMask)); + soundmng_play(); } } break; @@ -549,16 +559,21 @@ static void eventproc(EventRecord *event // ---- +static void framereset(void) { + + framecnt = 0; + if (np2oscfg.DISPCLK & 3) { + if (sysmng_workclockrenewal()) { + sysmng_updatecaption(3); + } + } +} + static void processwait(UINT waitcnt) { if (timing_getcount() >= waitcnt) { timing_setcount(0); - framecnt = 0; - if (np2oscfg.DISPCLK & 3) { - if (sysmng_workclockrenewal()) { - sysmng_updatecaption(3); - } - } + framereset(); } } @@ -670,6 +685,7 @@ int main(int argc, char *argv[]) { } } + commng_initialize(); sysmng_initialize(); mackbd_initialize(); pccore_init(); @@ -699,7 +715,6 @@ int main(int argc, char *argv[]) { #if defined(NP2GCC) mouse_callback(); #endif - soundmng_play(); mackbd_callback(); pccore_exec(framecnt == 0); if (np2oscfg.DRAW_SKIP) { // nowait frame skip @@ -720,7 +735,6 @@ int main(int argc, char *argv[]) { #if defined(NP2GCC) mouse_callback(); #endif - soundmng_play(); mackbd_callback(); pccore_exec(framecnt == 0); framecnt++; @@ -735,7 +749,6 @@ int main(int argc, char *argv[]) { #if defined(NP2GCC) mouse_callback(); #endif - soundmng_play(); mackbd_callback(); pccore_exec(framecnt == 0); framecnt++; @@ -756,7 +769,7 @@ int main(int argc, char *argv[]) { else { timing_setcount(cnt - framecnt); } - framecnt = 0; + framereset(); } } else {