TwlToolsRED/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/check.cpp
nishikawa_takeshi dbade3505a 出力ファイルチェッカ:ファイル名を真値として比較するのではなく、単にSRLの中身を表示する仕様に変更。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@215 7061adef-622a-194b-ae81-725974e89856
2009-03-06 01:50:16 +00:00

95 lines
1.8 KiB
C++

#include "stdafx.h"
#include "check.h"
#include <common.h>
#include <twl/types.h>
#include <twl/os/common/format_rom.h>
#include <twl/os/common/ownerInfoEx.h>
using namespace System;
// ------------------------------------------------------------------
// デバッグ表示
// ------------------------------------------------------------------
static System::Boolean gbDebugPrint = false;
void setDebugPrint( System::Boolean b )
{
gbDebugPrint = b;
}
void DebugPrint( System::String ^fmt, ... cli::array<System::Object^> ^args )
{
if( gbDebugPrint )
{
Console::WriteLine( fmt, args );
}
}
// ------------------------------------------------------------------
// ROMヘッダ中の値の解釈
// ------------------------------------------------------------------
System::String^ getOgnString(int ogn)
{
System::String ^str = nullptr;
if( ogn == OS_TWL_PCTL_OGN_CERO )
{
str = "CERO";
}
else if( ogn == OS_TWL_PCTL_OGN_ESRB )
{
str = "ESRB";
}
else if( ogn == OS_TWL_PCTL_OGN_USK )
{
str = "USK";
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_GEN )
{
str = "PEGI";
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_PRT )
{
str = "PRT";
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_BBFC )
{
str = "BBFC";
}
else if( ogn == OS_TWL_PCTL_OGN_OFLC )
{
str = "OFLC";
}
//else if( ogn == OS_TWL_PCTL_OGN_GRB )
//{
// str = "GRB";
//}
else
{
str = "rsv.";
}
return str;
}
System::String^ getRatingString( u8 rating )
{
System::String ^str;
if( rating == 0 )
{
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
{
str = "Illegal";
}
return str;
}