マスタエディタ:設定ファイルで追加チェック機能を切り替えできるようにした。SDKバージョン、EULA、Shared2Fileのサイズをチェックする。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2409 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
nishikawa_takeshi 2008-09-04 11:12:10 +00:00
parent f19a03851e
commit 5719496e13
12 changed files with 399 additions and 149 deletions

View File

@ -40,8 +40,8 @@ namespace MasterEditorTWL {
System::Boolean ^hIsSpreadSheet;
// 入力エラー情報
System::Collections::Generic::List<RCMRCError ^> ^hErrorList;
System::Collections::Generic::List<RCMRCError ^> ^hWarnList;
System::Collections::Generic::List<RCMrcError ^> ^hErrorList;
System::Collections::Generic::List<RCMrcError ^> ^hWarnList;
// VC自動追加フィールド
@ -611,9 +611,9 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
//
this->hSrl = gcnew (RCSrl);
this->hDeliv = gcnew (RCDeliverable);
this->hErrorList = gcnew System::Collections::Generic::List<RCMRCError^>();
this->hErrorList = gcnew System::Collections::Generic::List<RCMrcError^>();
this->hErrorList->Clear();
this->hWarnList = gcnew System::Collections::Generic::List<RCMRCError^>();
this->hWarnList = gcnew System::Collections::Generic::List<RCMrcError^>();
this->hWarnList->Clear();
// バージョン情報を表示
@ -3580,45 +3580,95 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
System::Xml::XmlElement ^root = doc->DocumentElement;
// <rw>タグ
System::Boolean bReadOnly = false;
System::Xml::XmlNodeList ^rwlist = root->GetElementsByTagName( "rw" );
if( rwlist != nullptr )
System::Boolean bReadOnly = MasterEditorTWL::isXmlEqual( root, "rw", "r" );
if( bReadOnly )
{
System::Xml::XmlNode ^rw = rwlist->Item(0);
if( rw->FirstChild->Value->Equals( "r" ) )
{
// リードオンリーモード
this->readOnly();
bReadOnly = true;
}
this->readOnly();
}
// <output>タグ
System::Boolean bXML = false;
System::Xml::XmlNodeList ^outlist = root->GetElementsByTagName( "output" );
if( outlist != nullptr )
{
System::Xml::XmlNode ^out = outlist->Item(0);
if( out->FirstChild->Value->Equals( "XML" ) )
{
// ーマルXML出力モード
bXML = true;
}
}
System::Boolean bXML = MasterEditorTWL::isXmlEqual( root, "output", "XML" );
if( bReadOnly || bXML )
// <spcheck>タグ
System::Boolean bCheck = MasterEditorTWL::isXmlEqual( root, "spcheck", "ON" );
if( bCheck ) // チェックするときのみ追加チェック項目を設定
{
// チェックするかどうか
this->hSrl->hMrcSpecialList->hIsCheck = gcnew System::Boolean( true );
// SDK
try
{
u32 major = System::UInt32::Parse( MasterEditorTWL::getXpathText( root, "/init/sdk/major" ) );
u32 minor = System::UInt32::Parse( MasterEditorTWL::getXpathText( root, "/init/sdk/minor" ) );
u32 relstep = System::UInt32::Parse( MasterEditorTWL::getXpathText( root, "/init/sdk/relstep" ) );
u32 sdkver = (major << 24) | (minor << 16) | (relstep & 0xFFFF);
this->hSrl->hMrcSpecialList->hSDKVer = gcnew System::UInt32( sdkver );
}
catch ( System::Exception ^ex )
{
(void)ex;
this->errMsg( "設定ファイル中のSDKバージョンが読み込めませんでした。バージョンは0とみなされます。",
"SDK ver. can't be read from setting file. Therefore it is set by 0." );
this->hSrl->hMrcSpecialList->hSDKVer = gcnew System::UInt32( 0 );
}
// EULA
try
{
u8 eula = System::Byte::Parse( MasterEditorTWL::getXpathText( root, "/init/eula" ) );
this->hSrl->hMrcSpecialList->hEULAVer = gcnew System::Byte( eula );
}
catch ( System::Exception ^ex )
{
(void)ex;
this->errMsg( "設定ファイル中のEULAバージョンが読み込めませんでした。バージョンは0とみなされます。",
"EULA ver. can't be read from setting file. Therefore it is set by 0." );
this->hSrl->hMrcSpecialList->hEULAVer = gcnew System::Byte( 0 );
}
// Shared2File
try
{
System::Int32 i;
for( i=0; i < METWL_NUMOF_SHARED2FILES; i++ )
{
u8 size = System::UInt32::Parse( MasterEditorTWL::getXpathText( root, "/init/shared2/size" + i.ToString() ) );
this->hSrl->hMrcSpecialList->hShared2SizeArray[i] = gcnew System::UInt32( size );
}
}
catch ( System::Exception ^ex )
{
(void)ex;
this->errMsg( "設定ファイル中のShared2ファイルサイズが読み込めませんでした。サイズはすべて0とみなされます。",
"One of shared2 file sizes can't be read from setting file. Therefore they are set by 0." );
System::Int32 i;
for( i=0; i < METWL_NUMOF_SHARED2FILES; i++ )
{
this->hSrl->hMrcSpecialList->hShared2SizeArray[i] = gcnew System::UInt32( 0 );
}
}
} //if( bCheck )
if( bReadOnly || bXML | bCheck )
{
System::String ^msgJ = gcnew System::String("動作モード:");
System::String ^msgE = gcnew System::String("Processing Mode:");
if( bReadOnly )
{
msgJ += "\n リードオンリーモード";
msgE += "\n Read Only Mode";
msgJ += "\nリードオンリーモード";
msgE += "\nRead Only Mode";
}
if( bXML )
{
msgJ += "\n XML出力モード";
msgE += "\n XML Output Mode";
msgJ += "\nXML出力モード";
msgE += "\nXML Output Mode";
}
if( bCheck )
{
msgJ += "\n追加チェックモード";
msgE += "\nExtra Check Mode";
}
this->sucMsg( msgJ, msgE );
}
@ -3828,12 +3878,12 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
this->tboxIsGameCardOn->Text = gcnew System::String( "OFF" );
}
this->cboxIsShared2->Checked = *(this->hSrl->hIsShared2);
this->tboxShared2Size0->Text = this->hSrl->hShared2Size0->ToString();
this->tboxShared2Size1->Text = this->hSrl->hShared2Size1->ToString();
this->tboxShared2Size2->Text = this->hSrl->hShared2Size2->ToString();
this->tboxShared2Size3->Text = this->hSrl->hShared2Size3->ToString();
this->tboxShared2Size4->Text = this->hSrl->hShared2Size4->ToString();
this->tboxShared2Size5->Text = this->hSrl->hShared2Size5->ToString();
this->tboxShared2Size0->Text = this->hSrl->hShared2SizeArray[0]->ToString();
this->tboxShared2Size1->Text = this->hSrl->hShared2SizeArray[1]->ToString();
this->tboxShared2Size2->Text = this->hSrl->hShared2SizeArray[2]->ToString();
this->tboxShared2Size3->Text = this->hSrl->hShared2SizeArray[3]->ToString();
this->tboxShared2Size4->Text = this->hSrl->hShared2SizeArray[4]->ToString();
this->tboxShared2Size5->Text = this->hSrl->hShared2SizeArray[5]->ToString();
// アプリ種別
System::String ^app = gcnew System::String("");
@ -4348,7 +4398,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
System::String ^tmp = formtext->Replace( " ", "" ); // スペースのみの文字列もエラー
if( (formtext == nullptr) || formtext->Equals("") || tmp->Equals("") )
{
this->hErrorList->Add( gcnew RCMRCError( labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
this->hErrorList->Add( gcnew RCMrcError( labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
return false;
}
return true;
@ -4362,7 +4412,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
if( (val < min) || (max < val) )
{
this->hErrorList->Add( gcnew RCMRCError( labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
this->hErrorList->Add( gcnew RCMrcError( labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
return false;
}
return true;
@ -4389,7 +4439,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
if( box->SelectedIndex < 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
}
return true;
@ -4467,14 +4517,14 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
// 何も設定されていない
if( !always->Checked && (comb->SelectedIndex == (comb->Items->Count - 1)) )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
msg + ": レーティング審査を必要としないソフトであるとみなしてデータを保存します。",
"Parental Control", msg + ": Save ROM data as Game soft which needs rating examinination.", true, true ) );
}
else
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
msg + ": 制限が無効であるにもかかわらずレーティング情報が設定されています。",
"Parental Control", msg + "Rating can be set only when control is enable.", true, true ) );
@ -4484,21 +4534,21 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
{
if( !always->Checked && (comb->SelectedIndex == (comb->Items->Count - 1)) )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
msg + ": 制限が有効であるにもかかわらずレーティング情報が設定されていません。",
"Parental Control", msg + ": Rating must be set when control is enable.", true, true ) );
}
else if( always->Checked )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
msg + ": Rating Pendingが指定されています。レーティング年齢が審査されしだい、再度、ROMを提出してください。",
"Parental Control", ": Rating Pending is setting. When rating age is examined, Please submit again.", true, true ) );
}
else if( comb->SelectedIndex == (comb->Items->Count - 1) )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
": Rating Pending指定とレーティング年齢を同時に指定することはできません。",
"Parental Control", ": Rating setting is either rating pending or rating age.", true, true ) );
@ -4745,7 +4795,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
// SRLクラスのエラーリストはすべてSRLに関係するのでチェックしない
// -> 入力エラーのみのチェックでよい
for each( RCMRCError ^err in this->hErrorList )
for each( RCMrcError ^err in this->hErrorList )
{
if( !err->AffectRom )
count++;
@ -4760,7 +4810,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
// SRLクラスの修正不可エラーをカウント
// (修正可エラーは入力によって修正されてるかもしれないのでチェックしない)
for each( RCMRCError ^err in this->hSrl->hErrorList )
for each( RCMrcError ^err in this->hSrl->hErrorList )
{
if( !err->EnableModify ) // すべてSRLバイナリに影響する
count++;
@ -4769,7 +4819,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
// SRLバイナリに影響するエラーの中で
// 修正可エラーがフォーム入力によって修正されているかカウント
// (エラーリストが更新されていることが前提)
for each( RCMRCError ^err in this->hErrorList )
for each( RCMrcError ^err in this->hErrorList )
{
if( err->AffectRom ) // 修正不可エラーは存在しない
count++;
@ -5223,7 +5273,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
this->gridError->Rows->Clear();
if( this->hSrl->hErrorList != nullptr )
{
for each( RCMRCError ^err in this->hSrl->hErrorList )
for each( RCMrcError ^err in this->hSrl->hErrorList )
{
this->gridError->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridError( err );
@ -5236,7 +5286,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
this->gridWarn->Rows->Clear();
if( this->hSrl->hWarnList != nullptr )
{
for each( RCMRCError ^err in this->hSrl->hWarnList )
for each( RCMrcError ^err in this->hSrl->hWarnList )
{
this->gridWarn->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridWarn( err );
@ -5251,7 +5301,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
this->gridError->Rows->Clear();
if( this->hSrl->hErrorList != nullptr )
{
for each( RCMRCError ^err in this->hSrl->hErrorList )
for each( RCMrcError ^err in this->hSrl->hErrorList )
{
if( !err->EnableModify ) // 修正可能な情報は表示しない
{
@ -5262,7 +5312,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
}
if( this->hErrorList != nullptr )
{
for each( RCMRCError ^err in this->hErrorList )
for each( RCMrcError ^err in this->hErrorList )
{
this->gridError->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridError( err );
@ -5274,7 +5324,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
this->gridWarn->Rows->Clear();
if( this->hSrl->hWarnList != nullptr )
{
for each( RCMRCError ^err in this->hSrl->hWarnList )
for each( RCMrcError ^err in this->hSrl->hWarnList )
{
if( !err->EnableModify )
{
@ -5285,7 +5335,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
}
if( this->hWarnList != nullptr )
{
for each( RCMRCError ^err in this->hWarnList )
for each( RCMrcError ^err in this->hWarnList )
{
this->gridWarn->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridWarn( err );
@ -5295,7 +5345,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
// セルの色を変える
public:
void colorGridError( RCMRCError ^err )
void colorGridError( RCMrcError ^err )
{
if( err->AffectRom && !err->EnableModify ) // SRLに関係ありで修正不可
{
@ -5308,7 +5358,7 @@ private: System::Windows::Forms::Label^ labAssemblyVersion;
this->gridError->Rows[ last ]->DefaultCellStyle->ForeColor = System::Drawing::Color::Blue;
}
}
void colorGridWarn( RCMRCError ^err )
void colorGridWarn( RCMrcError ^err )
{
if( err->AffectRom && !err->EnableModify )
{

View File

@ -255,24 +255,24 @@ namespace MasterEditorTWL {
// エラー情報の登録
// --------------------------------------------------------
public:
void setGridError( System::Collections::Generic::List<RCMRCError ^> ^list, System::Boolean isJapanese )
void setGridError( System::Collections::Generic::List<RCMrcError ^> ^list, System::Boolean isJapanese )
{
this->gridError->Rows->Clear();
if( list != nullptr )
{
for each( RCMRCError ^err in list )
for each( RCMrcError ^err in list )
{
this->gridError->Rows->Add( err->getAll( isJapanese ) );
}
}
}
void setGridWarn( System::Collections::Generic::List<RCMRCError ^> ^list, System::Boolean isJapanese )
void setGridWarn( System::Collections::Generic::List<RCMrcError ^> ^list, System::Boolean isJapanese )
{
this->gridWarn->Rows->Clear();
if( list != nullptr )
{
for each( RCMRCError ^err in list )
for each( RCMrcError ^err in list )
{
this->gridWarn->Rows->Add( err->getAll( isJapanese ) );
}
@ -284,14 +284,14 @@ namespace MasterEditorTWL {
// --------------------------------------------------------
public:
void overloadGridError(
System::Collections::Generic::List<RCMRCError ^> ^listLo,
System::Collections::Generic::List<RCMRCError ^> ^listHi, System::Boolean isJapanese )
System::Collections::Generic::List<RCMrcError ^> ^listLo,
System::Collections::Generic::List<RCMrcError ^> ^listHi, System::Boolean isJapanese )
{
// listLoの修正可能な情報をlistHiで上書きする(listHiは修正可能な情報のみであることが前提)
this->gridError->Rows->Clear();
if( listLo != nullptr )
{
for each( RCMRCError ^err in listLo )
for each( RCMrcError ^err in listLo )
{
if( !err->EnableModify ) // 修正可能な情報は表示しない
this->gridError->Rows->Add( err->getAll( isJapanese ) );
@ -299,21 +299,21 @@ namespace MasterEditorTWL {
}
if( listHi != nullptr )
{
for each( RCMRCError ^err in listHi )
for each( RCMrcError ^err in listHi )
{
this->gridError->Rows->Add( err->getAll( isJapanese ) );
}
}
}
void overloadGridWarn(
System::Collections::Generic::List<RCMRCError ^> ^listLo,
System::Collections::Generic::List<RCMRCError ^> ^listHi, System::Boolean isJapanese )
System::Collections::Generic::List<RCMrcError ^> ^listLo,
System::Collections::Generic::List<RCMrcError ^> ^listHi, System::Boolean isJapanese )
{
// listLoの修正可能な情報をlistHiで上書きする(listHiは修正可能な情報のみであることが前提)
this->gridWarn->Rows->Clear();
if( listLo != nullptr )
{
for each( RCMRCError ^err in listLo )
for each( RCMrcError ^err in listLo )
{
if( !err->EnableModify ) // 修正可能な情報は表示しない
this->gridWarn->Rows->Add( err->getAll( isJapanese ) );
@ -321,7 +321,7 @@ namespace MasterEditorTWL {
}
if( listHi != nullptr )
{
for each( RCMRCError ^err in listHi )
for each( RCMrcError ^err in listHi )
{
this->gridWarn->Rows->Add( err->getAll( isJapanese ) );
}

View File

@ -21,3 +21,4 @@
#define METWL_MASK_REGION_CHINA 0x00000010
#define METWL_MASK_REGION_KOREA 0x00000020
#define METWL_MASK_REGION_ALL 0xffffffff
#define METWL_NUMOF_SHARED2FILES 6

View File

@ -406,27 +406,27 @@ ECDeliverableResult RCDeliverable::writeSpreadsheet(
}
if( node->FirstChild->Value->Equals( "TagShared2Size0" ) )
{
node->FirstChild->Value = hSrl->hShared2Size0->ToString() + "KB";
node->FirstChild->Value = hSrl->hShared2SizeArray[0]->ToString() + "KB";
}
if( node->FirstChild->Value->Equals( "TagShared2Size1" ) )
{
node->FirstChild->Value = hSrl->hShared2Size1->ToString() + "KB";
node->FirstChild->Value = hSrl->hShared2SizeArray[1]->ToString() + "KB";
}
if( node->FirstChild->Value->Equals( "TagShared2Size2" ) )
{
node->FirstChild->Value = hSrl->hShared2Size2->ToString() + "KB";
node->FirstChild->Value = hSrl->hShared2SizeArray[2]->ToString() + "KB";
}
if( node->FirstChild->Value->Equals( "TagShared2Size3" ) )
{
node->FirstChild->Value = hSrl->hShared2Size3->ToString() + "KB";
node->FirstChild->Value = hSrl->hShared2SizeArray[3]->ToString() + "KB";
}
if( node->FirstChild->Value->Equals( "TagShared2Size4" ) )
{
node->FirstChild->Value = hSrl->hShared2Size4->ToString() + "KB";
node->FirstChild->Value = hSrl->hShared2SizeArray[4]->ToString() + "KB";
}
if( node->FirstChild->Value->Equals( "TagShared2Size5" ) )
{
node->FirstChild->Value = hSrl->hShared2Size5->ToString() + "KB";
node->FirstChild->Value = hSrl->hShared2SizeArray[5]->ToString() + "KB";
}
// ‰ïŽÐ<C5BD>î•ñ

View File

@ -21,6 +21,8 @@ RCSrl::RCSrl()
{
this->pRomHeader = new (ROM_Header);
std::memset( pRomHeader, 0, sizeof(ROM_Header) );
this->hMrcSpecialList = gcnew RCMrcSpecialList();
}
// destructor
@ -258,36 +260,35 @@ ECSrlResult RCSrl::setRomInfo(void)
= gcnew System::Boolean( (this->pRomHeader->s.access_control.common_client_key_for_debugger_sysmenu != 0)?true:false );
// Shared2ファイルサイズ
this->hShared2Size0 = gcnew System::UInt32( 0 );
this->hShared2Size1 = gcnew System::UInt32( 0 );
this->hShared2Size2 = gcnew System::UInt32( 0 );
this->hShared2Size3 = gcnew System::UInt32( 0 );
this->hShared2Size4 = gcnew System::UInt32( 0 );
this->hShared2Size5 = gcnew System::UInt32( 0 );
this->hShared2SizeArray = gcnew cli::array<System::UInt32^>(METWL_NUMOF_SHARED2FILES);
for( i=0; i < METWL_NUMOF_SHARED2FILES; i++ )
{
this->hShared2SizeArray[i] = gcnew System::UInt32( 0 );
}
u32 unit = 16 * 1024; // 16KBの乗数が格納されている
if( this->pRomHeader->s.shared2_file0_size != 0 )
{
*(this->hShared2Size0) = (this->pRomHeader->s.shared2_file0_size * unit) + unit;
*(this->hShared2SizeArray[0]) = (this->pRomHeader->s.shared2_file0_size * unit) + unit;
}
if( this->pRomHeader->s.shared2_file1_size != 0 )
{
*(this->hShared2Size1) = (this->pRomHeader->s.shared2_file1_size * unit) + unit;
*(this->hShared2SizeArray[1]) = (this->pRomHeader->s.shared2_file1_size * unit) + unit;
}
if( this->pRomHeader->s.shared2_file2_size != 0 )
{
*(this->hShared2Size2) = (this->pRomHeader->s.shared2_file2_size * unit) + unit;
*(this->hShared2SizeArray[2]) = (this->pRomHeader->s.shared2_file2_size * unit) + unit;
}
if( this->pRomHeader->s.shared2_file3_size != 0 )
{
*(this->hShared2Size3) = (this->pRomHeader->s.shared2_file3_size * unit) + unit;
*(this->hShared2SizeArray[3]) = (this->pRomHeader->s.shared2_file3_size * unit) + unit;
}
if( this->pRomHeader->s.shared2_file4_size != 0 )
{
*(this->hShared2Size4) = (this->pRomHeader->s.shared2_file4_size * unit) + unit;
*(this->hShared2SizeArray[4]) = (this->pRomHeader->s.shared2_file4_size * unit) + unit;
}
if( this->pRomHeader->s.shared2_file5_size != 0 )
{
*(this->hShared2Size5) = (this->pRomHeader->s.shared2_file5_size * unit) + unit;
*(this->hShared2SizeArray[5]) = (this->pRomHeader->s.shared2_file5_size * unit) + unit;
}
// カードリージョン
@ -531,22 +532,32 @@ ECSrlResult RCSrl::searchSDKVersion( FILE *fp )
// RC1=20100 RC2=20200 ...
// RELEASE=30000
System::UInt16 patch = relstep;
while( patch > 10000 )
while( patch >= 10000 )
{
patch -= 10000;
}
System::UInt16 rev = patch;
System::String ^revstr = gcnew System::String( "" );
while( rev >= 100 )
{
rev -= 100;
}
if( rev > 0 )
{
revstr = "-" + rev.ToString();
}
patch = patch / 100;
switch( relstep / 10000 )
{
case 1: str += ("PR " + patch.ToString()); break;
case 2: str += ("RC " + patch.ToString()); break;
case 3: str += ("RELEASE " + patch.ToString()); break;
case 1: str += ("PR " + patch.ToString() + revstr); break;
case 2: str += ("RC " + patch.ToString() + revstr); break;
case 3: str += ("RELEASE " + patch.ToString() + revstr); break;
default: break;
}
u32 statbegin = this->pRomHeader->s.main_rom_offset;
u32 statend = this->pRomHeader->s.main_rom_offset + this->pRomHeader->s.main_size - 1;
System::Boolean isstat = ((statbegin <= offset) && (offset <= statend))?true:false;
this->hSDKList->Add( gcnew RCSDKVersion(str, isstat) );
this->hSDKList->Add( gcnew RCSDKVersion(str, sdkcode, isstat) );
//System::Diagnostics::Debug::WriteLine( "SDK " + str );
}
}
@ -609,8 +620,8 @@ ECSrlResult RCSrl::searchLicenses(FILE *fp)
//
ECSrlResult RCSrl::mrc( FILE *fp )
{
this->hErrorList = gcnew System::Collections::Generic::List<RCMRCError^>;
this->hWarnList = gcnew System::Collections::Generic::List<RCMRCError^>;
this->hErrorList = gcnew System::Collections::Generic::List<RCMrcError^>;
this->hWarnList = gcnew System::Collections::Generic::List<RCMrcError^>;
this->hErrorList->Clear();
this->hWarnList->Clear();
@ -651,7 +662,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
}
if( !result )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ソフトタイトル", 0x0, 0xb, "使用不可のASCIIコードが使用されています。",
"Game Title", "Unusable ASCII code is used.", false, true ) );
}
@ -667,13 +678,13 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
}
if( !result )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"イニシャルコード", 0xc, 0xf, "使用不可のASCIIコードが使用されています。",
"Game Code", "Unusable ASCII code is used.", false, true ) );
}
if( memcmp( this->pRomHeader->s.game_code, "NTRJ", GAME_CODE_MAX ) == 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"イニシャルコード", 0xc, 0xf, "SDKデフォルトのコード(NTRJ)が使用されています。",
"Game Code", "SDK default code(NTRJ) is used.", false, true ) );
}
@ -689,7 +700,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
}
if( !result )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"メーカーコード", 0x10, 0x11, "使用不可のASCIIコードが使用されています。",
"Maker Code", "Unusable ASCII code is used.", false, true ) );
}
@ -697,7 +708,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
// 値チェック
if( this->pRomHeader->s.rom_type != 0x00 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"デバイスタイプ", 0x13, 0x13, "不正な値です。00hを設定してください。",
"Device Type", "Invalid data. Please set 00h.", false, true ) );
}
@ -706,38 +717,38 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
u32 romsize = 1 << (this->pRomHeader->s.rom_size); // ROM容量
if( (romsize*1024*1024/8) < filesize )
{
this->hErrorList->Add( gcnew RCMRCError(
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) )
{
this->hWarnList->Add( gcnew RCMRCError( // Œx<C592><78>
this->hWarnList->Add( gcnew RCMrcError( // 警告
"デバイス容量", 0x14, 0x14, "実ファイルサイズに比べて無駄のある値が設定されています。",
"Device Capacity", "Setting data is larger than the actual file size.", false, true ) );
}
if( (filesize % 2) != 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"実ファイルサイズ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "中途半端な値です。通常では2のべき乗の値です。",
"Actual File Size", "Invalid size. This size is usually power of 2.", false, true ) );
}
u8 romver = this->pRomHeader->s.rom_version;
if( ((romver < 0x00) || (0x09 < romver)) && (romver != 0xE0) )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"リマスターバージョン", 0x1e, 0x1e, "不正な値です。正式版では01h-09hのいずれかの値、事前版ではE0hです。",
"Release Ver.", "Invalid data. Please set either one of 01h-09h(Regular ver.), or E0h(Preliminary ver.)", false, true ) );
}
if( this->pRomHeader->s.banner_offset == 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"バナーオフセット", 0x68, 0x6b, "バナーデータが設定されていません。",
"Banner Offset.", "Banner data is not set.", false, true ) );
}
if( this->pRomHeader->s.rom_valid_size == 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ROM実効サイズ", 0x80, 0x83, "値が設定されていません。",
"ROM Valid Size.", "Data is not set.", false, true ) );
}
@ -755,7 +766,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
}
if (secure_size <= 0)
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"セキュア領域CRC", 0x15e, 0x15f, "セキュア領域のアドレス指定が不正です。",
"Secure Area CRC.", "Illegal address of secure area.", false, true ) );
}
@ -770,7 +781,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
delete []secures;
if( crc != this->pRomHeader->s.secure_area_crc16 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"セキュア領域CRC", 0x07c, 0x07d, "計算結果と一致しません。セキュア領域が改ざんされた可能性があります。",
"Secure Area CRC.", "Calclated CRC is different from Registered one.", false, true ) );
}
@ -780,7 +791,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
crc = 0xcf56;
if( crc != this->pRomHeader->s.nintendo_logo_crc16 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"キャラクターデータCRC", 0x15c, 0x15d, "計算結果と一致しません。キャラクターデータが改ざんされた可能性があります。",
"Charactor Data CRC.", "Calclated CRC is different from Registered one.", false, true ) );
}
@ -789,7 +800,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
crc = calcCRC( CRC16_INIT_VALUE, (u8*)this->pRomHeader, CALC_CRC16_SIZE );
if( crc != this->pRomHeader->s.header_crc16 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ROMヘッダCRC", 0x15e, 0x15f, "計算結果と一致しません。ROMヘッダが改ざんされた可能性があります。",
"ROM Header CRC.", "Calclated CRC is different from Registered one.", false, true ) );
}
@ -799,7 +810,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
{
if( this->pRomHeader->s.ctrl_reserved_B[i] != 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ROM情報予約領域", 0x078, 0x07f, "不正な値が含まれています。この領域をすべて0で埋めてください。",
"Reserved Area for ROM Info.", "Invalid data is included. Please set 0 into this area.", false, true ) );
}
@ -808,7 +819,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
{
if( this->pRomHeader->s.reserved_C[i] != 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"予約領域C", 0x078, 0x07f, "不正な値が含まれています。この領域をすべて0で埋めてください。",
"Reserved Area C", "Invalid data is included. Please set 0 into this area.", false, true ) );
}
@ -831,7 +842,7 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp )
}
if( i == 32 ) // 全部0
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"システムコールライブラリ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "SDKデフォルトです。",
"System-Call Library", "This Library is SDK default one.", false, true ) );
}
@ -858,19 +869,19 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
u32 romsize = 1 << (this->pRomHeader->s.rom_size); // ROM容量
if( (romsize < METWL_ROMSIZE_MIN) || (METWL_ROMSIZE_MAX < romsize) )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"デバイス容量", 0x14, 0x14, "指定可能な容量ではありません。",
"Device Capacity", "Invalid capacity.", false, true ) );
}
if( this->pRomHeader->s.warning_no_spec_rom_speed != 0 )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"諸フラグ", 0x1f, 0x1f, "rsfファイルでROMSpeedTypeが設定されていません。",
"Setting Flags", "In a RSF file, the item \"ROMSpeedType\" is not set.", false, true ) );
}
if( (this->pRomHeader->s.game_cmd_param & CARD_LATENCY_MASK) != CARD_1TROM_GAME_LATENCY )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"ROMコントロール情報", 0x60, 0x67, "TWLではマスクROMは用意されていません。ワンタイムPROM設定にしてください。",
"ROM Control Info.", "Mask ROM can be set. Please set One-time PROM.", false, true ) );
}
@ -880,7 +891,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
{
if( this->pRomHeader->s.reserved_A[i] != 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"予約領域A", 0x015, 0x01b, "不正な値が含まれています。この領域をすべて0で埋めてください。",
"Reserved Area A", "Invalid data is included. Please set 0 into this area.", false, true ) );
}
@ -889,7 +900,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
{
if( this->pRomHeader->s.reserved_B[i] != 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"予約領域B", 0x099, 0x0bf, "不正な値が含まれています。この領域をすべて0で埋めてください。",
"Reserved Area B", "Invalid data is included. Please set 0 into this area.", false, true ) );
}
@ -933,14 +944,14 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
if( apptype < 0 )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"アプリ種別", 0x230, 0x237, "不正な値です。",
"Application Type", "Illigal type.", false, true ) );
}
#ifdef METWL_VER_APPTYPE_USER
if( apptype != appUser )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"アプリ種別", 0x230, 0x237, "ユーザアプリではありません。",
"Application Type", "Not USER application.", false, true ) );
}
@ -948,7 +959,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
#ifdef METWL_VER_APPTYPE_SYSTEM
if( apptype != appSystem )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"アプリ種別", 0x230, 0x237, "システムアプリではありません。",
"Application Type", "Not SYSTEM application.", false, true ) );
}
@ -956,7 +967,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
#ifdef METWL_VER_APPTYPE_SECURE
if( apptype != appSecure )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"アプリ種別", 0x230, 0x237, "セキュアアプリではありません。",
"Application Type", "Not SECURE application.", false, true ) );
}
@ -964,7 +975,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
#ifdef METWL_VER_APPTYPE_LAUNCHER
if( apptype != appLauncher )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"アプリ種別", 0x230, 0x237, "ランチャーアプリではありません。",
"Application Type", "Not LAUNCHER application.", false, true ) );
}
@ -974,14 +985,14 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
if( (this->pRomHeader->s.access_control.game_card_on != 0) &&
(this->pRomHeader->s.access_control.game_card_nitro_mode != 0) )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"アクセスコントロール情報", 0x1b4, 0x1b7, "ゲームカード電源設定にーマルモードとNTRモードの両方を設定することはできません。",
"Access Control Info.", "Game card power setting is either normal mode or NTR mode.", false, true ) );
}
if( ((this->pRomHeader->s.titleID_Hi & TITLE_ID_HI_MEDIA_MASK) == 0) && // カードアプリ
((this->pRomHeader->s.access_control.game_card_on != 0) || (this->pRomHeader->s.access_control.game_card_nitro_mode != 0)) )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"アクセスコントロール情報", 0x1b4, 0x1b7, "ゲームカード用ソフトに対してゲームカード電源設定をすることはできません。",
"Access Control Info.", "Game card power setting is not for Game Card Soft.", false, true ) );
}
@ -991,7 +1002,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
(this->pRomHeader->s.shared2_file2_size != 0) || (this->pRomHeader->s.shared2_file3_size != 0) ||
(this->pRomHeader->s.shared2_file4_size != 0) || (this->pRomHeader->s.shared2_file5_size != 0) )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"アクセスコントロール情報", 0x1b4, 0x1b7, "Shared2ファイルのサイズが設定されているにもかかわらず不使用設定になっています。",
"Access Control Info.", "Sizes of shared2 files is setting, but using them is not enabled.", false, true ) );
}
@ -999,7 +1010,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
if( (this->pRomHeader->s.arm7_scfg_ext >> 31) != 0 )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"SCFG設定", 0x1b8, 0x1bb, "SCFGレジスタへアクセス可能になっています。",
"SCFG Setting", "In this setting, SCFG register is accessible.", false, true ) );
}
@ -1009,7 +1020,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
(this->pRomHeader->s.titleID_Lo[2] != this->pRomHeader->s.game_code[1]) ||
(this->pRomHeader->s.titleID_Lo[3] != this->pRomHeader->s.game_code[0]) )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"タイトルID", 0x230, 0x233, "下位4バイトがイニシャルコードと一致しません。",
"Title ID", "Lower 4 bytes don't match ones of Game Code.", false, true ) );
}
@ -1018,7 +1029,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
{
if( this->pRomHeader->s.reserved_ltd_F[i] != 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"予約領域F", 0x240, 0x2ef, "不正な値が含まれています。この領域をすべて0で埋めてください。",
"Reserved Area F", "Invalid data is included. Please set 0 into this area.", false, true ) );
}
@ -1029,7 +1040,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
u8 *p = (u8*)this->pRomHeader;
if( p[ 0x378 + i ] != 0 )
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"予約領域D", 0x378, 0xf7f, "不正な値が含まれています。この領域をすべて0で埋めてください。",
"Reserved Area D", "Invalid data is included. Please set 0 into this area.", false, true ) );
}
@ -1043,6 +1054,50 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
return pctl;
}
// 追加チェック
if( *(this->hMrcSpecialList->hIsCheck) == true )
{
// SDKバージョン
System::Boolean match = true;
for each( RCSDKVersion ^sdk in this->hSDKList )
{
if( sdk->IsStatic && (sdk->Code != *(this->hMrcSpecialList->hSDKVer) ) )
{
match = false;
}
}
if( !match )
{
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 ) );
}
// EULAバージョン
if( *(this->hEULAVersion) != *(this->hMrcSpecialList->hEULAVer) )
{
this->hWarnList->Add( gcnew RCMrcError(
"EULA バージョン", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, "本プログラムに登録されているバージョン情報と一致しません。",
"EULA Version", "The data doesn't match one registered in this program.", false, true ) );
}
// Shared2ファイルサイズ
for( i=0; i < METWL_NUMOF_SHARED2FILES; i++ )
{
if( *(this->hShared2SizeArray[i]) > 0 ) // 0は未使用を表すのでチェックしない
{
if( *(this->hShared2SizeArray[i]) != *(this->hMrcSpecialList->hShared2SizeArray[i]) )
{
this->hWarnList->Add( gcnew RCMrcError(
"Shared2ファイル" + i.ToString(), METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
"本プログラムに登録されているファイルサイズ情報と一致しません。",
"Shared2 file" + i.ToString(), "The size doesn't match one registered in this program.", false, true ) );
}
}
}
} //if( *(this->hMrcSpecialList->hIsCheck) )
return ECSrlResult::NOERROR;
} // mrcTWL()
@ -1114,14 +1169,14 @@ System::Boolean RCSrl::mrcRegion( System::UInt32 region )
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
if( region != METWL_MASK_REGION_ALL ) // オールリージョンを許す
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"カードリージョン", 0x1b0, 0x1b3, "仕向地の組み合わせが不正です。本ツールを用いて修正できます。",
"Card Region", "Illigal Region. This tool can modify this information.", true, true ) );
bRegionResult = false;
}
#else
{
this->hErrorList->Add( gcnew RCMRCError(
this->hErrorList->Add( gcnew RCMrcError(
"カードリージョン", 0x1b0, 0x1b3, "仕向地の組み合わせが不正です。本ツールを用いて修正してください。",
"Card Region", "Illigal Region. Please modify this information using this tool.", true, true ) );
bRegionResult = false;
@ -1136,7 +1191,7 @@ System::Boolean RCSrl::mrcRegion( System::UInt32 region )
{
this->clearParentalControl( i );
}
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff,
"仕向地の設定が不正のため、ROMデータ内のすべてのレーティング団体の情報を無視して読み込みました。本ツールを用いて修正してください。",
"Parental Control",
@ -1260,7 +1315,7 @@ void RCSrl::mrcRegionOrganization( System::UInt32 region )
{
if( this->pRomHeader->s.parental_control_rating_info[ ogn ] == 0 )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ogn] + warnEmptyJ,
"Parental Control", ognArray[ogn] + warnEmptyE, true, true ) );
this->clearParentalControl( ogn );
@ -1278,7 +1333,7 @@ void RCSrl::mrcRegionOrganization( System::UInt32 region )
}
if( bSet )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, warnFillJ,
"Parental Control", warnFillE, true, true ) );
}
@ -1326,7 +1381,7 @@ void RCSrl::mrcRating( System::Byte ogn )
if( *(this->hArrayParentalEffect[ ogn ]) == false )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ ogn ] + warnDisableJ,
"Parental Control", ognArray[ ogn ] + warnDisableE, true, true ) );
this->clearParentalControl( ogn );
@ -1342,7 +1397,7 @@ void RCSrl::mrcRating( System::Byte ogn )
// RPが立っていないときレーティング値が設定されていなかったらダメ
if( (str != nullptr) && str->Equals( L"未審査" ) )
{
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ ogn ] + warnIllegalJ,
"Parental Control", ognArray[ ogn ] + warnIllegalE, true, true ) );
this->clearParentalControl( ogn );
@ -1351,7 +1406,7 @@ void RCSrl::mrcRating( System::Byte ogn )
else
{
// RPが立っていたら問答無用に警告
this->hWarnList->Add( gcnew RCMRCError(
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ ogn ] + warnPendingJ,
"Parental Control", ognArray[ ogn ] + warnPendingE, true, true ) );
this->clearParentalControl( ogn );

View File

@ -48,16 +48,18 @@ namespace MasterEditorTWL
{
private:
System::String ^hVersion;
System::UInt32 ^hCode;
System::Boolean ^hIsStatic;
private:
RCSDKVersion(){} // 封じる
public:
RCSDKVersion( System::String ^ver, System::Boolean isStatic ) // 生成時にのみフィールドを設定可能
RCSDKVersion( System::String ^ver, System::UInt32 code, System::Boolean isStatic ) // 生成時にのみフィールドを設定可能
{
if( ver == nullptr )
this->hVersion = gcnew System::String(""); // NULL参照バグを避ける
else
this->hVersion = ver;
this->hCode = gcnew System::UInt32( code );
this->hIsStatic = gcnew System::Boolean( isStatic );
}
public:
@ -70,6 +72,11 @@ namespace MasterEditorTWL
{
System::Boolean get(){ return *(this->hIsStatic); }
}
public:
property System::UInt32 Code
{
System::UInt32 get(){ return *(this->hCode); }
}
};
// -------------------------------------------------------------------
@ -114,13 +121,13 @@ namespace MasterEditorTWL
// -------------------------------------------------------------------
// Type : ref class
// Name : RCMRCError
// Name : RCMrcError
//
// Description : RCSrlクラスに持たせるMRCエラー情報クラス
//
// Role : 構造体としてデータをまとめておく
// -------------------------------------------------------------------
public ref class RCMRCError
public ref class RCMrcError
{
private:
System::String ^hName; // 項目名
@ -132,9 +139,9 @@ namespace MasterEditorTWL
System::Boolean ^hEnableModify; // マスタエディタで修正可能かどうか
System::Boolean ^hAffectRom; // 変更するとSRL(ROMバイナリ)が変更されるか
private:
RCMRCError(){} // 封じる
RCMrcError(){} // 封じる
public:
RCMRCError(
RCMrcError(
System::String ^name, System::UInt32 beg, System::UInt32 end, System::String ^msg,
System::String ^nameE, System::String ^msgE, System::Boolean enableModify, System::Boolean affectRom )
{
@ -192,6 +199,36 @@ namespace MasterEditorTWL
}
};
// -------------------------------------------------------------------
// Type : ref class
// Name : RCMrcSpecialList
//
// Description : MRCの追加エラー項目クラス
//
// Role : 構造体としてデータをまとめておく
// -------------------------------------------------------------------
ref class RCMrcSpecialList
{
public:
property System::Boolean ^hIsCheck;
property System::UInt32 ^hSDKVer;
property System::Byte ^hEULAVer;
property cli::array<System::UInt32^> ^hShared2SizeArray;
public:
RCMrcSpecialList()
{
this->hIsCheck = gcnew System::Boolean( false );
this->hSDKVer = gcnew System::UInt32( 0 );
this->hEULAVer = gcnew System::Byte( 0 );
this->hShared2SizeArray = gcnew cli::array<System::UInt32^>(METWL_NUMOF_SHARED2FILES); // ファイルサイズの数に合わせる
System::Int32 i;
for( i=0; i < METWL_NUMOF_SHARED2FILES; i++ )
{
this->hShared2SizeArray[i] = gcnew System::UInt32( 0 );
}
}
};
// -------------------------------------------------------------------
// Type : ref class
// Name : RCSrl
@ -269,12 +306,13 @@ namespace MasterEditorTWL
property System::Boolean ^hIsCommonClientKeyForDebugger;
// Shared2ファイルサイズ Read Only
property System::UInt32 ^hShared2Size0;
property System::UInt32 ^hShared2Size1;
property System::UInt32 ^hShared2Size2;
property System::UInt32 ^hShared2Size3;
property System::UInt32 ^hShared2Size4;
property System::UInt32 ^hShared2Size5;
//property System::UInt32 ^hShared2Size0;
//property System::UInt32 ^hShared2Size1;
//property System::UInt32 ^hShared2Size2;
//property System::UInt32 ^hShared2Size3;
//property System::UInt32 ^hShared2Size4;
//property System::UInt32 ^hShared2Size5;
property cli::array<System::UInt32^> ^hShared2SizeArray;
// カードリージョン Read Only
property System::Boolean ^hIsRegionJapan;
@ -287,8 +325,11 @@ namespace MasterEditorTWL
property System::Collections::Generic::List<RCLicense^> ^hLicenseList;
// MRC機能でチェックされたエラー情報のリスト
property System::Collections::Generic::List<RCMRCError^> ^hErrorList;
property System::Collections::Generic::List<RCMRCError^> ^hWarnList;
property System::Collections::Generic::List<RCMrcError^> ^hErrorList;
property System::Collections::Generic::List<RCMrcError^> ^hWarnList;
// MRC追加項目
property RCMrcSpecialList ^hMrcSpecialList;
// constructor and destructor
public:

View File

@ -379,3 +379,60 @@ System::Collections::Generic::List<u32>^ MasterEditorTWL::patternMatch( FILE *fp
}
return list;
}
//
// XMLのルートードから指定した名前のタグを検索して返す
//
// @arg [in] XMLのルートード
// @arg [in] タグ名
//
// @ret 検索でマッチしたときノードを返す。ないときは nullptr。
// ただし、最初にマッチしたもののみ返す
//
System::Xml::XmlNode^ MasterEditorTWL::searchXmlNode( System::Xml::XmlElement ^root, System::String ^tag )
{
System::Xml::XmlNodeList ^list = root->GetElementsByTagName( tag );
System::Xml::XmlNode ^item = nullptr;
if( list != nullptr )
{
item = list->Item(0);
}
return item;
}
//
// タグを検索してそのテキストが指定したテキストと一致するか調べる
//
// @arg [in] XMLのルートード
// @arg [in] タグ名
// @arg [in] 値
//
// @ret 一致するときtrue。一致しないとき、タグが存在しないときはfalse。
//
System::Boolean MasterEditorTWL::isXmlEqual( System::Xml::XmlElement ^root, System::String ^tag, System::String ^val )
{
System::Xml::XmlNode ^item = MasterEditorTWL::searchXmlNode( root, tag );
if( (item != nullptr) && (item->FirstChild != nullptr) && (item->FirstChild->Value->Equals( val )) )
{
return true;
}
return false;
}
//
// タグを検索してそのテキストを返す
//
// @arg [in] XMLのルートード
// @arg [in] タグのXPath
//
// @ret テキストが存在するときそのテキストを返す。存在しないときnullptr。
//
System::String^ MasterEditorTWL::getXpathText( System::Xml::XmlElement ^root, System::String ^xpath )
{
System::Xml::XmlNode ^tmp = root->SelectSingleNode( xpath );
if( tmp && tmp->FirstChild && tmp->FirstChild->Value )
{
return tmp->FirstChild->Value;
}
return nullptr;
}

View File

@ -70,4 +70,36 @@ namespace MasterEditorTWL
//
System::Collections::Generic::List<u32>^ patternMatch( FILE *fp, const u8 *pattern, const u32 patternLen );
//
// XMLのルートードから指定した名前のタグを検索して返す
//
// @arg [in] XMLのルートード
// @arg [in] タグ名
//
// @ret 検索でマッチしたときノードを返す。ないときは nullptr。
// ただし、最初にマッチしたもののみ返す
//
System::Xml::XmlNode^ searchXmlNode( System::Xml::XmlElement ^root, System::String ^tag );
//
// タグを検索してそのテキストが指定したテキストと一致するか調べる
//
// @arg [in] XMLのルートード
// @arg [in] タグ名
// @arg [in] 値
//
// @ret 一致するときtrue。一致しないとき、タグが存在しないときはfalse。
//
System::Boolean isXmlEqual( System::Xml::XmlElement ^root, System::String ^tag, System::String ^val );
//
// タグを検索してそのテキストを返す
//
// @arg [in] XMLのルートード
// @arg [in] タグのXPath
//
// @ret テキストが存在するときそのテキストを返す。存在しないときnullptr。
//
System::String^ getXpathText( System::Xml::XmlElement ^root, System::String ^xpath );
} // end of namespace MasterEditorTWL

View File

@ -2,5 +2,19 @@
<init>
<rw>w</rw>
<output>Sheet</output>
<sdk>RC</sdk>
<spcheck>OFF</spcheck>
<sdk>
<major>5</major>
<minor>0</minor>
<relstep>20200</relstep>
</sdk>
<eula>0</eula>
<shared2>
<size0>0</size0>
<size1>0</size1>
<size2>0</size2>
<size3>0</size3>
<size4>0</size4>
<size5>0</size5>
</shared2>
</init>