|
|
| version 1.3, 2003/10/17 04:11:23 | version 1.7, 2003/10/20 10:14:27 |
|---|---|
| Line 27 | Line 27 |
| #include "fddfile.h" | #include "fddfile.h" |
| #include "statsave.h" | #include "statsave.h" |
| #if defined(NP2GCC) | |
| #include "mousemng.h" | |
| #endif | |
| #define USE_RESUME | #define USE_RESUME |
| #if defined(NP2GCC) | |
| NP2OSCFG np2oscfg = {0, 2, 0, 0, 0, 0}; | |
| #else | |
| NP2OSCFG np2oscfg = {0, 2, 0, 0, 0}; | NP2OSCFG np2oscfg = {0, 2, 0, 0, 0}; |
| #endif | |
| WindowPtr hWndMain; | WindowPtr hWndMain; |
| BOOL np2running; | BOOL np2running; |
| Line 115 static void MenuBarInit(void) { | Line 122 static void MenuBarInit(void) { |
| DrawMenuBar(); | DrawMenuBar(); |
| } | } |
| static void changescreen(BYTE mode) { | static void changescreen(BYTE mode) { |
| (void)mode; | (void)mode; |
| } | } |
| static void HandleMenuChoice(long wParam) { | static void HandleMenuChoice(long wParam) { |
| UINT update; | UINT update; |
| Line 463 static void HandleMouseDown(EventRecord | Line 468 static void HandleMouseDown(EventRecord |
| break; | break; |
| case inContent: | case inContent: |
| #if defined(NP2GCC) | |
| if (controlKey & GetCurrentKeyModifiers() ) { | |
| mouse_btn(MOUSE_RIGHTDOWN); | |
| } | |
| else { | |
| mouse_btn(MOUSE_LEFTDOWN); | |
| } | |
| #endif | |
| break; | break; |
| case inGoAway: | case inGoAway: |
| Line 485 static void eventproc(EventRecord *event | Line 498 static void eventproc(EventRecord *event |
| case keyDown: | case keyDown: |
| case autoKey: | case autoKey: |
| mackbd_f12down(((event->message) & keyCodeMask) >> 8); | |
| if (event->modifiers & cmdKey) { | if (event->modifiers & cmdKey) { |
| if (!mackbd_down(1, ((event->message) & keyCodeMask) >> 8)) { | HandleMenuChoice(MenuKey(event->message & charCodeMask)); |
| HandleMenuChoice(MenuKey(event->message & charCodeMask)); | |
| } | |
| } | |
| else { | |
| mackbd_down(0, ((event->message) & keyCodeMask) >> 8); | |
| } | } |
| break; | break; |
| case keyUp: | case keyUp: |
| mackbd_up(((event->message) & keyCodeMask) >> 8); | mackbd_f12up(((event->message) & keyCodeMask) >> 8); |
| break; | break; |
| #if defined(NP2GCC) | |
| case mouseUp: | |
| if (controlKey & GetCurrentKeyModifiers()) { | |
| mouse_btn(MOUSE_RIGHTUP); | |
| } | |
| else { | |
| mouse_btn(MOUSE_LEFTUP); | |
| } | |
| break; | |
| #endif | |
| } | } |
| } | } |
| // ---- | |
| static void processwait(UINT waitcnt) { | static void processwait(UINT waitcnt) { |
| if (timing_getcount() >= waitcnt) { | if (timing_getcount() >= waitcnt) { |
| Line 533 static void flagsave(const char *ext) { | Line 555 static void flagsave(const char *ext) { |
| static void flagload(const char *ext) { | static void flagload(const char *ext) { |
| char path[MAX_PATH]; | char path[MAX_PATH]; |
| char buf[1024]; | |
| int ret; | |
| getstatfilename(path, ext, sizeof(path)); | getstatfilename(path, ext, sizeof(path)); |
| statsave_load(path); | ret = statsave_check(path, buf, sizeof(buf)); |
| if (ret == NP2FLAG_SUCCESS) { | |
| statsave_load(path); | |
| } | |
| } | } |
| int main(int argc, char *argv[]) { | int main(int argc, char *argv[]) { |
| Line 552 int main(int argc, char *argv[]) { | Line 579 int main(int argc, char *argv[]) { |
| initload(); | initload(); |
| TRACEINIT(); | |
| SetRect(&wRect, 100, 100, 100, 100); | SetRect(&wRect, 100, 100, 100, 100); |
| hWndMain = NewWindow(0, &wRect, "\pNeko Project II", FALSE, | hWndMain = NewWindow(0, &wRect, "\pNeko Project II", FALSE, |
| noGrowDocProc, (WindowPtr)-1, TRUE, 0); | noGrowDocProc, (WindowPtr)-1, TRUE, 0); |
| if (!hWndMain) { | if (!hWndMain) { |
| TRACETERM(); | |
| macossub_term(); | macossub_term(); |
| dosio_term(); | dosio_term(); |
| return(0); | return(0); |
| Line 581 int main(int argc, char *argv[]) { | Line 611 int main(int argc, char *argv[]) { |
| scrnmode = 0; | scrnmode = 0; |
| if (scrnmng_create(scrnmode) != SUCCESS) { | if (scrnmng_create(scrnmode) != SUCCESS) { |
| TRACETERM(); | |
| macossub_term(); | macossub_term(); |
| dosio_term(); | dosio_term(); |
| DisposeWindow(hWndMain); | DisposeWindow(hWndMain); |
| Line 588 int main(int argc, char *argv[]) { | Line 619 int main(int argc, char *argv[]) { |
| } | } |
| sysmng_initialize(); | sysmng_initialize(); |
| mackbd_initialize(); | |
| pccore_init(); | pccore_init(); |
| S98_init(); | S98_init(); |
| #if defined(NP2GCC) | |
| if (np2oscfg.MOUSE_SW) { // ver0.30 | |
| mouse_running(MOUSE_ON); | |
| } | |
| #endif | |
| scrndraw_redraw(); | scrndraw_redraw(); |
| pccore_reset(); | pccore_reset(); |
| Line 607 int main(int argc, char *argv[]) { | Line 644 int main(int argc, char *argv[]) { |
| } | } |
| else { | else { |
| if (np2oscfg.NOWAIT) { | if (np2oscfg.NOWAIT) { |
| #if defined(NP2GCC) | |
| mouse_callback(); | |
| #endif | |
| 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 624 int main(int argc, char *argv[]) { | Line 664 int main(int argc, char *argv[]) { |
| } | } |
| else if (np2oscfg.DRAW_SKIP) { // frame skip | else if (np2oscfg.DRAW_SKIP) { // frame skip |
| if (framecnt < np2oscfg.DRAW_SKIP) { | if (framecnt < np2oscfg.DRAW_SKIP) { |
| #if defined(NP2GCC) | |
| mouse_callback(); | |
| #endif | |
| mackbd_callback(); | mackbd_callback(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| framecnt++; | framecnt++; |
| Line 634 int main(int argc, char *argv[]) { | Line 677 int main(int argc, char *argv[]) { |
| } | } |
| else { // auto skip | else { // auto skip |
| if (!waitcnt) { | if (!waitcnt) { |
| #if defined(NP2GCC) | |
| mouse_callback(); | |
| #endif | |
| mackbd_callback(); | mackbd_callback(); |
| pccore_exec(framecnt == 0); | pccore_exec(framecnt == 0); |
| framecnt++; | framecnt++; |
| Line 668 int main(int argc, char *argv[]) { | Line 714 int main(int argc, char *argv[]) { |
| pccore_term(); | pccore_term(); |
| S98_trash(); | S98_trash(); |
| #if defined(NP2GCC) | |
| mouse_running(MOUSE_OFF); | |
| #endif | |
| scrnmng_destroy(); | scrnmng_destroy(); |
| if (sys_updates & (SYS_UPDATECFG | SYS_UPDATEOSCFG)) { | if (sys_updates & (SYS_UPDATECFG | SYS_UPDATEOSCFG)) { |