diff --git a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.ncb b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.ncb index 10c54bd..3345b57 100644 Binary files a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.ncb and b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.ncb differ diff --git a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.suo b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.suo index 4bdf792..434aa88 100644 Binary files a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.suo and b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL.suo differ diff --git a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/FingerPrinterTWL.vcproj b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/FingerPrinterTWL.vcproj index d2e39b0..fce5c15 100644 --- a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/FingerPrinterTWL.vcproj +++ b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/FingerPrinterTWL.vcproj @@ -215,6 +215,14 @@ RelativePath=".\Form1.cpp" > + + + + @@ -267,6 +275,26 @@ > + + + + + + + + diff --git a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.cpp b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.cpp index 29cb6a1..45bb3c9 100644 --- a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.cpp +++ b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.cpp @@ -1,6 +1,8 @@ #include "stdafx.h" #include "Form1.h" +#include "FormCheck.h" +#include "FormAbout.h" #include #include #include @@ -103,6 +105,14 @@ void Form1::commonOpenRom( System::String ^srcpath ) } memset( this->rh, 0, sizeof(ROM_Header) ); ExtractRomHeader( this->srlbin, this->rh ); + + // すでにフィンガープリントされている場合には注意書きを表示 + if( this->isFingerprint() ) + { + FormCheck ^form = gcnew FormCheck; + form->displayFingerprint( this->rh->s.reserved_C ); + form->Show(); + } } void Form1::commonSaveRom( System::String ^dstpath ) @@ -211,6 +221,18 @@ void Form1::procSaveRomButton() } } +void Form1::procAboutButton() +{ + try + { + FormAbout ^form = gcnew FormAbout; + form->Show(); + } + catch( System::Exception ^ex ) + { + this->errMsg( ex->Message ); + } +} // ------------------------------------------------------------------ // エラーメッセージ diff --git a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.h b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.h index c3b1b2a..93e4503 100644 --- a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.h +++ b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/Form1.h @@ -94,6 +94,9 @@ namespace FingerPrinterTWL { this->labFile = (gcnew System::Windows::Forms::Label()); this->butFile = (gcnew System::Windows::Forms::Button()); this->gboxFP = (gcnew System::Windows::Forms::GroupBox()); + this->gboxFormat = (gcnew System::Windows::Forms::GroupBox()); + this->rTad = (gcnew System::Windows::Forms::RadioButton()); + this->rSrl = (gcnew System::Windows::Forms::RadioButton()); this->labFP = (gcnew System::Windows::Forms::Label()); this->labShorter = (gcnew System::Windows::Forms::Label()); this->butFP = (gcnew System::Windows::Forms::Button()); @@ -104,12 +107,9 @@ namespace FingerPrinterTWL { this->rString = (gcnew System::Windows::Forms::RadioButton()); this->button1 = (gcnew System::Windows::Forms::Button()); this->label1 = (gcnew System::Windows::Forms::Label()); - this->gboxFormat = (gcnew System::Windows::Forms::GroupBox()); - this->rSrl = (gcnew System::Windows::Forms::RadioButton()); - this->rTad = (gcnew System::Windows::Forms::RadioButton()); this->gboxFP->SuspendLayout(); - this->gboxType->SuspendLayout(); this->gboxFormat->SuspendLayout(); + this->gboxType->SuspendLayout(); this->SuspendLayout(); // // tboxFile @@ -154,6 +154,40 @@ namespace FingerPrinterTWL { this->gboxFP->TabIndex = 3; this->gboxFP->TabStop = false; // + // gboxFormat + // + this->gboxFormat->Controls->Add(this->rTad); + this->gboxFormat->Controls->Add(this->rSrl); + this->gboxFormat->Location = System::Drawing::Point(22, 101); + this->gboxFormat->Name = L"gboxFormat"; + this->gboxFormat->Size = System::Drawing::Size(161, 76); + this->gboxFormat->TabIndex = 6; + this->gboxFormat->TabStop = false; + this->gboxFormat->Text = L"Output Format"; + // + // rTad + // + this->rTad->AutoSize = true; + this->rTad->Location = System::Drawing::Point(12, 49); + this->rTad->Name = L"rTad"; + this->rTad->Size = System::Drawing::Size(46, 16); + this->rTad->TabIndex = 1; + this->rTad->TabStop = true; + this->rTad->Text = L"TAD"; + this->rTad->UseVisualStyleBackColor = true; + // + // rSrl + // + this->rSrl->AutoSize = true; + this->rSrl->Checked = true; + this->rSrl->Location = System::Drawing::Point(12, 24); + this->rSrl->Name = L"rSrl"; + this->rSrl->Size = System::Drawing::Size(44, 16); + this->rSrl->TabIndex = 0; + this->rSrl->TabStop = true; + this->rSrl->Text = L"SRL"; + this->rSrl->UseVisualStyleBackColor = true; + // // labFP // this->labFP->AutoSize = true; @@ -242,6 +276,7 @@ namespace FingerPrinterTWL { this->button1->TabIndex = 4; this->button1->Text = L"About This Application"; this->button1->UseVisualStyleBackColor = true; + this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click); // // label1 // @@ -252,40 +287,6 @@ namespace FingerPrinterTWL { this->label1->TabIndex = 5; this->label1->Text = L"Supported ROM type: TWL application (SRL/TAD)"; // - // gboxFormat - // - this->gboxFormat->Controls->Add(this->rTad); - this->gboxFormat->Controls->Add(this->rSrl); - this->gboxFormat->Location = System::Drawing::Point(22, 101); - this->gboxFormat->Name = L"gboxFormat"; - this->gboxFormat->Size = System::Drawing::Size(161, 76); - this->gboxFormat->TabIndex = 6; - this->gboxFormat->TabStop = false; - this->gboxFormat->Text = L"Output Format"; - // - // rSrl - // - this->rSrl->AutoSize = true; - this->rSrl->Checked = true; - this->rSrl->Location = System::Drawing::Point(12, 24); - this->rSrl->Name = L"rSrl"; - this->rSrl->Size = System::Drawing::Size(44, 16); - this->rSrl->TabIndex = 0; - this->rSrl->TabStop = true; - this->rSrl->Text = L"SRL"; - this->rSrl->UseVisualStyleBackColor = true; - // - // rTad - // - this->rTad->AutoSize = true; - this->rTad->Location = System::Drawing::Point(12, 49); - this->rTad->Name = L"rTad"; - this->rTad->Size = System::Drawing::Size(46, 16); - this->rTad->TabIndex = 1; - this->rTad->TabStop = true; - this->rTad->Text = L"TAD"; - this->rTad->UseVisualStyleBackColor = true; - // // Form1 // this->AllowDrop = true; @@ -303,10 +304,10 @@ namespace FingerPrinterTWL { this->DragEnter += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragEnter); this->gboxFP->ResumeLayout(false); this->gboxFP->PerformLayout(); - this->gboxType->ResumeLayout(false); - this->gboxType->PerformLayout(); this->gboxFormat->ResumeLayout(false); this->gboxFormat->PerformLayout(); + this->gboxType->ResumeLayout(false); + this->gboxType->PerformLayout(); this->ResumeLayout(false); this->PerformLayout(); @@ -339,6 +340,7 @@ namespace FingerPrinterTWL { private: void procOpenRomButton( System::String ^path ); void procSaveRomButton(); + void procAboutButton(); // ダイアログ private: @@ -376,6 +378,12 @@ namespace FingerPrinterTWL { String ^path = files[0]; this->procOpenRomButton( path ); // ボタンが押されたときと同じ挙動 } + // 再びボタン + private: + System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) + { + this->procAboutButton(); + } }; } diff --git a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprint_util.h b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprint_util.h index 02c90cd..8ff7d48 100644 --- a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprint_util.h +++ b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprint_util.h @@ -45,9 +45,12 @@ cli::array^ TransStringToBytes( System::String ^src, const int len // 16進文字列をバイト配列に変換 cli::array^ TransHexStringToBytes( System::String ^src, const int len ); -// バイト配列を16進文字列に変換 +// バイト配列を文字列に変換 System::String^ TransBytesToString( cli::array ^bytes ); +// バイト配列を16進文字列に変換 +System::String^ TransBytesToHexString( cli::array ^bytes ); + // ---------------------------------------------------------------------- // GUI // ---------------------------------------------------------------------- diff --git a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprinter_util.cpp b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprinter_util.cpp index e24de53..40ac61f 100644 --- a/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprinter_util.cpp +++ b/build/tools/MasterEditor/FingerPrinterTWL/FingerPrinterTWL/fingerprinter_util.cpp @@ -382,6 +382,31 @@ cli::array^ TransHexStringToBytes( System::String ^src, const int return bytes; } +// バイト配列を文字列に変換 +System::String^ TransBytesToString( cli::array ^bytes ) +{ + System::String ^str = gcnew System::String(""); + int i; + for( i=0; i < bytes->Length; i++ ) + { + if( (0x20 <= bytes[i]) && (bytes[i] <= 0x7E) ) + { + char c[2]; + c[0] = bytes[i]; c[1] = 0; + str += gcnew System::String( c ); + } + else + { + str += " "; + } + if( !((i+1) % 16) ) + { + str += "\r\n"; + } + } + return str; +} + // バイト配列を16進文字列に変換 System::String^ TransBytesToHexString( cli::array ^bytes ) { @@ -392,7 +417,14 @@ System::String^ TransBytesToHexString( cli::array ^bytes ) { System::Byte b = bytes[i]; str += System::String::Format( "{0:X02}", (char)b ); - str += " "; + if( (i+1) % 16 ) + { + str += " "; + } + else + { + str += "\r\n"; + } } return str; }