マスタエディタ:SDKバージョンチェックを修正。ひとまずバージョンを1.2aにする。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@99 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
nishikawa_takeshi 2008-12-25 04:31:21 +00:00
parent dad92e9bc4
commit abed2bf6bc
7 changed files with 126 additions and 7 deletions

View File

@ -2960,7 +2960,7 @@ private: System::Windows::Forms::CheckBox^ cboxIsUnnecessaryRating;
{
System::Reflection::Assembly ^ass = System::Reflection::Assembly::GetEntryAssembly();
System::Version ^ver = ass->GetName()->Version;
return ( ver->Major.ToString() + "." + ver->Minor.ToString() );
return ( ver->Major.ToString() + "." + ver->Minor.ToString() + "a" );
}
// SRLに登録されないROM仕様のフォーム入力を

View File

@ -1592,19 +1592,35 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
if( this->hMrcSpecialList->IsCheck )
{
// SDKバージョン
System::Boolean match = true;
System::Boolean isOld = false;
System::Boolean isPR = false;
System::Boolean isRC = false;
for each( RCSDKVersion ^sdk in this->hSDKList )
{
if( sdk->IsStatic && (sdk->Code != this->hMrcSpecialList->SDKVer) )
if( sdk->IsStatic )
{
match = false;
isPR = MasterEditorTWL::IsSDKVersionPR( sdk->Code );
isRC = MasterEditorTWL::IsSDKVersionRC( sdk->Code );
isOld = MasterEditorTWL::IsOldSDKVersion( sdk->Code, this->hMrcSpecialList->SDKVer );
}
}
if( !match )
if( isOld )
{
this->hWarnList->Add( gcnew RCMrcError(
"SDKバージョン", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "本プログラムに登録されているバージョン情報と一致しません。",
"SDK Version", "The data doesn't match one registered in this program.", false, true ) );
"SDKバージョン", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "設定ファイルに登録されているバージョンよりも古いバージョンです。",
"SDK Version", "Older version (comparing with a setting file)", false, true ) );
}
if( isPR )
{
this->hWarnList->Add( gcnew RCMrcError(
"SDKバージョン", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "ご使用のSDKバージョンはPR版です。",
"SDK Version", "Used version is PR.", false, true ) );
}
if( isRC )
{
this->hWarnList->Add( gcnew RCMrcError(
"SDKバージョン", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "ご使用のSDKバージョンはRC版です。",
"SDK Version", "Used version is RC.", false, true ) );
}
// Shared2ファイルサイズ

View File

@ -492,3 +492,78 @@ u32 MasterEditorTWL::countBits( const u32 val )
n = (n>>16) + (n & 0x0000ffff);
return n;
}
//
// SDKバージョンの大小判定をする
//
// @arg [in] 判定対象のSDKバージョン(SRLに含まれるもの)
// @arg [in] 判定基準のSDKバージョン(設定ファイルに記述されるもの)
//
// @ret 判定対象が基準よりも旧バージョンのとき(認められないとき) true
//
System::Boolean MasterEditorTWL::IsOldSDKVersion( u32 target, u32 criterion )
{
// SDKバージョンからメジャーバージョン/マイナーバージョン/relstepを抽出
System::Byte majorTar = (System::Byte)(0xff & (target >> 24));
System::Byte minorTar = (System::Byte)(0xff & (target >> 16));
System::UInt16 relstepTar = (System::UInt16)(0xffff & target);
System::Byte majorCri = (System::Byte)(0xff & (criterion >> 24));
System::Byte minorCri = (System::Byte)(0xff & (criterion >> 16));
System::UInt16 relstepCri = (System::UInt16)(0xffff & criterion);
if( majorTar < majorCri )
{
return true;
}
// メジャーが一致するときマイナーを判定
if( (majorTar == majorCri) && (minorTar < minorCri) )
{
return true;
}
// メジャーもマイナーも一致するときrelstepを判定
if( (majorTar == majorCri) && (minorTar == minorCri) && (relstepTar < relstepCri) )
{
if( !MasterEditorTWL::IsSDKVersionPR(relstepTar) && !MasterEditorTWL::IsSDKVersionRC(relstepTar) )
{
return true; // Release版のときのみ
}
}
return false;
}
//
// SDKバージョンがPR版かどうか調べる
//
// @arg [in] 判定対象のSDKバージョン(SRLに含まれるもの)
//
// @ret PR版のとき true
//
System::Boolean MasterEditorTWL::IsSDKVersionPR( u32 target )
{
System::UInt16 relstep = (System::UInt16)(0xffff & target);
if( (10000 <= relstep) && (relstep < 20000) )
{
return true;
}
return false;
}
//
// SDKバージョンがRC版かどうか調べる
//
// @arg [in] 判定対象のSDKバージョン(SRLに含まれるもの)
//
// @ret PR版のとき true
//
System::Boolean MasterEditorTWL::IsSDKVersionRC( u32 target )
{
System::UInt16 relstep = (System::UInt16)(0xffff & target);
if( (20000 <= relstep) && (relstep < 30000) )
{
return true;
}
return false;
}

View File

@ -165,4 +165,32 @@ namespace MasterEditorTWL
//
u32 countBits( const u32 val );
//
// SDKバージョンの大小判定をする
//
// @arg [in] 判定対象のSDKバージョン(SRLに含まれるもの)
// @arg [in] 判定基準のSDKバージョン(設定ファイルに記述されるもの)
//
// @ret 判定対象が基準よりも旧バージョンのとき(認められないとき) true
//
System::Boolean IsOldSDKVersion( u32 target, u32 criterion );
//
// SDKバージョンがPR版かどうか調べる
//
// @arg [in] 判定対象のSDKバージョン(SRLに含まれるもの)
//
// @ret PR版のとき true
//
System::Boolean IsSDKVersionPR( u32 target );
//
// SDKバージョンがRC版かどうか調べる
//
// @arg [in] 判定対象のSDKバージョン(SRLに含まれるもの)
//
// @ret PR版のとき true
//
System::Boolean IsSDKVersionRC( u32 target );
} // end of namespace MasterEditorTWL