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

version 1.26, 2003/10/31 16:55:06 version 1.32, 2003/11/06 18:27:59
Line 37 Line 37
 #include        "midiopt.h"  #include        "midiopt.h"
 #include        "macalert.h"  #include        "macalert.h"
 #include        "np2opening.h"  #include        "np2opening.h"
   #include        "toolwin.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 553  static void HandleMouseDown(EventRecord  Line 547  static void HandleMouseDown(EventRecord 
   
 // ----  // ----
   
   static void framereset(UINT waitcnt) {
   
           framecnt = 0;
           toolwin_draw((BYTE)waitcnt);
           if (np2oscfg.DISPCLK & 3) {
                   if (sysmng_workclockrenewal()) {
                           sysmng_updatecaption(3);
                   }
           }
   }
   
 static void processwait(UINT waitcnt) {  static void processwait(UINT waitcnt) {
   
         if (timing_getcount() >= waitcnt) {          if (timing_getcount() >= waitcnt) {
                 framecnt = 0;  
                 timing_setcount(0);                  timing_setcount(0);
                 if (np2oscfg.DISPCLK & 3) {                  framereset(waitcnt);
                         if (sysmng_workclockrenewal()) {  
                                 sysmng_updatecaption(3);  
                         }  
                 }  
         }          }
 }  }
   
Line 607  static void flagload(const char *ext) { Line 607  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 618  int main(int argc, char *argv[]) { Line 620  int main(int argc, char *argv[]) {
 #ifdef OPENING_WAIT  #ifdef OPENING_WAIT
         UINT32          tick;          UINT32          tick;
 #endif  #endif
     
         dosio_init();          dosio_init();
         file_setcd(target);          file_setcd(target);
   
Line 629  int main(int argc, char *argv[]) { Line 631  int main(int argc, char *argv[]) {
         initload();          initload();
   
         TRACEINIT();          TRACEINIT();
       
       toolwin_readini();
     if (!(setupMainWindow())) {      if (!(setupMainWindow())) {
         return(0);          return(0);
     }      }
Line 750  int main(int argc, char *argv[]) { Line 753  int main(int argc, char *argv[]) {
                                                 else {                                                  else {
                                                         timing_setcount(cnt - framecnt);                                                          timing_setcount(cnt - framecnt);
                                                 }                                                  }
                                                 processwait(0);                                                  framereset(0);
                                         }                                          }
                                 }                                  }
                                 else {                                  else {
Line 790  int main(int argc, char *argv[]) { Line 793  int main(int argc, char *argv[]) {
         scrnmng_destroy();          scrnmng_destroy();
   
         if (sys_updates & (SYS_UPDATECFG | SYS_UPDATEOSCFG)) {          if (sys_updates & (SYS_UPDATECFG | SYS_UPDATEOSCFG)) {
                 initsave();                  initsave();                                             // np2.cfg create
               toolwin_writeini();                         // np2.cfg append
         }          }
         TRACETERM();          TRACETERM();
         macossub_term();          macossub_term();
         dosio_term();          dosio_term();
   
         DisposeWindow(hWndMain);          DisposeWindow(hWndMain);
       toolwin_close();
   
         (void)argc;          (void)argc;
         (void)argv;          (void)argv;
Line 905  static pascal OSStatus np2windowevent(Ev Line 910  static pascal OSStatus np2windowevent(Ev
                 switch (whatHappened)                  switch (whatHappened)
                 {                  {
                     case kEventWindowClose:                      case kEventWindowClose:
                         np2running = FALSE;                          taskmng_exit();
                         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;
                       case kEventWindowShown:
                           scrndraw_redraw();
                           break;
                 }                  }
                 break;                  break;
             case kEventClassKeyboard:              case kEventClassKeyboard:
Line 978  static const EventTypeSpec appEventList[ Line 992  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},
                                   {kEventClassWindow,             kEventWindowShown},
                                 {kEventClassKeyboard,   kEventRawKeyDown},                                  {kEventClassKeyboard,   kEventRawKeyDown},
                                 {kEventClassKeyboard,   kEventRawKeyUp},                                  {kEventClassKeyboard,   kEventRawKeyUp},
                                 {kEventClassKeyboard,   kEventRawKeyRepeat},                                  {kEventClassKeyboard,   kEventRawKeyRepeat},
Line 996  static void setUpCarbonEvent(void) { Line 1013  static void setUpCarbonEvent(void) {
         InstallWindowEventHandler(hWndMain, NewEventHandlerUPP(np2windowevent),          InstallWindowEventHandler(hWndMain, NewEventHandlerUPP(np2windowevent),
                                                                 GetEventTypeCount(windEventList),                                                                  GetEventTypeCount(windEventList),
                                                                 windEventList, 0, NULL);                                                                  windEventList, 0, NULL);
     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 1049  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 1082  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.32


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