|
|
| version 1.1.1.1, 2003/10/16 17:59:36 | version 1.4, 2003/10/17 07:17:20 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "resource.h" | #include "resource.h" |
| #include "strres.h" | |
| #include "np2.h" | #include "np2.h" |
| #include "dosio.h" | #include "dosio.h" |
| #include "scrnmng.h" | #include "scrnmng.h" |
| Line 50 static BYTE scrnmode; | Line 51 static BYTE scrnmode; |
| static char target[MAX_PATH] = DEFAULTPATH; | static char target[MAX_PATH] = DEFAULTPATH; |
| static const char np2resume[] = "sav"; | |
| // ---- おまじない | // ---- おまじない |
| #if TARGET_CARBON | #if TARGET_CARBON |
| Line 503 static void processwait(UINT waitcnt) { | Line 507 static void processwait(UINT waitcnt) { |
| if (timing_getcount() >= waitcnt) { | if (timing_getcount() >= waitcnt) { |
| timing_setcount(0); | timing_setcount(0); |
| framecnt = 0; | framecnt = 0; |
| if (np2oscfg.DISPCLK & 2) { | if (np2oscfg.DISPCLK & 3) { |
| if (sysmng_workclockrenewal()) { | if (sysmng_workclockrenewal()) { |
| sysmng_updatecaption(2); | sysmng_updatecaption(3); |
| } | } |
| } | } |
| } | } |
| } | } |
| static void getstatfilename(char *path, const char *ext, int size) { | |
| file_cpyname(path, file_getcd("np2"), size); | |
| file_catname(path, str_dot, size); | |
| file_catname(path, ext, size); | |
| } | |
| static void flagsave(const char *ext) { | |
| char path[MAX_PATH]; | |
| getstatfilename(path, ext, sizeof(path)); | |
| statsave_save(path); | |
| } | |
| static void flagload(const char *ext) { | |
| char path[MAX_PATH]; | |
| char buf[1024]; | |
| int ret; | |
| getstatfilename(path, ext, sizeof(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[]) { |
| Rect wRect; | Rect wRect; |
| Line 568 int main(int argc, char *argv[]) { | Line 600 int main(int argc, char *argv[]) { |
| pccore_reset(); | pccore_reset(); |
| #if defined(USE_RESUME) | #if defined(USE_RESUME) |
| statsave_load(":np2.sav"); | flagload(np2resume); |
| #endif | #endif |
| SetEventMask(everyEvent); | SetEventMask(everyEvent); |
| Line 635 int main(int argc, char *argv[]) { | Line 667 int main(int argc, char *argv[]) { |
| pccore_cfgupdate(); | pccore_cfgupdate(); |
| #if defined(USE_RESUME) | #if defined(USE_RESUME) |
| statsave_save(":np2.sav"); | flagsave(np2resume); |
| #endif | #endif |
| pccore_term(); | pccore_term(); |