マスタエディタ:MRCデバッグで出たバグを修正。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2546 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
nishikawa_takeshi 2008-09-24 10:33:46 +00:00
parent 2f383c05aa
commit 59e3269b2e
8 changed files with 51 additions and 8 deletions

View File

@ -3899,7 +3899,7 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ colErrorCause;
this->sucMsg(
"Step1/2: ROMデータファイル(SRL)と提出確認書の情報を一致させるため、まず、入力情報を反映させたROMデータファイルを作成します。\n(キャンセルされたとき、SRLおよび提出確認書は作成されません。)\n"
+ "\n ROMデータファイル名は \"" + srlfile + "\"となります。\n" + "\nROMデータファイルを保存するフォルダを選択してください。",
"Step1/2: Firstly, We save ROM file(SRL) because several information in a submission sheet are match those in the ROM data file.\n(When it is canceled, both the SRL and a submission sheet are not made.)"
"Step1/2: Firstly, We save ROM file(SRL) because several information in a submission sheet are match those in the ROM data file.\n(When it is canceled, both the SRL and a submission sheet are not made.)\n"
+ "\n ROM data file name is \"" + srlfile + "\".\n" + "\nPlease select a folder in which the ROM data is saved."
);
}

View File

@ -205,9 +205,16 @@ ECDeliverableResult RCDeliverable::writeSpreadsheet(
if( node->FirstChild->Value->Equals( "TagRomVersion" ) )
{
if( *(hSrl->hRomVersion) != 0xE0 )
{
node->FirstChild->Value = hSrl->hRomVersion->ToString();
}
else
node->FirstChild->Value = gcnew System::String( "E" );
{
if( english )
node->FirstChild->Value = gcnew System::String( "E (Preliminary ver.)" );
else
node->FirstChild->Value = gcnew System::String( "E (事前版)" );
}
}
if( node->FirstChild->Value->Equals( "TagSubmitVersion" ) )
{

View File

@ -1175,13 +1175,14 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
u32 romsize = 1 << (this->pRomHeader->s.rom_size); // ROM容量
if( *(this->hIsMediaNand) == false ) // カードアプリのときのみのチェック
{
if( (romsize*1024*1024/8) < filesize )
u32 filesizeMb = (filesize / (1024*1024)) * 8;
if( romsize < filesizeMb )
{
this->hErrorList->Add( gcnew RCMrcError(
"デバイス容量", 0x14, 0x14, "実ファイルサイズよりも小さい値が指定されています。",
"Device Capacity", "Setting data is less than the actual file size.", false, true ) );
}
else if( filesize < (romsize*1024*1024/8) )
else if( filesizeMb < romsize )
{
this->hWarnList->Add( gcnew RCMrcError( // 警告
"デバイス容量", 0x14, 0x14, "実ファイルサイズに比べて無駄のある値が設定されています。",
@ -1193,10 +1194,10 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
"デバイス容量", 0x14, 0x14, "指定可能な容量ではありません。",
"Device Capacity", "Invalid capacity.", false, true ) );
}
if( (filesize % 2) != 0 )
if( (filesizeMb < 1) || (MasterEditorTWL::countBits(filesizeMb) != 1) )
{
this->hErrorList->Add( gcnew RCMrcError(
"実ファイルサイズ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "中途半端な値です。通常では2のべき乗の値です。",
this->hWarnList->Add( gcnew RCMrcError(
"実ファイルサイズ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "中途半端な値です。通常では2のべき乗[Mbit]の値です。",
"Actual File Size", "Invalid size. This size is usually power of 2.", false, true ) );
}
// 1Gbit以上のときの最終領域が固定値かどうか
@ -1424,7 +1425,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
{
this->hErrorList->Add( gcnew RCMrcError(
"アクセスコントロール情報", 0x1b4, 0x1b7,
"ゲームカード用ソフトは、NANDフラッシュとSDカードへアクセスできません。アクセスが必要な場合は、弊社業務部にまでご連絡ください。",
"ゲームカード用ソフトは、NANDフラッシュとSDカードへアクセスできません。アクセスが必要な場合は、弊社窓口にご相談ください。",
"Access Control Info.",
"Game soft for Game Card does'nt access to NAND frash memory and SD Card. If the soft wish to access them, please contact us.",
false, true ) );
@ -1634,6 +1635,12 @@ void RCSrl::mrcBanner(FILE *fp)
return;
}
// バナーオフセットにエラーがあるときには調べない
if( this->pRomHeader->s.banner_offset == 0 )
{
return;
}
// 使用可能な文字のマップをつくる
// 文字コードをインデックスとして使用可能なら 1 が入る
// そうでないなら 0 が入る

View File

@ -362,3 +362,23 @@ void MasterEditorTWL::appendXmlTag( System::Xml::XmlDocument ^doc, System::Xml::
node->AppendChild( doc->CreateTextNode( text ) );
parent->AppendChild( node );
}
//
// ビット数をカウントする
//
// @arg [in] 値
//
// @ret ビット数
//
u32 MasterEditorTWL::countBits( const u32 val )
{
// 分割統治法:隣り合うかたまりごとにビット数をカウントしていく
u32 n = val;
n = ((n>>1) & 0x55555555) + (n & 0x55555555);
n = ((n>>2) & 0x33333333) + (n & 0x33333333);
n = ((n>>4) & 0x0f0f0f0f) + (n & 0x0f0f0f0f);
n = ((n>>8) & 0x00ff00ff) + (n & 0x00ff00ff);
n = (n>>16) + (n & 0x0000ffff);
return n;
}

View File

@ -124,4 +124,13 @@ namespace MasterEditorTWL
void appendXmlTag( System::Xml::XmlDocument ^doc, System::Xml::XmlElement ^parent,
System::String ^tag, System::String ^text );
//
// ビット数をカウントする
//
// @arg [in] 値
//
// @ret ビット数
//
u32 countBits( const u32 val );
} // end of namespace MasterEditorTWL