--- np2/macos9/np2.cpp 2003/10/23 19:31:58 1.5 +++ np2/macos9/np2.cpp 2003/10/25 09:08:24 1.8 @@ -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" @@ -10,6 +11,7 @@ #include "mackbd.h" #include "ini.h" #include "menu.h" +#include "np2open.h" #include "dialog.h" #include "memory.h" #include "pccore.h" @@ -244,6 +246,10 @@ static void HandleMenuChoice(long wParam update |= SYS_UPDATECFG; break; + case IDM_SCREENOPT: + dialog_scropt(); + break; + #if defined(NP2GCC) case IDM_MOUSE: mouse_running(MOUSE_XOR); @@ -447,7 +453,12 @@ static void HandleUpdateEvent(EventRecor hWnd = (WindowPtr)pevent->message; BeginUpdate(hWnd); - scrndraw_redraw(); + if (np2running) { + scrndraw_redraw(); + } + else { + np2open(); + } EndUpdate(hWnd); } @@ -458,8 +469,10 @@ static void HandleMouseDown(EventRecord switch(FindWindow(pevent->where, &hWnd)) { case inMenuBar: - soundmng_stop(); - HandleMenuChoice(MenuSelect(pevent->where)); + if (np2running) { + soundmng_stop(); + HandleMenuChoice(MenuSelect(pevent->where)); + } break; case inDrag: @@ -509,9 +522,11 @@ static void eventproc(EventRecord *event case keyDown: case autoKey: - mackbd_f12down(((event->message) & keyCodeMask) >> 8); - if (event->modifiers & cmdKey) { - HandleMenuChoice(MenuKey(event->message & charCodeMask)); + if (np2running) { + mackbd_f12down(((event->message) & keyCodeMask) >> 8); + if (event->modifiers & cmdKey) { + HandleMenuChoice(MenuKey(event->message & charCodeMask)); + } } break; @@ -598,6 +613,7 @@ int main(int argc, char *argv[]) { Rect wRect; EventRecord event; + UINT t; dosio_init(); file_setcd(target); @@ -647,6 +663,15 @@ int main(int argc, char *argv[]) { return(0); } + np2open(); + t = GETTICK(); + while((GETTICK() - t) < 100) { + if (WaitNextEvent(everyEvent, &event, 0, 0)) { + eventproc(&event); + } + } + + commng_initialize(); sysmng_initialize(); mackbd_initialize(); pccore_init(); @@ -657,7 +682,7 @@ int main(int argc, char *argv[]) { mouse_running(MOUSE_ON); } #endif - scrndraw_redraw(); +// scrndraw_redraw(); pccore_reset(); if (np2oscfg.resume) {