マスタエディタ:SDKバージョン探索のバグ修正。TitleIDLoを文字列表示に変更。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2449 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
nishikawa_takeshi 2008-09-09 01:12:58 +00:00
parent f70a9e8fd3
commit 0c7c3a3000
10 changed files with 37 additions and 45 deletions

View File

@ -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;
/// </summary>
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Šg£<E28099>î•ñ
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 )

View File

@ -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" ) )
{

View File

@ -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 );

View File

@ -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からわかるアプリ種別

View File

@ -414,10 +414,13 @@ System::Collections::Generic::List<u32>^ 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;
}

View File

@ -44,7 +44,7 @@
<Font ss:FontName=" Pゴシック" x:CharSet="128" x:Family="Modern"/>
</Style>
<Style ss:ID="m20868238">
<Alignment ss:Horizontal="Left" ss:Vertical="Center"/>
<Alignment ss:Horizontal="Left" ss:Vertical="Center" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
@ -11784,14 +11784,6 @@
</Print>
<PageBreakZoom>100</PageBreakZoom>
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>10</ActiveRow>
<ActiveCol>79</ActiveCol>
<RangeSelection>R11C80:R11C100</RangeSelection>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>