Diff for /xmil/MacOSX/xmil.cpp between versions 1.1 and 1.4

version 1.1, 2004/08/10 14:38:56 version 1.4, 2004/08/14 05:41:05
Line 60  static pascal OSErr handleQuitApp(const  Line 60  static pascal OSErr handleQuitApp(const 
   
 static void InitToolBox(void) {  static void InitToolBox(void) {
   
         FlushEvents(everyEvent, 0);  
         InitCursor();          InitCursor();
   
         AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,          AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
Line 69  static void InitToolBox(void) { Line 68  static void InitToolBox(void) {
   
 static void MenuBarInit(void) {  static void MenuBarInit(void) {
   
         Handle          hdl;      OSStatus    err;
         MenuHandle      hmenu;          IBNibRef        nibRef;
       
         hdl = GetNewMBar(IDM_MAINMENU);      err = CreateNibReference(CFSTR("main"), &nibRef);
         if (hdl == NULL) {      if (err != noErr) ExitToShell();
                 ExitToShell();      err = SetMenuBarFromNib(nibRef, CFSTR("MenuBar"));
         }  
         SetMenuBar(hdl);  
         hmenu = GetMenuHandle(IDM_APPLE);  
         if (hmenu) {  
                 AppendResMenu(hmenu, 'DRVR');  
         }  
   
         if (!xmiloscfg.Z80SAVE) {          if (!xmiloscfg.Z80SAVE) {
                 hmenu = GetMenuHandle(IDM_OTHER);                  DeleteMenuItem(GetMenuRef(IDM_OTHER), 7);
                 if (hmenu) {  
                         DeleteMenuItem(hmenu, 7);  
                 }  
         }          }
   
         hmenu = GetMenuHandle(IDM_FDD1);      DisableAllMenuItems(GetMenuHandle(IDM_EDIT));
         SetItemCmd(hmenu, LoWord(IDM_FDD1OPEN), 'D');  
         SetMenuItemModifiers(hmenu, LoWord(IDM_FDD1OPEN), kMenuShiftModifier);  
         SetItemCmd(hmenu, LoWord(IDM_FDD1EJECT), 'E');  
         SetMenuItemModifiers(hmenu, LoWord(IDM_FDD1EJECT), kMenuShiftModifier);  
         EnableMenuItem(GetMenuHandle(IDM_DEVICE), LoWord(IDM_MOUSE));  
   
         DeleteMenu(IDM_FDD2);          if (!(xmilcfg.fddequip & (1 << 3))) {
         DeleteMenu(IDM_FDD3);                  DeleteMenu(IDM_FDD3);
           } else {
                   ChangeMenuAttributes(GetMenuRef(IDM_FDD3), 0, kMenuAttrHidden);
           }
           if (!(xmilcfg.fddequip & (1 << 2))) {
                   DeleteMenu(IDM_FDD2);
           } else {
                   ChangeMenuAttributes(GetMenuRef(IDM_FDD2), 0, kMenuAttrHidden);
           }
           if (!(xmilcfg.fddequip & (1 << 1))) {
                   DeleteMenu(IDM_FDD1);
           }
           if (!(xmilcfg.fddequip & (1 << 0))) {
                   DeleteMenu(IDM_FDD0);
           }
   
         DrawMenuBar();  
 }  }
   
 static void HandleMenuChoice(long wParam) {  static void HandleMenuChoice(long wParam) {
Line 139  static void HandleMenuChoice(long wParam Line 137  static void HandleMenuChoice(long wParam
   
                 case IDM_FDD0EJECT:                  case IDM_FDD0EJECT:
                         diskdrv_setfdd(0, NULL, 0);                          diskdrv_setfdd(0, NULL, 0);
                           //DisableMenuItem(GetMenuRef(IDM_FDD0), IDM_FDD0EJECT);
                         break;                          break;
   
                 case IDM_FDD1OPEN:                  case IDM_FDD1OPEN:
Line 147  static void HandleMenuChoice(long wParam Line 146  static void HandleMenuChoice(long wParam
   
                 case IDM_FDD1EJECT:                  case IDM_FDD1EJECT:
                         diskdrv_setfdd(1, NULL, 0);                          diskdrv_setfdd(1, NULL, 0);
                           //DisableMenuItem(GetMenuRef(IDM_FDD1), IDM_FDD1EJECT);
                         break;                          break;
   
                 case IDM_FDD2OPEN:                  case IDM_FDD2OPEN:
Line 155  static void HandleMenuChoice(long wParam Line 155  static void HandleMenuChoice(long wParam
   
                 case IDM_FDD2EJECT:                  case IDM_FDD2EJECT:
                         diskdrv_setfdd(2, NULL, 0);                          diskdrv_setfdd(2, NULL, 0);
                           //DisableMenuItem(GetMenuRef(IDM_FDD2), IDM_FDD2EJECT);
                         break;                          break;
   
                 case IDM_FDD3OPEN:                  case IDM_FDD3OPEN:
Line 163  static void HandleMenuChoice(long wParam Line 164  static void HandleMenuChoice(long wParam
   
                 case IDM_FDD3EJECT:                  case IDM_FDD3EJECT:
                         diskdrv_setfdd(3, NULL, 0);                          diskdrv_setfdd(3, NULL, 0);
                           //DisableMenuItem(GetMenuRef(IDM_FDD3), IDM_FDD3EJECT);
                         break;                          break;
   
                 case IDM_TURBOZ:                  case IDM_TURBOZ:
Line 201  static void HandleMenuChoice(long wParam Line 203  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 286  static void HandleMenuChoice(long wParam Line 282  static void HandleMenuChoice(long wParam
                         update = SYS_UPDATECFG;                          update = SYS_UPDATECFG;
                         break;                          break;
   
                 case IDM_8MHZ:  
                         menu_setcpuspeed(xmilcfg.CPU8MHz ^ 1);  
                         update = SYS_UPDATECFG;  
                         break;  
   
                 case IDM_SEEKSND:                  case IDM_SEEKSND:
                         menu_setmotorflg(xmilcfg.MOTOR ^ 1);                          menu_setmotorflg(xmilcfg.MOTOR ^ 1);
                         update = SYS_UPDATECFG;                          update = SYS_UPDATECFG;
Line 325  static void HandleMenuChoice(long wParam Line 316  static void HandleMenuChoice(long wParam
                         break;                          break;
   
                 default:                  default:
                         if (HiWord(wParam) == IDM_APPLE) {  
                                 GetMenuItemText(GetMenuHandle(IDM_APPLE),   
                                                                                         LoWord(wParam), applname);  
                         }  
                         break;                          break;
         }          }
         sysmng_update(update);          sysmng_update(update);
         HiliteMenu(0);          HiliteMenu(0);
 }  }
   #if 0
 static void HandleUpdateEvent(EventRecord *pevent) {  static void HandleUpdateEvent(EventRecord *pevent) {
   
         WindowPtr       hWnd;          WindowPtr       hWnd;
Line 349  static void HandleUpdateEvent(EventRecor Line 336  static void HandleUpdateEvent(EventRecor
         }          }
         EndUpdate(hWnd);          EndUpdate(hWnd);
 }  }
   #endif
 static void HandleMouseDown(EventRecord *pevent) {  static void HandleMouseDown(EventRecord *pevent) {
   
         WindowPtr       hWnd;          WindowPtr       hWnd;
Line 364  static void HandleMouseDown(EventRecord  Line 351  static void HandleMouseDown(EventRecord 
                                 soundmng_play();                                  soundmng_play();
                         }                          }
                         break;                          break;
   
                 case inContent:  
                         mousemng_buttonevent(MOUSEMNG_LEFTDOWN);  
                         break;  
         }          }
 }  }
   #if 0
 static void eventproc(EventRecord *event) {  static void eventproc(EventRecord *event) {
   
         int             keycode;          int             keycode;
Line 425  static void eventproc(EventRecord *event Line 408  static void eventproc(EventRecord *event
                         break;                          break;
         }          }
 }  }
   #endif
   
 #if 0  #if 0
 // ----  // ----
Line 562  int main(int argc, char *argv[]) { Line 545  int main(int argc, char *argv[]) {
         menu_setkey(0);          menu_setkey(0);
         menu_setsound(xmilcfg.SOUND_SW);          menu_setsound(xmilcfg.SOUND_SW);
         menu_setmouse(xmilcfg.MOUSE_SW);          menu_setmouse(xmilcfg.MOUSE_SW);
         menu_setcpuspeed(xmilcfg.CPU8MHz);  
         menu_setmotorflg(xmilcfg.MOTOR);          menu_setmotorflg(xmilcfg.MOTOR);
         menu_setdispclk(xmiloscfg.DISPCLK);          menu_setdispclk(xmiloscfg.DISPCLK);
         menu_setbtnmode(xmilcfg.BTN_MODE);          menu_setbtnmode(xmilcfg.BTN_MODE);
Line 714  int main(int argc, char *argv[]) { Line 696  int main(int argc, char *argv[]) {
         return(0);          return(0);
 }  }
   
   
 void wrapperMouseDown(EventRef event) {  void wrapperMouseDown(EventRef event) {
     EventRecord eve;      EventRecord eve;
                   
     ConvertEventRefToEventRecord( event,&eve );      ConvertEventRefToEventRecord( event,&eve );
         HandleMouseDown(&eve);          HandleMouseDown(&eve);
 }  }
   
   void wrapperKeyDown(EventRef event) {
       EventRecord eve;
           
       ConvertEventRefToEventRecord( event,&eve );
           soundmng_stop();
           mousemng_disable(MOUSEPROC_MACUI);
           HandleMenuChoice(MenuEvent(&eve));
           mousemng_enable(MOUSEPROC_MACUI);
           soundmng_play();
   }
   

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


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