|
|
| version 1.5, 2003/10/23 19:31:58 | version 1.9, 2003/10/25 16:01:21 |
|---|---|
| Line 3 | Line 3 |
| #include "strres.h" | #include "strres.h" |
| #include "np2.h" | #include "np2.h" |
| #include "dosio.h" | #include "dosio.h" |
| #include "commng.h" | |
| #include "scrnmng.h" | #include "scrnmng.h" |
| #include "soundmng.h" | #include "soundmng.h" |
| #include "sysmng.h" | #include "sysmng.h" |
| Line 10 | Line 11 |
| #include "mackbd.h" | #include "mackbd.h" |
| #include "ini.h" | #include "ini.h" |
| #include "menu.h" | #include "menu.h" |
| #include "np2open.h" | |
| #include "dialog.h" | #include "dialog.h" |
| #include "memory.h" | #include "memory.h" |
| #include "pccore.h" | #include "pccore.h" |
| Line 244 static void HandleMenuChoice(long wParam | Line 246 static void HandleMenuChoice(long wParam |
| update |= SYS_UPDATECFG; | update |= SYS_UPDATECFG; |
| break; | break; |
| case IDM_SCREENOPT: | |
| dialog_scropt(); | |
| break; | |
| #if defined(NP2GCC) | #if defined(NP2GCC) |
| case IDM_MOUSE: | case IDM_MOUSE: |
| mouse_running(MOUSE_XOR); | mouse_running(MOUSE_XOR); |
| Line 252 static void HandleMenuChoice(long wParam | Line 258 static void HandleMenuChoice(long wParam |
| break; | break; |
| #endif | #endif |
| case IDM_MIDIPANIC: | |
| rs232c_midipanic(); | |
| mpu98ii_midipanic(); | |
| pc9861k_midipanic(); | |
| break; | |
| case IDM_KEY: | case IDM_KEY: |
| menu_setkey(0); | menu_setkey(0); |
| keystat_resetjoykey(); | keystat_resetjoykey(); |
| Line 447 static void HandleUpdateEvent(EventRecor | Line 459 static void HandleUpdateEvent(EventRecor |
| hWnd = (WindowPtr)pevent->message; | hWnd = (WindowPtr)pevent->message; |
| BeginUpdate(hWnd); | BeginUpdate(hWnd); |
| scrndraw_redraw(); | if (np2running) { |
| scrndraw_redraw(); | |
| } | |
| else { | |
| np2open(); | |
| } | |
| EndUpdate(hWnd); | EndUpdate(hWnd); |
| } | } |
| Line 458 static void HandleMouseDown(EventRecord | Line 475 static void HandleMouseDown(EventRecord |
| switch(FindWindow(pevent->where, &hWnd)) { | switch(FindWindow(pevent->where, &hWnd)) { |
| case inMenuBar: | case inMenuBar: |
| soundmng_stop(); | if (np2running) { |
| HandleMenuChoice(MenuSelect(pevent->where)); | soundmng_stop(); |
| HandleMenuChoice(MenuSelect(pevent->where)); | |
| soundmng_play(); | |
| } | |
| break; | break; |
| case inDrag: | case inDrag: |
| Line 509 static void eventproc(EventRecord *event | Line 529 static void eventproc(EventRecord *event |
| case keyDown: | case keyDown: |
| case autoKey: | case autoKey: |
| mackbd_f12down(((event->message) & keyCodeMask) >> 8); | if (np2running) { |
| if (event->modifiers & cmdKey) { | mackbd_f12down(((event->message) & keyCodeMask) >> 8); |
| HandleMenuChoice(MenuKey(event->message & charCodeMask)); | if (event->modifiers & cmdKey) { |
| soundmng_stop(); | |
| HandleMenuChoice(MenuKey(event->message & charCodeMask)); | |
| soundmng_play(); | |
| } | |
| } | } |
| break; | break; |
| Line 538 static void eventproc(EventRecord *event | Line 562 static void eventproc(EventRecord *event |
| static void processwait(UINT waitcnt) { | static void processwait(UINT waitcnt) { |
| if (timing_getcount() >= waitcnt) { | if (timing_getcount() >= waitcnt) { |
| timing_setcount(0); | |
| framecnt = 0; | framecnt = 0; |
| timing_setcount(0); | |
| if (np2oscfg.DISPCLK & 3) { | if (np2oscfg.DISPCLK & 3) { |
| if (sysmng_workclockrenewal()) { | if (sysmng_workclockrenewal()) { |
| sysmng_updatecaption(3); | sysmng_updatecaption(3); |
| Line 598 int main(int argc, char *argv[]) { | Line 622 int main(int argc, char *argv[]) { |
| Rect wRect; | Rect wRect; |
| EventRecord event; | EventRecord event; |
| UINT t; | |
| dosio_init(); | dosio_init(); |
| file_setcd(target); | file_setcd(target); |
| Line 647 int main(int argc, char *argv[]) { | Line 672 int main(int argc, char *argv[]) { |
| return(0); | return(0); |
| } | } |
| np2open(); | |
| t = GETTICK(); | |
| while((GETTICK() - t) < 100) { | |
| if (WaitNextEvent(everyEvent, &event, 0, 0)) { | |
| eventproc(&event); | |
| } | |
| } | |
| commng_initialize(); | |
| sysmng_initialize(); | sysmng_initialize(); |
| mackbd_initialize(); | mackbd_initialize(); |
| pccore_init(); | pccore_init(); |
| Line 657 int main(int argc, char *argv[]) { | Line 691 int main(int argc, char *argv[]) { |
| mouse_running(MOUSE_ON); | mouse_running(MOUSE_ON); |
| } | } |
| #endif | #endif |
| scrndraw_redraw(); | // scrndraw_redraw(); |
| pccore_reset(); | pccore_reset(); |
| if (np2oscfg.resume) { | if (np2oscfg.resume) { |
| Line 676 int main(int argc, char *argv[]) { | Line 710 int main(int argc, char *argv[]) { |
| #if defined(NP2GCC) | #if defined(NP2GCC) |
| mouse_callback(); | mouse_callback(); |
| #endif | #endif |
| soundmng_play(); | |
| mackbd_callback(); | mackbd_callback(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| if (np2oscfg.DRAW_SKIP) { // nowait frame skip | if (np2oscfg.DRAW_SKIP) { // nowait frame skip |
| Line 697 int main(int argc, char *argv[]) { | Line 730 int main(int argc, char *argv[]) { |
| #if defined(NP2GCC) | #if defined(NP2GCC) |
| mouse_callback(); | mouse_callback(); |
| #endif | #endif |
| soundmng_play(); | |
| mackbd_callback(); | mackbd_callback(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| framecnt++; | framecnt++; |
| Line 712 int main(int argc, char *argv[]) { | Line 744 int main(int argc, char *argv[]) { |
| #if defined(NP2GCC) | #if defined(NP2GCC) |
| mouse_callback(); | mouse_callback(); |
| #endif | #endif |
| soundmng_play(); | |
| mackbd_callback(); | mackbd_callback(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| framecnt++; | framecnt++; |
| Line 733 int main(int argc, char *argv[]) { | Line 764 int main(int argc, char *argv[]) { |
| else { | else { |
| timing_setcount(cnt - framecnt); | timing_setcount(cnt - framecnt); |
| } | } |
| framecnt = 0; | processwait(0); |
| } | } |
| } | } |
| else { | else { |