Diff for /xmil/macos9/xmil.cpp between versions 1.3 and 1.4

version 1.3, 2004/08/12 11:03:08 version 1.4, 2004/08/12 18:54:26
Line 17 Line 17
 #include        "iocore.h"  #include        "iocore.h"
 #include        "timing.h"  #include        "timing.h"
 #include        "keystat.h"  #include        "keystat.h"
   #if defined(SUPPORT_RESUME) || defined(SUPPORT_STATSAVE)
   #include        "statsave.h"
   #endif
 #include        "debugsub.h"  #include        "debugsub.h"
 #include        "scrndraw.h"  #include        "scrndraw.h"
 #include        "makescrn.h"  #include        "makescrn.h"
Line 28 Line 31
 // #define      USE_RESUME  // #define      USE_RESUME
   
   
                 XMILOSCFG       xmiloscfg = {100, 100,  0, 0, 0, 0, 0, 0};                  XMILOSCFG       xmiloscfg = {   100, 100,
                                                                           0, 0, 0,
                                                                           0, 0,
   #if defined(SUPPORT_RESUME)
                                                                           0,
   #endif
   #if defined(SUPPORT_STATSAVE)
                                                                           1,
   #endif
                                                                           0};
   
                 WindowPtr       hWndMain;                  WindowPtr       hWndMain;
                 BRESULT         xmilrunning;                  BRESULT         xmilrunning;
Line 44  static REG8  scrnmode; Line 56  static REG8  scrnmode;
 #endif  #endif
 static  char    target[MAX_PATH] = DEFAULTPATH;  static  char    target[MAX_PATH] = DEFAULTPATH;
   
 #if !defined(SUPPORT_PC9821)  
 static const char np2app[] = "np2";  static const char xmilapp[] = "xmil";
 #else  
 static const char np2app[] = "np21";  
   // ---- stat save...
   
   #if defined(SUPPORT_RESUME)
   static const char xmilresumeext[] = ".sav";
   #endif
   #if defined(SUPPORT_STATSAVE)
   static const char xmilflagext[] = ".sv%u";
 #endif  #endif
   
 static const char np2resume[] = "sav";  #if defined(SUPPORT_RESUME) || defined(SUPPORT_STATSAVE)
   static void getstatfilename(char *path, const char *ext, UINT size) {
   
           file_cpyname(path, file_getcd(xmilapp), size);
           file_catname(path, ext, size);
   }
   
   static void flagsave(const char *ext) {
   
           char    path[MAX_PATH];
   
           getstatfilename(path, ext, NELEMENTS(path));
           statsave_save(path);
   }
   
   static void flagdelete(const char *ext) {
   
           char    path[MAX_PATH];
   
           getstatfilename(path, ext, NELEMENTS(path));
           file_delete(path);
   }
   
   static int flagload(const char *ext, BRESULT force) {
   
           int             ret;
           char    path[MAX_PATH];
           char    buf[1024];
           int             r;
   
           ret = IDOK;
           getstatfilename(path, ext, NELEMENTS(path));
           r = statsave_check(path, buf, NELEMENTS(buf));
           if (r & (~STATFLAG_DISKCHG)) {
                   ResumeErrorDialogProc();
                   ret = IDCANCEL;
           }
           else if ((!force) && (r & STATFLAG_DISKCHG)) {
                   ret = ResumeWarningDialogProc(buf);
           }
           else {
                   ret = IDOK;
           }
           if (ret == IDOK) {
                   statsave_load(path);
           }
           return(ret);
   }
   #endif
   
   
 // ---- おまじない  // ---- おまじない
Line 124  static void MenuBarInit(void) { Line 191  static void MenuBarInit(void) {
         EnableItem(GetMenuHandle(IDM_DEVICE), LoWord(IDM_MOUSE));          EnableItem(GetMenuHandle(IDM_DEVICE), LoWord(IDM_MOUSE));
 #endif  #endif
   
         DeleteMenu(IDM_FDD2);          if (!(xmilcfg.fddequip & (1 << 3))) {
         DeleteMenu(IDM_FDD3);                  DeleteMenu(IDM_FDD3);
           }
           if (!(xmilcfg.fddequip & (1 << 2))) {
                   DeleteMenu(IDM_FDD2);
           }
           if (!(xmilcfg.fddequip & (1 << 1))) {
                   DeleteMenu(IDM_FDD1);
           }
           if (!(xmilcfg.fddequip & (1 << 0))) {
                   DeleteMenu(IDM_FDD0);
           }
   
   #if defined(SUPPORT_STATSAVE)
           if (!xmiloscfg.statsave) {
   #endif
                   DeleteMenu(IDM_STATSAVE);
   #if defined(SUPPORT_STATSAVE)
           }
   #endif
   
         DrawMenuBar();          DrawMenuBar();
 }  }
Line 134  static void HandleMenuChoice(long wParam Line 219  static void HandleMenuChoice(long wParam
   
         UINT    update;          UINT    update;
         Str255  applname;          Str255  applname;
   #if defined(SUPPORT_STATSAVE)
           UINT    num;
           char    ext[16];
   #endif
   
         update = 0;          update = 0;
         switch(wParam) {          switch(wParam) {
Line 229  static void HandleMenuChoice(long wParam Line 318  static void HandleMenuChoice(long wParam
                         break;                          break;
   
                 case IDM_WIDTH80:                  case IDM_WIDTH80:
                         crtc.s.TXT_XL = 80;                          crtc_forcesetwidth(80);
 //                      crtc.s.GRP_XL = 640;  
                         vrambank_patch();  
                         scrnallflash = 1;  
                         break;                          break;
   
                 case IDM_WIDTH40:                  case IDM_WIDTH40:
                         crtc.s.TXT_XL = 40;                          crtc_forcesetwidth(40);
 //                      crtc.s.GRP_XL = 320;  
                         vrambank_patch();  
                         scrnallflash = 1;  
                         break;                          break;
   
                 case IDM_DISPSYNC:                  case IDM_DISPSYNC:
Line 355  static void HandleMenuChoice(long wParam Line 438  static void HandleMenuChoice(long wParam
                                 (void)OpenDeskAcc(applname);                                  (void)OpenDeskAcc(applname);
 #endif  #endif
                         }                          }
   #if defined(SUPPORT_STATSAVE)
                           else if (HiWord(wParam) == IDM_STATSAVE) {
                                   num = LoWord(wParam);
                                   if ((num >= 1) && (num < (1 + 10))) {
                                           OEMSPRINTF(ext, xmilflagext, num - 1);
                                           flagsave(ext);
                                   }
                                   else if ((num >= 12) && (num < (12 + 10))) {
                                           OEMSPRINTF(ext, xmilflagext, num - 12);
                                           flagload(ext, TRUE);
                                   }
                           }
   #endif
                         break;                          break;
         }          }
         sysmng_update(update);          sysmng_update(update);
Line 482  static void eventproc(EventRecord *event Line 578  static void eventproc(EventRecord *event
 }  }
   
   
 #if 0  
 // ----  
   
 static void getstatfilename(char *path, const char *ext, int size) {  
   
         file_cpyname(path, file_getcd(np2app), 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 flagdelete(const char *ext) {  
   
         char    path[MAX_PATH];  
   
         getstatfilename(path, ext, sizeof(path));  
         file_delete(path);  
 }  
   
 static int flagload(const char *ext) {  
   
         int             ret;  
         char    path[MAX_PATH];  
         char    buf[1024];  
         int             r;  
   
         ret = IDOK;  
         getstatfilename(path, ext, sizeof(path));  
         r = statsave_check(path, buf, sizeof(buf));  
         if (r & (~STATFLAG_DISKCHG)) {  
                 ResumeErrorDialogProc();  
                 ret = IDCANCEL;  
         }  
         else if (r & STATFLAG_DISKCHG) {  
                 ret = ResumeWarningDialogProc(buf);  
         }  
         if (ret == IDOK) {  
                 statsave_load(path);  
         }  
         return(ret);  
 }  
 #endif  
   
   
 // ----  // ----
   
 static  UINT    framecnt = 0;  static  UINT    framecnt = 0;
Line 644  int main(int argc, char *argv[]) { Line 689  int main(int argc, char *argv[]) {
         pccore_initialize();          pccore_initialize();
         pccore_reset();          pccore_reset();
   
 #if 0  #if defined(SUPPORT_RESUME)
         if (np2oscfg.resume) {          if (xmiloscfg.resume) {
                 flagload(np2resume);                  flagload(xmilresumeext, FALSE);
         }          }
 #endif  #endif
   
Line 731  int main(int argc, char *argv[]) { Line 776  int main(int argc, char *argv[]) {
   
         xmilrunning = FALSE;          xmilrunning = FALSE;
   
 #if 0  #if defined(SUPPORT_RESUME)
         if (np2oscfg.resume) {          if (xmiloscfg.resume) {
                 flagsave(np2resume);                  flagsave(xmilresumeext);
         }          }
         else {          else {
                 flagdelete(np2resume);                  flagdelete(xmilresumeext);
         }          }
 #endif  #endif
   

Removed from v.1.3  
changed lines
  Added in v.1.4


RetroPC.NET-CVS <cvs@retropc.net>