mirror of
https://github.com/rvtr/TwlToolsRED.git
synced 2025-10-31 06:41:18 -04:00
出力ファイルチェッカ:ファイル名を真値として比較するのではなく、単にSRLの中身を表示する仕様に変更。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@215 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
parent
9dd09ccd21
commit
dbade3505a
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -40,20 +40,26 @@ int main(array<System::String ^> ^args)
|
||||
throw (gcnew System::Exception("Argc is less than 2."));
|
||||
}
|
||||
|
||||
// ミドルウェアリストをはじく
|
||||
if( System::IO::Path::GetFileNameWithoutExtension(args[1])->ToUpper()->EndsWith("MIDDLEWARE") )
|
||||
{
|
||||
Console::WriteLine( "File: " + args[1] );
|
||||
Console::WriteLine( "========================================================" );
|
||||
Console::WriteLine( "Not Support to Middleware List." );
|
||||
return 0; // 正常終了扱い
|
||||
}
|
||||
|
||||
// Šg’£Žq‚Å”»’è
|
||||
if( System::IO::Path::GetExtension(args[1])->ToUpper() == ".XML" )
|
||||
{
|
||||
// args[0] ‚̓_ƒ~<7E>[
|
||||
System::String ^sheet = args[1];
|
||||
DebugPrint( "Sheet file : " + sheet );
|
||||
Console::Write( System::IO::Path::GetFileName( sheet ) + "\t" );
|
||||
DebugPrint( "\n" );
|
||||
|
||||
FilenameItem ^fItem = gcnew FilenameItem;
|
||||
fItem->parseFilename( sheet );
|
||||
SheetItem ^sItem = gcnew SheetItem;
|
||||
sItem->readSheet( sheet );
|
||||
checkSheet( fItem, sItem );
|
||||
checkSheet( sItem );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -61,20 +67,18 @@ int main(array<System::String ^> ^args)
|
||||
System::String ^target = args[1];
|
||||
DebugPrint( "Original file : " + original );
|
||||
DebugPrint( "Target file : " + target );
|
||||
Console::Write( System::IO::Path::GetFileName( target ) + "\t" );
|
||||
DebugPrint( "\n" );
|
||||
|
||||
FilenameItem ^fItem = gcnew FilenameItem;
|
||||
fItem->parseFilename( target );
|
||||
checkRom( fItem, original, target );
|
||||
checkRom( original, target );
|
||||
}
|
||||
}
|
||||
catch( System::Exception ^ex )
|
||||
{
|
||||
Console::WriteLine( "========================================================" );
|
||||
Console::WriteLine( "NG - " + ex->Message);
|
||||
return -1;
|
||||
}
|
||||
Console::WriteLine( "OK" );
|
||||
Console::WriteLine( "END" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -17,178 +17,18 @@ void setDebugPrint( System::Boolean b )
|
||||
gbDebugPrint = b;
|
||||
}
|
||||
|
||||
void DebugPrint( System::String ^str )
|
||||
void DebugPrint( System::String ^fmt, ... cli::array<System::Object^> ^args )
|
||||
{
|
||||
if( gbDebugPrint )
|
||||
{
|
||||
Console::WriteLine( str );
|
||||
}
|
||||
}
|
||||
|
||||
void DebugPrint( System::String ^fmt, System::Object ^arg0 )
|
||||
{
|
||||
if( gbDebugPrint )
|
||||
{
|
||||
Console::WriteLine( fmt, arg0 );
|
||||
}
|
||||
}
|
||||
|
||||
void DebugPrint( System::String ^fmt, System::Object ^arg0, System::Object ^arg1 )
|
||||
{
|
||||
if( gbDebugPrint )
|
||||
{
|
||||
Console::WriteLine( fmt, arg0, arg1 );
|
||||
}
|
||||
}
|
||||
|
||||
void DebugPrint( System::String ^fmt, System::Object ^arg0, System::Object ^arg1, System::Object ^arg2 )
|
||||
{
|
||||
if( gbDebugPrint )
|
||||
{
|
||||
Console::WriteLine( fmt, arg0, arg1, arg2 );
|
||||
Console::WriteLine( fmt, args );
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// ファイル名の解析
|
||||
// ROMƒwƒbƒ_’†‚Ì’l‚̉ðŽß
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
System::Void FilenameItem::parseFilename( System::String ^filepath )
|
||||
{
|
||||
System::String ^filename = System::IO::Path::GetFileNameWithoutExtension(filepath);
|
||||
|
||||
cli::array<System::String^> ^list = filename->Split( '_' );
|
||||
if( list->Length < 4 )
|
||||
{
|
||||
throw (gcnew System::Exception("Illegal filename format. REGION_OGN_AGE_LANG.[SRL/XML]"));
|
||||
return;
|
||||
}
|
||||
this->region = System::String::Copy(list[0]);
|
||||
this->ogn = System::String::Copy(list[1]);
|
||||
this->rating = System::String::Copy(list[2]);
|
||||
this->lang = System::String::Copy(list[3]);
|
||||
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
DebugPrint( "{0,-10} {1,-20}", "Filename",filename );
|
||||
DebugPrint( "{0,-10} {1,-20}", "Region", this->region );
|
||||
DebugPrint( "{0,-10} {1,-20}", "Ogn", this->ogn );
|
||||
DebugPrint( "{0,-10} {1,-20}", "Rating", this->rating );
|
||||
DebugPrint( "{0,-10} {1,-20}", "Language",this->lang );
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
|
||||
// ファイル名の検査
|
||||
if( this->getRegionBitmap() == 0 )
|
||||
{
|
||||
throw (gcnew System::Exception("Illegal filename format. (Region.) REGION_OGN_RATING_LANG.[SRL/XML]"));
|
||||
return;
|
||||
}
|
||||
if( this->getOgnNumber() < -1 )
|
||||
{
|
||||
throw (gcnew System::Exception("Illegal filename format. (Ogn.) REGION_OGN_RATING_LANG.[SRL/XML]"));
|
||||
return;
|
||||
}
|
||||
if( this->getRatingValue() == 0 )
|
||||
{
|
||||
throw (gcnew System::Exception("Illegal filename format. (Rating.) REGION_OGN_RATING_LANG.[SRL/XML]"));
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// ファイル名の文字列をROMヘッダ中の値に変換
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
u32 FilenameItem::getRegionBitmap()
|
||||
{
|
||||
u32 bitmap = 0;
|
||||
if( this->region == "JP" )
|
||||
{
|
||||
bitmap = METWL_MASK_REGION_JAPAN;
|
||||
}
|
||||
else if( this->region == "US" )
|
||||
{
|
||||
bitmap = METWL_MASK_REGION_AMERICA;
|
||||
}
|
||||
else if( this->region == "EU" )
|
||||
{
|
||||
bitmap = METWL_MASK_REGION_EUROPE;
|
||||
}
|
||||
else if( this->region == "AU" )
|
||||
{
|
||||
bitmap = METWL_MASK_REGION_AUSTRALIA;
|
||||
}
|
||||
else if( this->region == "EUAU" )
|
||||
{
|
||||
bitmap = (METWL_MASK_REGION_EUROPE | METWL_MASK_REGION_AUSTRALIA);
|
||||
}
|
||||
else if( this->region == "USAU" )
|
||||
{
|
||||
bitmap = (METWL_MASK_REGION_AMERICA | METWL_MASK_REGION_AUSTRALIA);
|
||||
}
|
||||
else if( this->region == "USEUAU" )
|
||||
{
|
||||
bitmap = (METWL_MASK_REGION_AMERICA | METWL_MASK_REGION_EUROPE | METWL_MASK_REGION_AUSTRALIA);
|
||||
}
|
||||
else if( this->region == "CN" )
|
||||
{
|
||||
bitmap = (METWL_MASK_REGION_CHINA);
|
||||
}
|
||||
else if( this->region == "KR" )
|
||||
{
|
||||
bitmap = (METWL_MASK_REGION_KOREA);
|
||||
}
|
||||
else if( this->region == "ALL" )
|
||||
{
|
||||
bitmap = METWL_MASK_REGION_ALL;
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
int FilenameItem::getOgnNumber()
|
||||
{
|
||||
int num = -2;
|
||||
if( this->ogn == "CERO" )
|
||||
{
|
||||
num = OS_TWL_PCTL_OGN_CERO;
|
||||
}
|
||||
else if( this->ogn == "ESRB" )
|
||||
{
|
||||
num = OS_TWL_PCTL_OGN_ESRB;
|
||||
}
|
||||
else if( this->ogn == "USK" )
|
||||
{
|
||||
num = OS_TWL_PCTL_OGN_USK;
|
||||
}
|
||||
else if( this->ogn == "PEGI" )
|
||||
{
|
||||
num = OS_TWL_PCTL_OGN_PEGI_GEN;
|
||||
}
|
||||
else if( this->ogn == "PRT" )
|
||||
{
|
||||
num = OS_TWL_PCTL_OGN_PEGI_PRT;
|
||||
}
|
||||
else if( this->ogn == "BBFC" )
|
||||
{
|
||||
num = OS_TWL_PCTL_OGN_PEGI_BBFC;
|
||||
}
|
||||
else if( this->ogn == "OFLC" )
|
||||
{
|
||||
num = OS_TWL_PCTL_OGN_OFLC;
|
||||
}
|
||||
//else if( this->ogn == "GRB" )
|
||||
//{
|
||||
// num = OS_TWL_PCTL_OGN_GRB;
|
||||
//}
|
||||
else if( this->ogn == "UN" )
|
||||
{
|
||||
num = -1;
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
System::String ^FilenameItem::getOgnString(int ogn)
|
||||
System::String^ getOgnString(int ogn)
|
||||
{
|
||||
System::String ^str = nullptr;
|
||||
if( ogn == OS_TWL_PCTL_OGN_CERO )
|
||||
@ -223,23 +63,32 @@ System::String ^FilenameItem::getOgnString(int ogn)
|
||||
//{
|
||||
// str = "GRB";
|
||||
//}
|
||||
else if( ogn < 0 )
|
||||
else
|
||||
{
|
||||
str = "UN";
|
||||
str = "rsv.";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
u8 FilenameItem::getRatingValue()
|
||||
System::String^ getRatingString( u8 rating )
|
||||
{
|
||||
u8 val = 0;
|
||||
if( this->rating == "RP" )
|
||||
System::String ^str;
|
||||
if( rating == 0 )
|
||||
{
|
||||
val = OS_TWL_PCTL_OGNINFO_ENABLE_MASK | OS_TWL_PCTL_OGNINFO_ALWAYS_MASK;
|
||||
str = "Undefined";
|
||||
}
|
||||
else if( rating == (OS_TWL_PCTL_OGNINFO_ENABLE_MASK | OS_TWL_PCTL_OGNINFO_ALWAYS_MASK) )
|
||||
{
|
||||
str = "RP";
|
||||
}
|
||||
else if( rating & OS_TWL_PCTL_OGNINFO_ENABLE_MASK )
|
||||
{
|
||||
u8 age = rating & ~(OS_TWL_PCTL_OGNINFO_ENABLE_MASK);
|
||||
str = age.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
val = OS_TWL_PCTL_OGNINFO_ENABLE_MASK | (System::Byte::Parse(this->rating));
|
||||
str = "Illegal";
|
||||
}
|
||||
return val;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
@ -2,28 +2,6 @@
|
||||
|
||||
#include <twl/types.h>
|
||||
|
||||
//
|
||||
// ファイル名から抽出される真値の構造体
|
||||
//
|
||||
ref class FilenameItem
|
||||
{
|
||||
public:
|
||||
property System::String ^region;
|
||||
property System::String ^ogn;
|
||||
property System::String ^rating;
|
||||
property System::String ^lang;
|
||||
public:
|
||||
FilenameItem(){}
|
||||
public:
|
||||
System::Void parseFilename( System::String ^filepath );
|
||||
public:
|
||||
// 各メンバをROMヘッダの値に変換
|
||||
u32 getRegionBitmap();
|
||||
int getOgnNumber();
|
||||
System::String ^getOgnString(int ogn);
|
||||
u8 getRatingValue();
|
||||
};
|
||||
|
||||
//
|
||||
// 提出確認書から抽出される情報の構造体
|
||||
//
|
||||
@ -32,7 +10,7 @@ ref class SheetItem
|
||||
public:
|
||||
property System::String ^region;
|
||||
property cli::array<System::String^> ^ratings;
|
||||
property System::Boolean IsUnnecessaryRating;
|
||||
property System::String ^IsUnnecessaryRating;
|
||||
public:
|
||||
SheetItem(){}
|
||||
public:
|
||||
@ -40,14 +18,15 @@ public:
|
||||
};
|
||||
|
||||
// ROMヘッダの値と真値(ファイル名)を比較
|
||||
System::Void checkRom( FilenameItem ^fItem, System::String ^orgSrl, System::String ^targetSrl );
|
||||
System::Void checkRom( System::String ^orgSrl, System::String ^targetSrl );
|
||||
|
||||
// 提出確認書の文字列と真値を比較
|
||||
System::Void checkSheet( FilenameItem ^fItem, SheetItem ^sItem );
|
||||
System::Void checkSheet( SheetItem ^sItem );
|
||||
|
||||
// ROMヘッダの値を解釈
|
||||
System::String^ getOgnString(int ogn);
|
||||
System::String^ getRatingString( u8 rating );
|
||||
|
||||
// デバッグ表示
|
||||
void setDebugPrint( System::Boolean b );
|
||||
void DebugPrint( System::String ^str );
|
||||
void DebugPrint( System::String ^fmt, System::Object ^arg0 );
|
||||
void DebugPrint( System::String ^fmt, System::Object ^arg0, System::Object ^arg1 );
|
||||
void DebugPrint( System::String ^fmt, System::Object ^arg0, System::Object ^arg1, System::Object ^arg2 );
|
||||
void DebugPrint( System::String ^fmt, ... cli::array<System::Object^> ^args );
|
||||
|
||||
@ -14,10 +14,12 @@
|
||||
System::Void checkRomHeaderSign( ROM_Header *prh );
|
||||
System::Void verifyArea( FILE *fp1, FILE *fp2, const int offset, const int size );
|
||||
|
||||
using namespace System;
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// 出力SRLのチェック
|
||||
// -------------------------------------------------------------------
|
||||
System::Void checkRom( FilenameItem ^fItem, System::String ^orgSrl, System::String ^targetSrl )
|
||||
System::Void checkRom( System::String ^orgSrl, System::String ^targetSrl )
|
||||
{
|
||||
const char *chorg =
|
||||
(const char*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi( orgSrl ).ToPointer();
|
||||
@ -45,115 +47,24 @@ System::Void checkRom( FilenameItem ^fItem, System::String ^orgSrl, System::Stri
|
||||
// 署名のチェック
|
||||
checkRomHeaderSign( &rh );
|
||||
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", nullptr, "TrueValue", "RomHeader" );
|
||||
DebugPrint( "--" );
|
||||
Console::WriteLine( "--------------------------------------------------------" );
|
||||
Console::WriteLine( "{0,-15} {1,-20}", nullptr, "RomHeader" );
|
||||
Console::WriteLine( "--" );
|
||||
|
||||
// リージョンのチェック
|
||||
u32 region = fItem->getRegionBitmap(); // ファイル名に対応する真値を取得
|
||||
DebugPrint( "{0,-10} {1,-20:X04} {2,-20:X04}", "Region", region, rh.s.card_region_bitmap );
|
||||
DebugPrint( "--" );
|
||||
if( rh.s.card_region_bitmap != region )
|
||||
{
|
||||
throw (gcnew System::Exception("In Rom Header, illegal region in the ROM Header."));
|
||||
return;
|
||||
}
|
||||
// リージョンの表示
|
||||
Console::WriteLine( "{0,-15} {1,-20:X04}", "Region", rh.s.card_region_bitmap );
|
||||
Console::WriteLine( "--" );
|
||||
|
||||
// 設定したレーティングが正しいかどうかをチェック
|
||||
System::Collections::Generic::List<int> ^ognlist = MasterEditorTWL::getOgnListInRegion( region );
|
||||
if( fItem->getOgnNumber() >= 0 )
|
||||
{
|
||||
// 「レーティング表示不要」でないとき
|
||||
|
||||
int ogn = fItem->getOgnNumber(); // ファイル名に対応する真値を取得
|
||||
u8 rating = fItem->getRatingValue();
|
||||
DebugPrint( "{0,-10} {1,-20:X02} {2,-20:X02}", fItem->getOgnString(ogn), rating, rh.s.parental_control_rating_info[ogn] );
|
||||
if( rh.s.parental_control_rating_info[ ogn ] != rating )
|
||||
{
|
||||
throw (gcnew System::Exception("In Rom Header, mismatch Rating Ogn " + ogn.ToString() + "."));
|
||||
return;
|
||||
}
|
||||
|
||||
// リージョンに含まれるその他の団体が「全年齢」になっているかチェック
|
||||
for each ( int ogn in ognlist )
|
||||
{
|
||||
if( ogn != fItem->getOgnNumber() )
|
||||
{
|
||||
u8 zero = OS_TWL_PCTL_OGNINFO_ENABLE_MASK | 0;
|
||||
DebugPrint( "{0,-10} {1,-20:X02} {2,-20:X02}", fItem->getOgnString(ogn), zero, rh.s.parental_control_rating_info[ogn] );
|
||||
if( rh.s.parental_control_rating_info[ogn] != zero )
|
||||
{
|
||||
throw (gcnew System::Exception("In Rom Header, Rating Ogn " + ogn.ToString() + " is not enabled."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 「レーティング不要」フラグが立っていてはいけない
|
||||
if( rh.s.unnecessary_rating_display != 0 )
|
||||
{
|
||||
throw (gcnew System::Exception("In Rom Header, \"Unnecessary\" flag is asserted."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 「レーティング表示不要」のとき
|
||||
|
||||
// リージョンに含まれるすべての団体が「全年齢」になっているかチェック
|
||||
for each ( int ogn in ognlist )
|
||||
{
|
||||
u8 zero = OS_TWL_PCTL_OGNINFO_ENABLE_MASK | 0;
|
||||
DebugPrint( "{0,-10} {1,-20:X02} {2,-20:X02}", fItem->getOgnString(ogn), zero, rh.s.parental_control_rating_info[ogn] );
|
||||
if( rh.s.parental_control_rating_info[ogn] != zero )
|
||||
{
|
||||
throw (gcnew System::Exception("In Rom Header, Rating Ogn " + ogn.ToString() + " is not enabled."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// フラグチェック
|
||||
if( rh.s.unnecessary_rating_display == 0 )
|
||||
{
|
||||
throw (gcnew System::Exception("In Rom Header, \"Unnecessary\" flag is negated."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 表示
|
||||
System::Collections::Generic::List<int> ^alllist = gcnew System::Collections::Generic::List<int>();
|
||||
alllist->Clear();
|
||||
alllist->Add( OS_TWL_PCTL_OGN_CERO );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_ESRB );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_USK );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_OFLC );
|
||||
//alllist->Add( OS_TWL_PCTL_OGN_GRB );
|
||||
|
||||
// リージョンに含まれない団体のレーティングがクリアされているかチェック
|
||||
// レーティングの表示
|
||||
int i;
|
||||
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
|
||||
{
|
||||
if( ognlist->IndexOf(i) < 0 )
|
||||
{
|
||||
if( alllist->IndexOf(i) >= 0 )
|
||||
{
|
||||
DebugPrint( "{0,-10} {1,-20:X02} {2,-20:X02}", fItem->getOgnString(i), (u8)0, rh.s.parental_control_rating_info[i] );
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugPrint( "{0,-10} {1,-20:X02} {2,-20:X02}", "Ogn" + i.ToString("D2") + "(rsv)", (u8)0, rh.s.parental_control_rating_info[i] );
|
||||
}
|
||||
if( rh.s.parental_control_rating_info[i] != 0 )
|
||||
{
|
||||
throw (gcnew System::Exception("In Rom Header, Rating Ogn " + i.ToString() + " is not cleared in ROM Header."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
Console::WriteLine( "{0,-15} {1,-10:X02} {2}",
|
||||
getOgnString(i), rh.s.parental_control_rating_info[i], getRatingString(rh.s.parental_control_rating_info[i]) );
|
||||
}
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
Console::WriteLine( "--" );
|
||||
Console::WriteLine( "{0,-15} {1:X}", "Unnecessary", rh.s.unnecessary_rating_display );
|
||||
Console::WriteLine( "--------------------------------------------------------" );
|
||||
|
||||
// 全領域ベリファイ
|
||||
FILE *fp1 = NULL;
|
||||
@ -173,9 +84,9 @@ System::Void checkRom( FilenameItem ^fItem, System::String ^orgSrl, System::Stri
|
||||
u32 filesize1 = ftell( fp1 );
|
||||
fseek(fp2, 0, SEEK_END);
|
||||
u32 filesize2 = ftell( fp2 );
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", nullptr, "Original File", "Target File" );
|
||||
DebugPrint( "{0,-10} {1,-20:X08} {2,-20:X08}", "Filesize", filesize1, filesize2 );
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
Console::WriteLine( "{0,-15} {1,-20} {2,-20}", nullptr, "Original File", "Target File" );
|
||||
Console::WriteLine( "{0,-15} {1,-20:X08} {2,-20:X08}", "Filesize", filesize1, filesize2 );
|
||||
Console::WriteLine( "--------------------------------------------------------" );
|
||||
if( filesize1 != filesize2 )
|
||||
{
|
||||
throw (gcnew System::Exception("Incorrect filesize"));
|
||||
@ -186,7 +97,7 @@ System::Void checkRom( FilenameItem ^fItem, System::String ^orgSrl, System::Stri
|
||||
verifyArea( fp1, fp2, 0x1b4, 0x2f0 - 0x1b4 );
|
||||
verifyArea( fp1, fp2, 0x300, 0xf80 - 0x300 );
|
||||
verifyArea( fp1, fp2, 0x1000, filesize1 - 0x1000 );
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
Console::WriteLine( "--------------------------------------------------------" );
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
@ -263,7 +174,7 @@ System::Void verifyArea( FILE *fp1, FILE *fp2, const int offset, const int size
|
||||
return;
|
||||
}
|
||||
|
||||
DebugPrint( "{0,-10} {1:X08} - {2:X08}", "Verify", offset, offset+size-1 );
|
||||
Console::WriteLine( "{0,-15} {1:X08} - {2:X08}", "Verify", offset, offset+size-1 );
|
||||
|
||||
cli::array<System::Byte> ^mbuf1 = gcnew cli::array<System::Byte>(VERIFY_AREA_BUFSIZE); // 解放の必要なし
|
||||
pin_ptr<unsigned char> buf1 = &mbuf1[0];
|
||||
|
||||
@ -47,34 +47,22 @@ System::Void SheetItem::readSheet( System::String ^sheetfile )
|
||||
this->ratings[ OS_TWL_PCTL_OGN_OFLC ] = MasterEditorTWL::getXPathText( root, "/Sheet/RatingOFLC" );
|
||||
//this->ratings[ OS_TWL_PCTL_OGN_GRB ] = MasterEditorTWL::getXPathText( root, "/Sheet/RatingGRB" );
|
||||
|
||||
System::String ^text = MasterEditorTWL::getXPathText( root, "/Sheet/IsUnnecessaryRating" );
|
||||
if( !System::String::IsNullOrEmpty( text ) && text->Equals( "○" ) )
|
||||
{
|
||||
this->IsUnnecessaryRating = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->IsUnnecessaryRating = false;
|
||||
}
|
||||
|
||||
//Console::WriteLine( "[In Sheet]" );
|
||||
//Console::WriteLine( "Region: " + this->region );
|
||||
//Console::WriteLine( "Region: {0,-20} {1,-20}", this->region, this->region );
|
||||
//Console::WriteLine( "CERO: " + this->ratings[ OS_TWL_PCTL_OGN_CERO ] );
|
||||
//Console::WriteLine( "ESRB: " + this->ratings[ OS_TWL_PCTL_OGN_ESRB ] );
|
||||
//Console::WriteLine( "USK: " + this->ratings[ OS_TWL_PCTL_OGN_USK ] );
|
||||
//Console::WriteLine( "PEGI: " + this->ratings[ OS_TWL_PCTL_OGN_PEGI_GEN ] );
|
||||
//Console::WriteLine( "PEGIPRT: " + this->ratings[ OS_TWL_PCTL_OGN_PEGI_PRT ] );
|
||||
//Console::WriteLine( "PEGIBBFC: " + this->ratings[ OS_TWL_PCTL_OGN_PEGI_BBFC ] );
|
||||
//Console::WriteLine( "OFLC: " + this->ratings[ OS_TWL_PCTL_OGN_OFLC ] );
|
||||
////Console::WriteLine( "GRB: " + this->ratings[ OS_TWL_PCTL_OGN_GRB ] );
|
||||
//Console::WriteLine( "Unnecessary: " + this->IsUnnecessaryRating.ToString() );
|
||||
this->IsUnnecessaryRating = MasterEditorTWL::getXPathText( root, "/Sheet/IsUnnecessaryRating" );
|
||||
//System::String ^text = MasterEditorTWL::getXPathText( root, "/Sheet/IsUnnecessaryRating" );
|
||||
//if( !System::String::IsNullOrEmpty( text ) && text->Equals( "○" ) )
|
||||
//{
|
||||
// this->IsUnnecessaryRating = true;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// this->IsUnnecessaryRating = false;
|
||||
//}
|
||||
}
|
||||
|
||||
// 中間ファイルを削除
|
||||
if( System::IO::File::Exists( tmpfile ) )
|
||||
{
|
||||
System::IO::File::Delete( tmpfile );
|
||||
//System::IO::File::Delete( tmpfile );
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,134 +73,24 @@ System::Void SheetItem::readSheet( System::String ^sheetfile )
|
||||
|
||||
// @arg [in] ファイル情報
|
||||
// @arg [in] 提出確認書の情報
|
||||
System::Void checkSheet( FilenameItem ^fItem, SheetItem ^sItem )
|
||||
System::Void checkSheet( SheetItem ^sItem )
|
||||
{
|
||||
System::Xml::XmlDocument ^doc = gcnew System::Xml::XmlDocument;
|
||||
System::String ^cfgfile = System::IO::Path::GetDirectoryName( System::Reflection::Assembly::GetEntryAssembly()->Location )
|
||||
+ "\\config.xml";
|
||||
doc->Load( cfgfile );
|
||||
Console::WriteLine( "--------------------------------------------------------" );
|
||||
Console::WriteLine( "{0,-15} {1,-20}", nullptr, "Sheet" );
|
||||
Console::WriteLine( "--" );
|
||||
|
||||
// XMLからデータを抽出
|
||||
System::Xml::XmlElement ^root = doc->DocumentElement;
|
||||
// リージョンの文字列を表示
|
||||
Console::WriteLine( "{0,-15} {1,-20}", "Region", sItem->region );
|
||||
Console::WriteLine( "--" );
|
||||
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", nullptr, "TrueValue", "Sheet" );
|
||||
DebugPrint( "--" );
|
||||
|
||||
// 設定ファイル中の真値と提出確認書の記述を比較
|
||||
// (設定ファイルにはファイル名と対応させたタグ名で真値が記述されている)
|
||||
|
||||
// リージョンの文字列をチェック
|
||||
System::String ^region = MasterEditorTWL::getXPathText( root, "/Config/Region/" + fItem->region + "/" + fItem->lang );
|
||||
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", "Region", region, sItem->region );
|
||||
DebugPrint( "--" );
|
||||
|
||||
if( sItem->region != region )
|
||||
{
|
||||
throw (gcnew System::Exception("In Sheet, region is an Illegal String."));
|
||||
return;
|
||||
}
|
||||
|
||||
// レーティングの文字列のチェック
|
||||
System::Collections::Generic::List<int> ^ognlist = MasterEditorTWL::getOgnListInRegion( fItem->getRegionBitmap() );
|
||||
if( fItem->getOgnNumber() >= 0 )
|
||||
{
|
||||
// 「レーティング表示不要」でないとき
|
||||
|
||||
// 対象のレーティングの文字列を真値と比較
|
||||
System::String ^rating = MasterEditorTWL::getXPathText( root, "/Config/Rating/" + fItem->ogn + "/r" + fItem->rating + "/" + fItem->lang );
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", fItem->ogn, rating, sItem->ratings[fItem->getOgnNumber()] );
|
||||
if( sItem->ratings[fItem->getOgnNumber()] != rating )
|
||||
{
|
||||
throw (gcnew System::Exception("In Sheet, " + fItem->ogn + " mismatch."));
|
||||
return;
|
||||
}
|
||||
|
||||
// リージョンに含まれるその他の団体が「全年齢」になっているかチェック
|
||||
for each ( int ogn in ognlist )
|
||||
{
|
||||
if( ogn != fItem->getOgnNumber() )
|
||||
{
|
||||
// 設定ファイルから 00 (全年齢)のときの文字列を抜き出す
|
||||
System::String ^str = fItem->getOgnString( ogn );
|
||||
System::String ^other = MasterEditorTWL::getXPathText( root, "/Config/Rating/" + str + "/r00/" + fItem->lang );
|
||||
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", str, other, sItem->ratings[ogn] );
|
||||
|
||||
// 提出確認書の文字列をチェック
|
||||
if( sItem->ratings[ogn] != other )
|
||||
{
|
||||
throw (gcnew System::Exception("In Sheet, " + str + " mismatch a String for \"All ages\""));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 「レーティング不要」フラグが立っていてはいけない
|
||||
if( sItem->IsUnnecessaryRating )
|
||||
{
|
||||
throw (gcnew System::Exception("In Sheet, \"Unnecessary\" flag is asserted."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 「レーティング表示不要」のとき
|
||||
|
||||
// リージョンに含まれるすべての団体が「レーティング不要」になっているかチェック
|
||||
for each ( int ogn in ognlist )
|
||||
{
|
||||
// 設定ファイルから「レーティング表示不要」のときの文字列を抜き出す
|
||||
System::String ^str = fItem->getOgnString(-1);
|
||||
System::String ^unnecessary = MasterEditorTWL::getXPathText( root, "/Config/Rating/" + str + "/" + fItem->lang );
|
||||
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", fItem->getOgnString(ogn), unnecessary, sItem->ratings[ogn] );
|
||||
|
||||
// 提出確認書の文字列をチェック
|
||||
if( sItem->ratings[ogn] != unnecessary )
|
||||
{
|
||||
throw (gcnew System::Exception("In Sheet, " + str + " mismatch a string for \"Unnecessary\""));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// フラグをチェック
|
||||
if( !sItem->IsUnnecessaryRating )
|
||||
{
|
||||
throw (gcnew System::Exception("In Sheet, \"Unnecessary\" flag is negated."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// リージョン設定可能な団体(Reservedでない団体)をリストアップ(ここに含まれない団体はチェックしなくてよい)
|
||||
System::Collections::Generic::List<int> ^alllist = gcnew System::Collections::Generic::List<int>();
|
||||
alllist->Clear();
|
||||
alllist->Add( OS_TWL_PCTL_OGN_CERO );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_ESRB );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_USK );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
|
||||
alllist->Add( OS_TWL_PCTL_OGN_OFLC );
|
||||
//alllist->Add( OS_TWL_PCTL_OGN_GRB );
|
||||
|
||||
// リージョンに含まれない団体が「不可」になっているかチェック
|
||||
System::String ^disable = MasterEditorTWL::getXPathText( root, "/Config/Rating/DISABLE/" + fItem->lang );
|
||||
// レーティングの文字列の表示
|
||||
int i;
|
||||
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
|
||||
{
|
||||
// Reserved の団体は調べない
|
||||
if( (alllist->IndexOf(i) >=0 ) && (ognlist->IndexOf(i) < 0) )
|
||||
{
|
||||
DebugPrint( "{0,-10} {1,-20} {2,-20}", fItem->getOgnString(i), disable, sItem->ratings[i] );
|
||||
if( sItem->ratings[i] != disable )
|
||||
{
|
||||
throw (gcnew System::Exception("In Sheet, " + fItem->getOgnString(i) + " mismatch a string for \"Disable\""));
|
||||
return;
|
||||
}
|
||||
}
|
||||
Console::WriteLine( "{0,-15} {1,-20}", getOgnString(i), sItem->ratings[i] );
|
||||
}
|
||||
DebugPrint( "--------------------------------------------------------" );
|
||||
Console::WriteLine( "--" );
|
||||
Console::WriteLine( "{0,-15} {1,-20}", "Unnecessary", sItem->IsUnnecessaryRating );
|
||||
Console::WriteLine( "--------------------------------------------------------" );
|
||||
return;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,37 +2,36 @@
|
||||
<MasterEditorTWL>
|
||||
<Lang>E</Lang>
|
||||
<Form>
|
||||
<MasterEditorVersion>1.3</MasterEditorVersion>
|
||||
<MasterEditorVersion>1.4</MasterEditorVersion>
|
||||
<ProductName>Sample Game Name</ProductName>
|
||||
<ProductCode1>P</ProductCode1>
|
||||
<ProductCode2>KUGJ</ProductCode2>
|
||||
<ProductNameForeign>Sample Game Name F</ProductNameForeign>
|
||||
<ProductCode2>KUGE</ProductCode2>
|
||||
<ProductNameForeign>Sample Game Name Foreign</ProductNameForeign>
|
||||
<ProductCode1Foreign>P</ProductCode1Foreign>
|
||||
<ProductCode2Foreign1>0CZE</ProductCode2Foreign1>
|
||||
<ProductCode2Foreign2>0CZP</ProductCode2Foreign2>
|
||||
<ProductCode2Foreign3>0CZU</ProductCode2Foreign3>
|
||||
<ProductCode2Foreign1>KUGJ</ProductCode2Foreign1>
|
||||
<ProductCode2Foreign2>KUGP</ProductCode2Foreign2>
|
||||
<ProductCode2Foreign3>KUGU</ProductCode2Foreign3>
|
||||
<SubmitVersion>0</SubmitVersion>
|
||||
<Backup>4</Backup>
|
||||
<ReleaseForeign>Y</ReleaseForeign>
|
||||
<Remarks>Sample File.</Remarks>
|
||||
<Remarks>Sample.</Remarks>
|
||||
<SubmitWay>Mail</SubmitWay>
|
||||
<Purpose>Sale</Purpose>
|
||||
<ReleaseDate>2009/02/15 10:54:03</ReleaseDate>
|
||||
<SubmitDate>2009/01/21 10:54:03</SubmitDate>
|
||||
<ReleaseDate>4/30/2009 2:33:14 AM</ReleaseDate>
|
||||
<SubmitDate>3/1/2009 2:33:14 AM</SubmitDate>
|
||||
<Company1>Nintendo Co., Ltd.</Company1>
|
||||
<Depart1>RED</Depart1>
|
||||
<Name1>Taro Ninten</Name1>
|
||||
<Depart1>Research and Engineering Division</Depart1>
|
||||
<Name1>Ninten Tarou</Name1>
|
||||
<Tel1>075-662-9600</Tel1>
|
||||
<Fax1>075-662-9624</Fax1>
|
||||
<Mail1>taro@nintendo.co.jp</Mail1>
|
||||
<InputPerson2>Y</InputPerson2>
|
||||
<Company2>Nintendo Co., Ltd.</Company2>
|
||||
<Depart2>RED</Depart2>
|
||||
<Name2>Jiro Ninten</Name2>
|
||||
<Depart2>Research and Engineering Division</Depart2>
|
||||
<Name2>Ninten Jirou</Name2>
|
||||
<Tel2>075-662-9600</Tel2>
|
||||
<Fax2>075-662-9624</Fax2>
|
||||
<Mail2>jiro@nintendo.co.jp</Mail2>
|
||||
<NTSC2>ninten_jiro</NTSC2>
|
||||
<Region>-1</Region>
|
||||
<IsUnnecessaryRating>N</IsUnnecessaryRating>
|
||||
<RatingCERO>-1</RatingCERO>
|
||||
|
||||
@ -2,23 +2,23 @@
|
||||
<MasterEditorTWL>
|
||||
<Lang>J</Lang>
|
||||
<Form>
|
||||
<MasterEditorVersion>1.3</MasterEditorVersion>
|
||||
<MasterEditorVersion>1.4</MasterEditorVersion>
|
||||
<ProductName>Sample Game Name</ProductName>
|
||||
<ProductCode1>P</ProductCode1>
|
||||
<ProductCode2>KUGJ</ProductCode2>
|
||||
<ProductCode2>KGUJ</ProductCode2>
|
||||
<ProductNameForeign>Sample Game Name F</ProductNameForeign>
|
||||
<ProductCode1Foreign>P</ProductCode1Foreign>
|
||||
<ProductCode2Foreign1>0CZE</ProductCode2Foreign1>
|
||||
<ProductCode2Foreign2>0CZP</ProductCode2Foreign2>
|
||||
<ProductCode2Foreign3>0CZU</ProductCode2Foreign3>
|
||||
<ProductCode2Foreign1>KGUE</ProductCode2Foreign1>
|
||||
<ProductCode2Foreign2>KGUP</ProductCode2Foreign2>
|
||||
<ProductCode2Foreign3>KGUU</ProductCode2Foreign3>
|
||||
<SubmitVersion>0</SubmitVersion>
|
||||
<Backup>4</Backup>
|
||||
<ReleaseForeign>Y</ReleaseForeign>
|
||||
<Remarks>サンプルです。</Remarks>
|
||||
<SubmitWay>Mail</SubmitWay>
|
||||
<Purpose>Sale</Purpose>
|
||||
<ReleaseDate>2009/02/15 10:54:03</ReleaseDate>
|
||||
<SubmitDate>2009/01/21 10:54:03</SubmitDate>
|
||||
<ReleaseDate>2009/03/01 10:54:03</ReleaseDate>
|
||||
<SubmitDate>2009/04/30 10:54:03</SubmitDate>
|
||||
<Company1>任天堂株式会社</Company1>
|
||||
<Depart1>開発技術部</Depart1>
|
||||
<Name1>任天 太郎</Name1>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user