Diff for /xmil/palm/m68k.c between versions 1.1 and 1.3

version 1.1, 2005/02/07 16:56:32 version 1.3, 2005/02/27 18:22:06
Line 1 Line 1
 /**********  
  * Copyright (c) 2004 Greg Parker.  All rights reserved.  
  *  
  * Redistribution and use in source and binary forms, with or without  
  * modification, are permitted provided that the following conditions  
  * are met:  
  * 1. Redistributions of source code must retain the above copyright  
  *    notice, this list of conditions and the following disclaimer.  
  * 2. Redistributions in binary form must reproduce the above copyright  
  *    notice, this list of conditions and the following disclaimer in the  
  *    documentation and/or other materials provided with the distribution.  
  *  
  * THIS SOFTWARE IS PROVIDED BY GREG PARKER ``AS IS'' AND ANY EXPRESS OR  
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES  
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,  
  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT  
  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,  
  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY  
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF  
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
  **********/  
   
 #include <PalmOS.h>  #include <PalmOS.h>
 #include <PalmCompatibility.h>  #include <PalmCompatibility.h>
 #include <PalmOSGlue.h>  #include <PalmOSGlue.h>
Line 32 Line 8
 #include "resource.h"  #include "resource.h"
 #include "UFD.h"  #include "UFD.h"
   
   #ifndef vfsVolumeAttrNonRemovable
   #define vfsVolumeAttrNonRemovable       0x00000008L
   #endif
   
   
 #define ByteSwap16(n) ( ((((unsigned int) n) << 8) & 0xFF00) | \  #define ByteSwap16(n) ( ((((unsigned int) n) << 8) & 0xFF00) | \
 ((((unsigned int) n) >> 8) & 0x00FF) )  ((((unsigned int) n) >> 8) & 0x00FF) )
Line 41 Line 21
 ((((unsigned long) n) >> 8) & 0x0000FF00) | \  ((((unsigned long) n) >> 8) & 0x0000FF00) | \
 ((((unsigned long) n) >> 24) & 0x000000FF) )  ((((unsigned long) n) >> 24) & 0x000000FF) )
   
 static  UInt16 volRefNum;  static  UInt16 volRefNum = vfsInvalidVolRef;
 enum {  enum {
         SEEK_SET        = 0,          SEEK_SET        = 0,
         SEEK_CUR        = 1,          SEEK_CUR        = 1,
Line 81  void unload(PealModule *m) Line 61  void unload(PealModule *m)
     PealUnload(m);      PealUnload(m);
 }  }
   
   static void disp_error(const char* msg, const char* data) {
   
           char str[256];
           MemSet(str, 255, 0);
           StrCat(str, msg);
           StrCat(str, data);
   
           FrmCustomAlert(IDD_ALERT, str, NULL, NULL);
   }
   
           
 static BOOL checkHR(void) {  static BOOL checkHR(void) {
   
 // HighDensity機能の有無をチェック  // HighDensity機能の有無をチェック
Line 195  FileRef file_open_68k(void* path) { Line 186  FileRef file_open_68k(void* path) {
         if (!error) {          if (!error) {
                 return(ref);                  return(ref);
         }          }
           
           disp_error("cannot open this file: ", path);
         return(FILEH_INVALID);          return(FILEH_INVALID);
 }  }
   
Line 214  FileRef file_create_68k(void *path) { Line 207  FileRef file_create_68k(void *path) {
                         }                          }
                 }                  }
         }          }
           disp_error("cannot create this file: ", path);
         return(FILEH_INVALID);          return(FILEH_INVALID);
 }  }
   
Line 328  short file_dircreate_68k(const void *pat Line 322  short file_dircreate_68k(const void *pat
                 return(0);                  return(0);
         }          }
   
           disp_error("cannot create this dir: ", path);
         return(-1);          return(-1);
 }  }
   
Line 622  UInt32 PilotMain(UInt16 cmd, void *cmdPB Line 617  UInt32 PilotMain(UInt16 cmd, void *cmdPB
 {  {
     PealModule *m;      PealModule *m;
         UInt32 volIterator = vfsIteratorStart;          UInt32 volIterator = vfsIteratorStart;
           VolumeInfoType  info;
     FormType *frmP;      FormType *frmP;
         Err err;  
         int     ret;          int     ret;
         const RGBColorType      white = {0, 255, 255, 255};          const RGBColorType      white = {0, 255, 255, 255};
   
Line 634  UInt32 PilotMain(UInt16 cmd, void *cmdPB Line 629  UInt32 PilotMain(UInt16 cmd, void *cmdPB
                 FrmCustomAlert(IDD_ALERT, "cannot run under this device.", NULL, NULL);                  FrmCustomAlert(IDD_ALERT, "cannot run under this device.", NULL, NULL);
                 return 0;                  return 0;
         }          }
           
         FrmGotoForm(IDD_MAIN);          FrmGotoForm(IDD_MAIN);
         frmP = FrmInitForm(IDD_MAIN);          frmP = FrmInitForm(IDD_MAIN);
         FrmSetActiveForm(frmP);          FrmSetActiveForm(frmP);
Line 641  UInt32 PilotMain(UInt16 cmd, void *cmdPB Line 637  UInt32 PilotMain(UInt16 cmd, void *cmdPB
         WinSetBackColorRGB(&white, NULL);          WinSetBackColorRGB(&white, NULL);
   
         while (volIterator != vfsIteratorStop) {          while (volIterator != vfsIteratorStop) {
                 err = VFSVolumeEnumerate(&volRefNum, &volIterator);                  if (VFSVolumeEnumerate(&volRefNum, &volIterator) == errNone) {
                 if (err == errNone) {                          if (VFSVolumeInfo(volRefNum, &info) == errNone) {
                         break;                                  if ((!info.attributes & vfsVolumeAttrHidden) && (!info.attributes & vfsVolumeAttrNonRemovable)) {
                                           break;
                                   }
                           }
                 }                  }
         }          }
           
         m = load();          m = load();
         ret = setup(m);          ret = setup(m);
     unload(m);      unload(m);

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


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