diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL.ncb b/build/tools/MasterEditorTWL/MasterEditorTWL.ncb index 44f1a04a..a0c6d2d0 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 5fd51018..949fe27f 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 4ce7af5d..c2391061 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 f9b7f3a9..be399253 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/Form1.h @@ -415,7 +415,7 @@ private: System::Windows::Forms::CheckBox^ cboxIsSD; private: System::Windows::Forms::GroupBox^ gboxTitleID; private: System::Windows::Forms::Label^ labHex2; -private: System::Windows::Forms::Label^ labHex1; + private: System::Windows::Forms::TextBox^ tboxTitleIDLo; private: System::Windows::Forms::Label^ labTitleIDLo; private: System::Windows::Forms::Label^ labTitleIDHi; @@ -696,7 +696,7 @@ private: System::Windows::Forms::TextBox^ tboxMedia; /// void InitializeComponent(void) { - System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle4 = (gcnew System::Windows::Forms::DataGridViewCellStyle()); + System::Windows::Forms::DataGridViewCellStyle^ dataGridViewCellStyle2 = (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()); @@ -886,7 +886,6 @@ private: System::Windows::Forms::TextBox^ tboxMedia; this->tboxAppType = (gcnew System::Windows::Forms::TextBox()); this->tboxMedia = (gcnew System::Windows::Forms::TextBox()); this->labHex2 = (gcnew System::Windows::Forms::Label()); - this->labHex1 = (gcnew System::Windows::Forms::Label()); this->tboxTitleIDLo = (gcnew System::Windows::Forms::TextBox()); this->labTitleIDLo = (gcnew System::Windows::Forms::Label()); this->labTitleIDHi = (gcnew System::Windows::Forms::Label()); @@ -2761,7 +2760,6 @@ private: System::Windows::Forms::TextBox^ tboxMedia; this->gboxTitleID->Controls->Add(this->tboxAppType); this->gboxTitleID->Controls->Add(this->tboxMedia); this->gboxTitleID->Controls->Add(this->labHex2); - this->gboxTitleID->Controls->Add(this->labHex1); this->gboxTitleID->Controls->Add(this->tboxTitleIDLo); this->gboxTitleID->Controls->Add(this->labTitleIDLo); this->gboxTitleID->Controls->Add(this->labTitleIDHi); @@ -2814,21 +2812,12 @@ private: System::Windows::Forms::TextBox^ tboxMedia; // labHex2 // this->labHex2->AutoSize = true; - this->labHex2->Location = System::Drawing::Point(160, 48); + this->labHex2->Location = System::Drawing::Point(157, 48); this->labHex2->Name = L"labHex2"; this->labHex2->Size = System::Drawing::Size(11, 12); this->labHex2->TabIndex = 7; this->labHex2->Text = L"h"; // - // labHex1 - // - this->labHex1->AutoSize = true; - this->labHex1->Location = System::Drawing::Point(160, 23); - this->labHex1->Name = L"labHex1"; - this->labHex1->Size = System::Drawing::Size(11, 12); - this->labHex1->TabIndex = 6; - this->labHex1->Text = L"h"; - // // tboxTitleIDLo // this->tboxTitleIDLo->Location = System::Drawing::Point(83, 20); @@ -3426,8 +3415,8 @@ private: System::Windows::Forms::TextBox^ tboxMedia; // // gridError // - dataGridViewCellStyle4->BackColor = System::Drawing::Color::White; - this->gridError->AlternatingRowsDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle2->BackColor = System::Drawing::Color::White; + this->gridError->AlternatingRowsDefaultCellStyle = dataGridViewCellStyle2; 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, @@ -4203,7 +4192,8 @@ private: System::Windows::Forms::TextBox^ tboxMedia; } // TWL拡張情報 - this->tboxTitleIDLo->Text = this->hSrl->hTitleIDLo->ToString("X8"); + //this->tboxTitleIDLo->Text = this->hSrl->hTitleIDLo->ToString("X8"); + this->tboxTitleIDLo->Text = this->hSrl->hTitleIDLo; this->tboxTitleIDHi->Text = this->hSrl->hTitleIDHi->ToString("X8"); this->tboxNormalRomOffset->Text = this->hSrl->hNormalRomOffset->ToString("X8"); this->tboxKeyTableRomOffset->Text = this->hSrl->hKeyTableRomOffset->ToString("X8"); @@ -4258,18 +4248,22 @@ private: System::Windows::Forms::TextBox^ tboxMedia; { this->tboxAppType->Text = gcnew System::String( "Launcher" ); } - if( *(this->hSrl->hIsAppSecure) == true ) + else if( *(this->hSrl->hIsAppSecure) == true ) { this->tboxAppType->Text = gcnew System::String( "Secure" ); } - if( *(this->hSrl->hIsAppSystem) == true ) + else if( *(this->hSrl->hIsAppSystem) == true ) { this->tboxAppType->Text = gcnew System::String( "System" ); } - if( *(this->hSrl->hIsAppUser) == true ) + else if( *(this->hSrl->hIsAppUser) == true ) { this->tboxAppType->Text = gcnew System::String( "User" ); } + else + { + this->tboxAppType->Text = gcnew System::String( "UNKNOWN" ); + } System::String ^appother = gcnew System::String(""); if( *(this->hSrl->hIsLaunch) == false ) diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm b/build/tools/MasterEditorTWL/MasterEditorTWL/Release/BuildLog.htm index f7853bcf..6aa54de9 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/deliverable.cpp b/build/tools/MasterEditorTWL/MasterEditorTWL/deliverable.cpp index caf665e2..27557a58 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/deliverable.cpp +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/deliverable.cpp @@ -244,7 +244,8 @@ ECDeliverableResult RCDeliverable::writeSpreadsheet( } if( node->FirstChild->Value->Equals( "TagTitleIDLo" ) ) { - node->FirstChild->Value = "0x" + hSrl->hTitleIDLo->ToString("X8"); + //node->FirstChild->Value = "0x" + hSrl->hTitleIDLo->ToString("X8"); + node->FirstChild->Value = hSrl->hTitleIDLo; } if( node->FirstChild->Value->Equals( "TagTitleIDHi" ) ) { diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp index 93b70027..0fea1ce8 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.cpp @@ -204,9 +204,10 @@ ECSrlResult RCSrl::setRomInfo(void) u8 *idL = this->pRomHeader->s.titleID_Lo; u32 idH = this->pRomHeader->s.titleID_Hi; - u32 val; - val = ((u32)(idL[0]) << 24) | ((u32)(idL[1]) << 16) | ((u32)(idL[2]) << 8) | ((u32)(idL[3])); // ビッグエンディアン - this->hTitleIDLo = gcnew System::UInt32( val ); + //u32 val; + //val = ((u32)(idL[0]) << 24) | ((u32)(idL[1]) << 16) | ((u32)(idL[2]) << 8) | ((u32)(idL[3])); // ビッグエンディアン + //this->hTitleIDLo = gcnew System::UInt32( val ); + this->hTitleIDLo = gcnew System::String( (char*)idL, 0, 4, utf8 ); this->hTitleIDHi = gcnew System::UInt32( idH ); // TitleIDからわかる情報 @@ -221,9 +222,17 @@ ECSrlResult RCSrl::setRomInfo(void) { *(this->hIsAppLauncher) = true; } - if( idH & TITLE_ID_HI_SECURE_FLAG_MASK ) // 各ビットは排他的とは限らないのでelse ifにはならない + else if( idH & TITLE_ID_HI_SECURE_FLAG_MASK ) // 各ビットは排他的とは限らないのでelse ifにはならない { *(this->hIsAppSecure) = true; + } + else if( (idH & TITLE_ID_HI_APP_TYPE_MASK) == 1 ) + { + *(this->hIsAppSystem) = true; + } + else if( (idH & TITLE_ID_HI_APP_TYPE_MASK) == 0 ) + { + *(this->hIsAppUser) = true; } if( idH & TITLE_ID_HI_DATA_ONLY_FLAG_MASK ) { @@ -237,14 +246,6 @@ ECSrlResult RCSrl::setRomInfo(void) { *(this->hIsLaunch) = true; } - if( (idH & TITLE_ID_HI_APP_TYPE_MASK) == 1 ) - { - *(this->hIsAppSystem) = true; - } - if( (idH & TITLE_ID_HI_APP_TYPE_MASK) == 0 ) - { - *(this->hIsAppUser) = true; - } u16 pub = (u16)((idH & TITLE_ID_HI_PUBLISHER_CODE_MASK) >> TITLE_ID_HI_PUBLISHER_CODE_SHIFT); this->hPublisherCode = gcnew System::UInt16( pub ); diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h index 43c2647e..2dd3559d 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/srl.h @@ -269,7 +269,8 @@ namespace MasterEditorTWL property System::UInt32 ^hNormalRomOffset; property System::UInt32 ^hKeyTableRomOffset; property System::Byte ^hEULAVersion; // 編集可能 - property System::UInt32 ^hTitleIDLo; + //property System::UInt32 ^hTitleIDLo; + property System::String ^hTitleIDLo; property System::UInt32 ^hTitleIDHi; property System::Boolean ^hIsAppLauncher; // TitleIDLoからわかるアプリ種別 property System::Boolean ^hIsAppUser; // TitleIDHiからわかるアプリ種別 diff --git a/build/tools/MasterEditorTWL/MasterEditorTWL/utility.cpp b/build/tools/MasterEditorTWL/MasterEditorTWL/utility.cpp index 13d0afaa..34f10fdb 100644 --- a/build/tools/MasterEditorTWL/MasterEditorTWL/utility.cpp +++ b/build/tools/MasterEditorTWL/MasterEditorTWL/utility.cpp @@ -414,10 +414,13 @@ System::Collections::Generic::List^ MasterEditorTWL::patternMatch( FILE *fp { // バッファの切れ目を調べたいため実際には(パターンの長さ-1)だけ多めにリードする len = ((filesize - cur) < PATTERN_MATCH_LEN_MAX)?(filesize - cur):PATTERN_MATCH_LEN_MAX; - extra = (len < PATTERN_MATCH_LEN_MAX)?0:(patternLen-1); + extra = (len <= PATTERN_MATCH_LEN_MAX)?0:(patternLen-1); // 最後までいったときには余分にリードしてはいけない fseek( fp, cur, SEEK_SET ); - if( (len + extra) != fread( text, 1, len + extra, fp ) ) + u32 readlen = fread( text, 1, len + extra, fp ); + if( (len + extra) != readlen ) { + //System::Diagnostics::Debug::WriteLine( "actual len = " + readlen.ToString() ); + //System::Diagnostics::Debug::WriteLine( "expect len = " + (len + extra).ToString() ); return nullptr; } diff --git a/build/tools/MasterEditorTWL/resource/sheet_templete.xml b/build/tools/MasterEditorTWL/resource/sheet_templete.xml index 564f530b..bd6fedf5 100644 --- a/build/tools/MasterEditorTWL/resource/sheet_templete.xml +++ b/build/tools/MasterEditorTWL/resource/sheet_templete.xml @@ -44,7 +44,7 @@