00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023
00024
00025
00026 #include "Device.h"
00027 #include "../Rsc/StarterRsc.h"
00028
00029
00030
00031 UInt32 Device::romVersion;
00032 Boolean Device::supports30;
00033 Boolean Device::supports31;
00034 Boolean Device::supports35;
00035
00036
00037 void Device::panic(Err , Char* message)
00038 {
00039 SysFatalAlert(message);
00040 SysReset();
00041 }
00042
00043
00044 void Device::init()
00045 {
00046 FtrGet(sysFtrCreator, sysFtrNumROMVersion, &Device::romVersion);
00047 if (romVersion >= RomVersion30)
00048 supports30 = true;
00049 if (romVersion >= RomVersion31)
00050 supports31 = true;
00051 if (romVersion >= RomVersion35)
00052 supports35 = true;
00053 }
00054
00055
00056 Err Device::romVersionCompatible(UInt32 requiredVersion, UInt16 launchFlags)
00057 {
00058
00059 if (Device::romVersion < requiredVersion)
00060 {
00061 if ((launchFlags & (sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp)) ==
00062 (sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp))
00063 {
00064 FrmAlert (RomIncompatibleAlert);
00065
00066
00067
00068 if (sysGetROMVerMajor(Device::romVersion) == 1)
00069 {
00070 AppLaunchWithCommand(sysFileCDefaultApp, sysAppLaunchCmdNormalLaunch, NULL);
00071 }
00072 }
00073
00074 return sysErrRomIncompatible;
00075 }
00076
00077 return errNone;
00078 }
00079