diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL.ncb b/build/tools/MasterEditorTWL/MasterEditorTWL.ncb index 93a8e73f..9b1197a9 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL.ncb and b/build/tools/MasterEditorTWL/MasterEditorTWL.ncb differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL.suo b/build/tools/MasterEditorTWL/MasterEditorTWL.suo index 766e22d5..b140565b 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL.suo and b/build/tools/MasterEditorTWL/MasterEditorTWL.suo differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm b/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm index 0c0abc8e..3db3414c 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm and b/build/tools/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h b/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h index 956bf637..ff01b7d2 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h @@ -661,7 +661,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; #endif if( appstr != nullptr) { - this->Text += " [Supported App: " + appstr + "User ]"; + this->Text += " [ Supported App: " + appstr + "User ]"; } // 複数行表示したいが初期値で設定できないのでここで設定 @@ -709,7 +709,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; /// void InitializeComponent(void) { - System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle2 = (gcnew System::Windows::Forms::DataGridViewCellStyle()); + System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle1 = (gcnew System::Windows::Forms::DataGridViewCellStyle()); this->tboxFile = (gcnew System::Windows::Forms::TextBox()); this->gboxSrl = (gcnew System::Windows::Forms::GroupBox()); this->tboxRemasterVer = (gcnew System::Windows::Forms::TextBox()); @@ -1271,7 +1271,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // labOFLC // this->labOFLC->AutoSize = true; - this->labOFLC->Location = System::Drawing::Point(48, 234); + this->labOFLC->Location = System::Drawing::Point(48, 236); this->labOFLC->Name = L"labOFLC"; this->labOFLC->Size = System::Drawing::Size(34, 12); this->labOFLC->TabIndex = 33; @@ -1325,7 +1325,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // labCERO // this->labCERO->AutoSize = true; - this->labCERO->Location = System::Drawing::Point(48, 78); + this->labCERO->Location = System::Drawing::Point(47, 78); this->labCERO->Name = L"labCERO"; this->labCERO->Size = System::Drawing::Size(36, 12); this->labCERO->TabIndex = 27; @@ -2506,7 +2506,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; this->tboxSDK->Name = L"tboxSDK"; this->tboxSDK->ReadOnly = true; this->tboxSDK->ScrollBars = System::Windows::Forms::ScrollBars::Both; - this->tboxSDK->Size = System::Drawing::Size(175, 88); + this->tboxSDK->Size = System::Drawing::Size(186, 88); this->tboxSDK->TabIndex = 10; // // labSDK @@ -2896,7 +2896,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // labCaptionEx // this->labCaptionEx->AutoSize = true; - this->labCaptionEx->Location = System::Drawing::Point(528, 52); + this->labCaptionEx->Location = System::Drawing::Point(538, 52); this->labCaptionEx->Name = L"labCaptionEx"; this->labCaptionEx->Size = System::Drawing::Size(53, 12); this->labCaptionEx->TabIndex = 11; @@ -2904,12 +2904,12 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // // tboxCaptionEx // - this->tboxCaptionEx->Location = System::Drawing::Point(530, 67); + this->tboxCaptionEx->Location = System::Drawing::Point(540, 67); this->tboxCaptionEx->Multiline = true; this->tboxCaptionEx->Name = L"tboxCaptionEx"; this->tboxCaptionEx->ReadOnly = true; - this->tboxCaptionEx->ScrollBars = System::Windows::Forms::ScrollBars::Vertical; - this->tboxCaptionEx->Size = System::Drawing::Size(181, 88); + this->tboxCaptionEx->ScrollBars = System::Windows::Forms::ScrollBars::Both; + this->tboxCaptionEx->Size = System::Drawing::Size(171, 88); this->tboxCaptionEx->TabIndex = 10; // // gboxProd @@ -2996,7 +2996,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // stripItemEnglish // this->stripItemEnglish->Name = L"stripItemEnglish"; - this->stripItemEnglish->Size = System::Drawing::Size(152, 22); + this->stripItemEnglish->Size = System::Drawing::Size(119, 22); this->stripItemEnglish->Text = L"English"; this->stripItemEnglish->Click += gcnew System::EventHandler(this, &Form1::stripItemEnglish_Click); // @@ -3005,7 +3005,7 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; this->stripItemJapanese->Checked = true; this->stripItemJapanese->CheckState = System::Windows::Forms::CheckState::Checked; this->stripItemJapanese->Name = L"stripItemJapanese"; - this->stripItemJapanese->Size = System::Drawing::Size(152, 22); + this->stripItemJapanese->Size = System::Drawing::Size(119, 22); this->stripItemJapanese->Text = L"Japanese"; this->stripItemJapanese->Click += gcnew System::EventHandler(this, &Form1::stripItemJapanese_Click); // @@ -3456,8 +3456,8 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // // gridError // - dataGridViewCellStyle2->BackColor = System::Drawing::Color::White; - this->gridError->AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle1->BackColor = System::Drawing::Color::White; + this->gridError->AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this->gridError->BackgroundColor = System::Drawing::SystemColors::Control; this->gridError->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize; this->gridError->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(4) {this->colErrorName, @@ -3730,8 +3730,9 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; case ECSrlResult::ERROR_SIGN_DECRYPT: case ECSrlResult::ERROR_SIGN_VERIFY: - this->errMsg( "本ツールはTWL対応ROM専用です。不正なデータを読み込むことはできません。", - "This tool can only read TWL ROM. This can't read an illegal data." ); + this->errMsg( "不正なROMデータです。TWL対応ROMでないかROMデータが改ざんされている可能性があります。", + "Illegal ROM data. It is not for TWL ROM, or is altered illegally." ); + break; default: this->errMsg( "ROMデータファイルの読み込みに失敗しました。\n再度「ROMデータを開く」を選択してROMデータを読み出してください。", @@ -4711,69 +4712,69 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // リージョン情報からペアレンタルコントロールの編集可能団体をマスクする void maskParentalForms(void) { - this->enableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO ); - this->enableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB ); - this->enableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK ); - this->enableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI ); - this->enableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT ); - this->enableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC ); - this->enableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC ); + this->enableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO, this->labCERO, nullptr ); + this->enableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB, this->labESRB, nullptr ); + this->enableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK, this->labUSK, nullptr ); + this->enableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI, this->labPEGI, nullptr ); + this->enableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT, this->labPEGIPRT, nullptr ); + this->enableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC, this->labPEGIBBFC, this->labPEGIBBFC2 ); + this->enableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC, this->labOFLC, nullptr ); switch( this->combRegion->SelectedIndex ) { case 0: // 日本 - this->enableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO ); + this->enableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO, this->labCERO, nullptr ); - this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB ); - this->disableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK ); - this->disableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI ); - this->disableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT ); - this->disableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC ); - this->disableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC ); + this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB, this->labESRB, nullptr ); + this->disableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK, this->labUSK, nullptr ); + this->disableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI, this->labPEGI, nullptr ); + this->disableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT, this->labPEGIPRT, nullptr ); + this->disableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC, this->labPEGIBBFC, this->labPEGIBBFC2 ); + this->disableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC, this->labOFLC, nullptr ); break; case 1: // 米国 - this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO ); - this->enableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB ); - this->disableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK ); - this->disableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI ); - this->disableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT ); - this->disableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC ); - this->disableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC ); + this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO, this->labCERO, nullptr ); + this->enableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB, this->labESRB, nullptr ); + this->disableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK, this->labUSK, nullptr ); + this->disableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI, this->labPEGI, nullptr ); + this->disableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT, this->labPEGIPRT, nullptr ); + this->disableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC, this->labPEGIBBFC, this->labPEGIBBFC2 ); + this->disableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC, this->labOFLC, nullptr ); break; case 2: // 欧州 - this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO ); - this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB ); - this->enableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK ); - this->enableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI ); - this->enableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT ); - this->enableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC ); - this->disableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC ); + this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO, this->labCERO, nullptr ); + this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB, this->labESRB, nullptr ); + this->enableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK, this->labUSK, nullptr ); + this->enableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI, this->labPEGI, nullptr ); + this->enableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT, this->labPEGIPRT, nullptr ); + this->enableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC, this->labPEGIBBFC, this->labPEGIBBFC2 ); + this->disableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC, this->labOFLC, nullptr ); break; case 3: // 豪州 - this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO ); - this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB ); - this->disableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK ); - this->disableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI ); - this->disableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT ); - this->disableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC ); - this->enableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC ); + this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO, this->labCERO, nullptr ); + this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB, this->labESRB, nullptr ); + this->disableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK, this->labUSK, nullptr ); + this->disableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI, this->labPEGI, nullptr ); + this->disableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT, this->labPEGIPRT, nullptr ); + this->disableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC, this->labPEGIBBFC, this->labPEGIBBFC2 ); + this->enableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC, this->labOFLC, nullptr ); break; case 4: // 欧州と豪州 - this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO ); - this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB ); - this->enableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK ); - this->enableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI ); - this->enableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT ); - this->enableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC ); - this->enableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC ); + this->disableParental( this->combCERO, this->cboxCERO, this->cboxAlwaysCERO, this->labCERO, nullptr ); + this->disableParental( this->combESRB, this->cboxESRB, this->cboxAlwaysESRB, this->labESRB, nullptr ); + this->enableParental( this->combUSK, this->cboxUSK, this->cboxAlwaysUSK, this->labUSK, nullptr ); + this->enableParental( this->combPEGI, this->cboxPEGI, this->cboxAlwaysPEGI, this->labPEGI, nullptr ); + this->enableParental( this->combPEGIPRT, this->cboxPEGIPRT, this->cboxAlwaysPEGIPRT, this->labPEGIPRT, nullptr ); + this->enableParental( this->combPEGIBBFC, this->cboxPEGIBBFC, this->cboxAlwaysPEGIBBFC, this->labPEGIBBFC, this->labPEGIBBFC2 ); + this->enableParental( this->combOFLC, this->cboxOFLC, this->cboxAlwaysOFLC, this->labOFLC, nullptr ); break; default: @@ -4936,19 +4937,19 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; msg + ": 制限が有効であるにもかかわらずレーティング情報が設定されていません。", "Parental Control", msg + ": Rating must be set when control is enable.", true, true ) ); } - else if( always->Checked ) + else if( always->Checked && (comb->SelectedIndex == (comb->Items->Count - 1)) ) { 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) ) + else if( always->Checked && (comb->SelectedIndex != (comb->Items->Count - 1)) ) { 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 ) ); + msg + ": Rating Pending指定とレーティング年齢を同時に指定することはできません。", + "Parental Control", msg + ": Rating setting is either rating pending or rating age.", true, true ) ); } } } //checkParentalForms() @@ -5961,21 +5962,41 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; // ペアレンタルコントロール情報を編集できるようにする void enableParental( System::Windows::Forms::ComboBox ^comb, System::Windows::Forms::CheckBox ^enable, - System::Windows::Forms::CheckBox ^rp ) + System::Windows::Forms::CheckBox ^rp, + System::Windows::Forms::Label ^lab1, + System::Windows::Forms::Label ^lab2 ) { - comb->Enabled = true; + comb->Enabled = true; enable->Enabled = true; - rp->Enabled = true; + rp->Enabled = true; + comb->Visible = true; + enable->Visible = true; + rp->Visible = true; + lab1->Visible = true; + if( lab2 != nullptr ) + { + lab2->Visible = true; + } } // ペアレンタルコントロール情報を編集できなくする void disableParental( System::Windows::Forms::ComboBox ^comb, System::Windows::Forms::CheckBox ^enable, - System::Windows::Forms::CheckBox ^rp ) + System::Windows::Forms::CheckBox ^rp, + System::Windows::Forms::Label ^lab1, + System::Windows::Forms::Label ^lab2 ) { this->clearParental( comb, enable, rp ); - comb->Enabled = false; + comb->Enabled = false; enable->Enabled = false; - rp->Enabled = false; + rp->Enabled = false; + comb->Visible = false; + enable->Visible = false; + rp->Visible = false; + lab1->Visible = false; + if( lab2 != nullptr ) + { + lab2->Visible = false; + } } private: System::Void combRegion_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) @@ -6325,11 +6346,6 @@ private: System::Windows::Forms::Label^ labProductNameLimitForeign; this->setParentalForms(); // ペアレンタルコントロール関連 } - - - - - }; // enf of ref class Form1 } // end of namespace MasterEditorTWL diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.resX b/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.resX index 302e29f7..1f0e93fa 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.resX +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.resX @@ -126,24 +126,6 @@ True - - True - - - True - - - True - - - True - - - True - - - True - True diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm b/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm index 735e9132..40b6cf06 100644 Binary files a/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm and b/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm differ diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/common.h b/build/tools/MasterEditorTWL/MasterEditorTWL/common.h index 1b610e56..434f02c9 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/common.h +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/common.h @@ -19,3 +19,4 @@ #define METWL_MASK_REGION_KOREA 0x00000020 #define METWL_MASK_REGION_ALL 0xffffffff #define METWL_NUMOF_SHARED2FILES 6 +#define METWL_SEG3_CRC 0x0254 diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.cpp b/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.cpp index 986b7670..a984cf5d 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.cpp +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.cpp @@ -74,6 +74,40 @@ namespace MasterEditorTWL return crc; } + /*---------------------------------------------------------------------------* + + Name: getSeg3CRCInFp + + Description: Segment3(0x3000-0x3fff)のCRCを算出 + + Arguments: [in] srlファイルのファイルポインタ + [out] CRC格納先 + + Return: 成功ならTRUE. + + *---------------------------------------------------------------------------*/ + BOOL getSeg3CRCInFp( FILE *fp, u16 *pCRC ) + { + u16 crc; + u16 data[ 0x1000 / 2 ]; // 64Kバイト(512Kビット) + + if( !fp ) + { + return FALSE; + } + + // CRCテーブル初期化(製品技術部のコード) + inittable(crc_table); + + // 0x3000 から 0x3fff までの CRC をとる + fseek( fp, 0x3000, SEEK_SET ); + fread( (void*)data, sizeof(data), 1, fp ); + crc = newGetCRC( 0, data, sizeof(data) ); + *pCRC = crc; + + return TRUE; + } + /*---------------------------------------------------------------------------* Name: getWholeCRCInFp diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.h b/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.h index 4c38bb02..d8c9c3dc 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.h +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/crc_whole.h @@ -7,6 +7,20 @@ namespace MasterEditorTWL { + /*---------------------------------------------------------------------------* + + Name: getSeg3CRCInFp + + Description: Segment3(0x3000-0x3fff)のCRCを算出 + + Arguments: [in] srlファイルのファイルポインタ + [out] CRC格納先 + + Return: 成功ならTRUE. + + *---------------------------------------------------------------------------*/ + BOOL getSeg3CRCInFp( FILE *fp, u16 *pCRC ); + /*---------------------------------------------------------------------------* Name: getWholeCRCInFp diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp index 4f1dcbc2..14b93b70 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp @@ -6,6 +6,7 @@ #include "srl.h" #include "utility.h" #include "keys.h" +#include "crc_whole.h" #include #include #include @@ -162,6 +163,7 @@ ECSrlResult RCSrl::setRomInfo(void) //this->hForChina = gcnew System::Byte( this->pRomHeader->s.for_china ); this->hRomVersion = gcnew System::Byte( this->pRomHeader->s.rom_version ); this->hHeaderCRC = gcnew System::UInt16( this->pRomHeader->s.header_crc16 ); + this->hIsOldDevEncrypt = gcnew System::Boolean( (this->pRomHeader->s.developer_encrypt_old != 0)?true:false ); switch( this->pRomHeader->s.game_cmd_param & CARD_LATENCY_MASK ) { @@ -658,7 +660,7 @@ ECSrlResult RCSrl::searchSDKVersion( FILE *fp ) } if( rev > 0 ) { - revstr = "-" + rev.ToString(); + revstr = " plus" + rev.ToString(); } patch = patch / 100; switch( relstep / 10000 ) @@ -721,7 +723,10 @@ ECSrlResult RCSrl::searchLicenses(FILE *fp) if( spl->Length >= 2 ) // 念のため { - this->hLicenseList->Add( gcnew RCLicense( spl[0], spl[1] ) ); + if( !spl[1]->StartsWith("BACKUP") && !spl[1]->StartsWith("SSL") && !spl[1]->StartsWith("CPS") ) + { + this->hLicenseList->Add( gcnew RCLicense( spl[0], spl[1] ) ); + } //System::Diagnostics::Debug::WriteLine( "license " + spl[0] + " " + spl[1] ); } } @@ -941,6 +946,18 @@ ECSrlResult RCSrl::mrcNTR( FILE *fp ) "System-Call Library", "This Library is SDK default one.", false, true ) ); } +#if 0 + // セグメント3のCRC + u16 crcseg3; + BOOL crcret = getSeg3CRCInFp( fp, &crcseg3 ); + if( !crcret || (crcseg3 != METWL_SEG3_CRC) ) + { + this->hErrorList->Add( gcnew RCMrcError( + "セグメント3CRC", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, + "セグメント3領域に誤りがあります。", + "System-Call Library", "This Library is SDK default one.", false, true ) ); + } +#endif return ECSrlResult::NOERROR; } // mrcNTR() @@ -953,7 +970,8 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp ) #ifdef METWL_WHETHER_PLATFORM_CHECK // プラットフォームのチェック if( (this->pRomHeader->s.platform_code != PLATFORM_CODE_TWL_HYBLID) && - (this->pRomHeader->s.platform_code != PLATFORM_CODE_TWL_LIMITED) ) + (this->pRomHeader->s.platform_code != PLATFORM_CODE_TWL_LIMITED) && + (this->pRomHeader->s.enable_signature == 0) ) { return ECSrlResult::ERROR_PLATFORM; } @@ -1200,6 +1218,16 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp ) // ROMヘッダ以外の領域のチェック + if( *this->hIsOldDevEncrypt && *this->hHasDSDLPlaySign ) + { + this->hErrorList->Add( gcnew RCMrcError( + "クローンブート署名", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, + "SDKがクローンブートに対応していないため、ROM出しによってデータに矛盾が生じます。任天堂窓口にご相談ください。", + "Clone-Boot Signature", + "Since SDK used by this ROM is not support for making Clone-Boot ROM, Mastering ROM will be error. Please contact with nintendo, sorry.", + false, true ) ); + } + ECSrlResult pctl = this->mrcTWLParentalControl(); if( pctl != ECSrlResult::NOERROR ) { @@ -1266,47 +1294,6 @@ ECSrlResult RCSrl::mrcTWLParentalControl(void) // リージョンに含まれている団体/含まれていない団体の設定をチェック this->mrcRegionOrganization( region ); - // リージョンに含まれている団体の設定が正しいかどうか - if( region == METWL_MASK_REGION_JAPAN ) - { - this->mrcRating( OS_TWL_PCTL_OGN_CERO ); - } - if( region == METWL_MASK_REGION_AMERICA ) - { - this->mrcRating( OS_TWL_PCTL_OGN_ESRB ); - } - if( region == METWL_MASK_REGION_EUROPE ) - { - this->mrcRating( OS_TWL_PCTL_OGN_USK ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_GEN ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_PRT ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_BBFC ); - } - if( region == METWL_MASK_REGION_AUSTRALIA ) - { - this->mrcRating( OS_TWL_PCTL_OGN_OFLC ); - } - if( region == (METWL_MASK_REGION_EUROPE | METWL_MASK_REGION_AUSTRALIA) ) - { - this->mrcRating( OS_TWL_PCTL_OGN_USK ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_GEN ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_PRT ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_BBFC ); - this->mrcRating( OS_TWL_PCTL_OGN_OFLC ); - } -#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER) - if( region == METWL_MASK_REGION_ALL ) - { - this->mrcRating( OS_TWL_PCTL_OGN_CERO ); - this->mrcRating( OS_TWL_PCTL_OGN_ESRB ); - this->mrcRating( OS_TWL_PCTL_OGN_USK ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_GEN ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_PRT ); - this->mrcRating( OS_TWL_PCTL_OGN_PEGI_BBFC ); - this->mrcRating( OS_TWL_PCTL_OGN_OFLC ); - } -#endif //#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER) - return ECSrlResult::NOERROR; } //mrcParentalControl() @@ -1386,10 +1373,6 @@ void RCSrl::mrcRegionOrganization( System::UInt32 region ) break; } } - System::String ^warnEmptyJ = gcnew System::String( "レーティング審査の必要がないソフトだとみなします。審査が必要である場合には、本ツールを用いて修正してください。" ); - System::String ^warnEmptyE = gcnew System::String( "This ROM is not necessary for CERO rating. If necessary, please set this infomation using this tool." ); - System::String ^warnFillJ = gcnew System::String( "リージョンに含まれない団体の情報が設定されていたため、これらの団体の情報を無視して読み込みました。本ツールを用いて修正してください。" ); - System::String ^warnFillE = gcnew System::String( "Some organizations is not include in the region. In reading, therefore, settings for all rating organizations are ignored. Please set this infomation using this tool." ); // リージョンに含まれる団体と含まれない団体をリスト化する System::Collections::Generic::List ^inList = gcnew System::Collections::Generic::List(); @@ -1462,32 +1445,16 @@ void RCSrl::mrcRegionOrganization( System::UInt32 region ) #endif //#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER) } - // リージョンに含まれる団体に何も設定されていないときダメ + // リージョンに含まれる団体の情報が正しいか調べる for each ( System::Byte ogn in inList ) { - if( this->pRomHeader->s.parental_control_rating_info[ ogn ] == 0 ) - { - this->hWarnList->Add( gcnew RCMrcError( - "ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ogn] + warnEmptyJ, - "Parental Control", ognArray[ogn] + warnEmptyE, true, true ) ); - this->clearParentalControl( ogn ); - } + this->mrcRating( ogn ); } - // リージョンに含まれない団体に何か設定されていたらダメ - System::Boolean bSet = false; + + // リージョンに含まれない団体の情報は無視する for each ( System::Byte ogn in exList ) { - if( this->pRomHeader->s.parental_control_rating_info[ ogn ] != 0 ) - { - bSet = true; - this->clearParentalControl( ogn ); - } - } - if( bSet ) - { - this->hWarnList->Add( gcnew RCMrcError( - "ペアレンタルコントロール情報", 0x2f0, 0x2ff, warnFillJ, - "Parental Control", warnFillE, true, true ) ); + this->clearParentalControl( ogn ); } } //mrcRegion @@ -1544,8 +1511,8 @@ void RCSrl::mrcRating( System::Byte ogn ) else { // 間違っていたら"未審査"が返ってくる - System::String ^str = MasterEditorTWL::transRatingToString( - ogn, true, *(this->hArrayParentalRating[ogn]), false ); + System::String ^str = + MasterEditorTWL::transRatingToString( ogn, true, *(this->hArrayParentalRating[ogn]), false ); if( *(this->hArrayParentalAlways[ogn]) == false ) { diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h index 20cfe31d..68160d12 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h @@ -283,6 +283,7 @@ namespace MasterEditorTWL property System::Boolean ^hIsNormalJump; property System::Boolean ^hIsTmpJump; property System::Boolean ^hHasDSDLPlaySign; // ROMヘッダ外のSRLからわかる署名の有無 + property System::Boolean ^hIsOldDevEncrypt; // 旧開発用暗号フラグが立っている // TWL拡張フラグ 一部編集可能 property System::Boolean ^hIsCodecTWL;