Diff for /np2/macosx/np2.cpp between versions 1.26 and 1.27

version 1.26, 2003/10/31 16:55:06 version 1.27, 2003/11/03 10:19:43
Line 37 Line 37
 #include        "midiopt.h"  #include        "midiopt.h"
 #include        "macalert.h"  #include        "macalert.h"
 #include        "np2opening.h"  #include        "np2opening.h"
   #include        "toolmac.h"
   
 #include        <QuickTime/QuickTime.h>  #include        <QuickTime/QuickTime.h>
 #define USE_RESUME  #define USE_RESUME
Line 92  pascal OSErr OpenAppleEventHandler(const Line 93  pascal OSErr OpenAppleEventHandler(const
         AEKeyword       key;          AEKeyword       key;
         AEDescList      dlist;          AEDescList      dlist;
                   
         if( ! AEGetParamDesc( event,keyDirectObject,typeAEList,&dlist ) )       {          if(!AEGetParamDesc(event,keyDirectObject,typeAEList,&dlist))    {
                 AECountItems( &dlist,&ct );                  AECountItems( &dlist,&ct );
                 for( i=1;i<=ct;i++ )    {                  for( i=1;i<=ct;i++ )    {
             pp=&fsc;              pp=&fsc;
                         if( ! AEGetNthPtr( &dlist,i,typeFSS,&key,&rtype,(Ptr)pp,(long)sizeof(FSSpec),&len ) )   {                          if (!AEGetNthPtr( &dlist,i,typeFSS,&key,&rtype,(Ptr)pp,(long)sizeof(FSSpec),&len))      {
                 char            fname[MAX_PATH];                  setDropFile(fsc, i-1);
                 int                     ftype;  
                 fsspec2path(&fsc, fname, MAX_PATH);  
                 ftype = file_getftype(fname);  
                 if ((ftype != FTYPE_D88) && (ftype != FTYPE_BETA)) {  
                     diskdrv_sethdd(0, fname);  
                 }  
                 else {  
                     diskdrv_setfdd(i-1, fname, 0);  
                 }  
                         }                          }
                 }                  }
                 AEDisposeDesc( &dlist );                  AEDisposeDesc( &dlist );
Line 232  static void HandleMenuChoice(long wParam Line 224  static void HandleMenuChoice(long wParam
   
                 case IDM_FDD1EJECT:                  case IDM_FDD1EJECT:
                         diskdrv_setfdd(0, NULL, 0);                          diskdrv_setfdd(0, NULL, 0);
               toolwin_setfdd(0, NULL);
                         break;                          break;
   
                 case IDM_FDD2OPEN:                  case IDM_FDD2OPEN:
Line 240  static void HandleMenuChoice(long wParam Line 233  static void HandleMenuChoice(long wParam
   
                 case IDM_FDD2EJECT:                  case IDM_FDD2EJECT:
                         diskdrv_setfdd(1, NULL, 0);                          diskdrv_setfdd(1, NULL, 0);
               toolwin_setfdd(1, NULL);
                         break;                          break;
   
                 case IDM_SASI1OPEN:                  case IDM_SASI1OPEN:
Line 558  static void processwait(UINT waitcnt) { Line 552  static void processwait(UINT waitcnt) {
         if (timing_getcount() >= waitcnt) {          if (timing_getcount() >= waitcnt) {
                 framecnt = 0;                  framecnt = 0;
                 timing_setcount(0);                  timing_setcount(0);
                   toolwin_draw((BYTE)waitcnt);
                 if (np2oscfg.DISPCLK & 3) {                  if (np2oscfg.DISPCLK & 3) {
                         if (sysmng_workclockrenewal()) {                          if (sysmng_workclockrenewal()) {
                                 sysmng_updatecaption(3);                                  sysmng_updatecaption(3);
Line 607  static void flagload(const char *ext) { Line 602  static void flagload(const char *ext) {
         }          }
         if (ret == IDOK) {          if (ret == IDOK) {
                 statsave_load(path);                  statsave_load(path);
                   toolwin_setfdd(0, fdd_diskname(0));
                   toolwin_setfdd(1, fdd_diskname(1));
         }          }
         return;          return;
 }  }
Line 629  int main(int argc, char *argv[]) { Line 626  int main(int argc, char *argv[]) {
         initload();          initload();
   
         TRACEINIT();          TRACEINIT();
       
       toolwin_readini();
     if (!(setupMainWindow())) {      if (!(setupMainWindow())) {
         return(0);          return(0);
     }      }
Line 767  int main(int argc, char *argv[]) { Line 765  int main(int argc, char *argv[]) {
         toggleFullscreen();          toggleFullscreen();
     }      }
           
       toolwin_writeini();
         pccore_cfgupdate();          pccore_cfgupdate();
   
 #if defined(USE_RESUME)  #if defined(USE_RESUME)
Line 797  int main(int argc, char *argv[]) { Line 796  int main(int argc, char *argv[]) {
         dosio_term();          dosio_term();
   
         DisposeWindow(hWndMain);          DisposeWindow(hWndMain);
       toolwin_close();
   
         (void)argc;          (void)argc;
         (void)argv;          (void)argv;
Line 908  static pascal OSStatus np2windowevent(Ev Line 908  static pascal OSStatus np2windowevent(Ev
                         np2running = FALSE;                          np2running = FALSE;
                         result = noErr;                          result = noErr;
                         break;                          break;
                     case kEventWindowShowing:  
                         scrndraw_redraw();  
                        break;  
                     case kEventWindowActivated:                      case kEventWindowActivated:
                         DisableAllMenuItems(GetMenuHandle(IDM_EDIT));                          DisableAllMenuItems(GetMenuHandle(IDM_EDIT));
                         break;                          break;
                       case kEventWindowToolbarSwitchMode:
                           toolwin_open();
                           break;
                       case kEventWindowDragStarted:
                           soundmng_stop();
                           break;
                       case kEventWindowDragCompleted:
                           soundmng_play();
                           break;
                 }                  }
                 break;                  break;
             case kEventClassKeyboard:              case kEventClassKeyboard:
Line 978  static const EventTypeSpec appEventList[ Line 984  static const EventTypeSpec appEventList[
   
 static const EventTypeSpec windEventList[] = {  static const EventTypeSpec windEventList[] = {
                                 {kEventClassWindow,             kEventWindowClose},                                  {kEventClassWindow,             kEventWindowClose},
                                 {kEventClassWindow,             kEventWindowShowing},  
                                 {kEventClassWindow,             kEventWindowActivated},                                  {kEventClassWindow,             kEventWindowActivated},
                                   {kEventClassWindow,             kEventWindowToolbarSwitchMode},
                                   {kEventClassWindow,             kEventWindowDragStarted},
                                   {kEventClassWindow,             kEventWindowDragCompleted},
                                 {kEventClassKeyboard,   kEventRawKeyDown},                                  {kEventClassKeyboard,   kEventRawKeyDown},
                                 {kEventClassKeyboard,   kEventRawKeyUp},                                  {kEventClassKeyboard,   kEventRawKeyUp},
                                 {kEventClassKeyboard,   kEventRawKeyRepeat},                                  {kEventClassKeyboard,   kEventRawKeyRepeat},
Line 999  static void setUpCarbonEvent(void) { Line 1007  static void setUpCarbonEvent(void) {
     InstallStandardEventHandler(GetWindowEventTarget(hWndMain));      InstallStandardEventHandler(GetWindowEventTarget(hWndMain));
 }  }
   
 bool setupMainWindow(void) {  static bool setupMainWindow(void) {
 #if defined(NP2GCC)  #if defined(NP2GCC)
     OSStatus    err;      OSStatus    err;
     IBNibRef    nibRef;      IBNibRef    nibRef;
Line 1033  bool setupMainWindow(void) { Line 1041  bool setupMainWindow(void) {
     return(true);      return(true);
 }  }
   
 void toggleFullscreen(void) {  static void toggleFullscreen(void) {
     static Ptr  bkfullscreen;      static Ptr  bkfullscreen;
     static BYTE mouse = 0;      static BYTE mouse = 0;
   
Line 1066  void toggleFullscreen(void) { Line 1074  void toggleFullscreen(void) {
     CheckMenuItem(GetMenuHandle(IDM_SCREEN), LoWord(IDM_FULLSCREEN), scrnmode & SCRNMODE_FULLSCREEN);      CheckMenuItem(GetMenuHandle(IDM_SCREEN), LoWord(IDM_FULLSCREEN), scrnmode & SCRNMODE_FULLSCREEN);
     soundmng_play();      soundmng_play();
 }  }
   
   void recieveCommand(long param) {
       HandleMenuChoice(param);
   }

Removed from v.1.26  
changed lines
  Added in v.1.27


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