マスターエディタ:ペアレンタルコントロール関連のバグ修正。GUIのソースがでかいのでを分割。

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlIPL/trunk@2516 b08762b0-b915-fc4b-9d8c-17b2551a87ff
This commit is contained in:
nishikawa_takeshi 2008-09-13 09:50:02 +00:00
parent 81267a0715
commit 2d717b1a61
20 changed files with 2891 additions and 3116 deletions

File diff suppressed because it is too large Load Diff

View File

@ -126,6 +126,24 @@
<metadata name="colLibName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="colLibName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>
<metadata name="colLibPublisher.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colLibName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colWarnName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colWarnBegin.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colWarnEnd.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colWarnCause.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colWarnName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="colWarnName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value> <value>True</value>
</metadata> </metadata>

View File

@ -0,0 +1,251 @@
// ----------------------------------------------
// マスタ書類情報(SRL影響なし)をフォームから取得
// ----------------------------------------------
#include "stdafx.h"
#include <apptype.h>
#include "common.h"
#include "srl.h"
#include "deliverable.h"
#include "crc_whole.h"
#include "utility.h"
#include "lang.h"
#include "FormError.h"
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MasterEditorTWL;
void Form1::setDeliverableProperties(void)
{
// 提出情報
this->hDeliv->hProductName = this->tboxProductName->Text;
this->hDeliv->hProductCode1 = this->tboxProductCode1->Text;
this->hDeliv->hProductCode2 = this->tboxProductCode2->Text;
this->hDeliv->hReleaseForeign = gcnew System::Boolean( this->cboxReleaseForeign->Checked );
if( this->cboxReleaseForeign->Checked == true )
{
this->hDeliv->hProductNameForeign = this->tboxProductNameForeign->Text;
this->hDeliv->hProductCode1Foreign = this->tboxProductCode1Foreign->Text;
this->hDeliv->hProductCode2Foreign = gcnew System::String("");
this->hDeliv->hProductCode2Foreign = this->tboxProductCode2Foreign1->Text;
if( !System::String::IsNullOrEmpty( this->tboxProductCode2Foreign2->Text ) )
{
this->hDeliv->hProductCode2Foreign += ("/" + this->tboxProductCode2Foreign2->Text);
}
if( !System::String::IsNullOrEmpty( this->tboxProductCode2Foreign2->Text ) )
{
this->hDeliv->hProductCode2Foreign += ("/" + this->tboxProductCode2Foreign3->Text);
}
}
else
{
this->hDeliv->hProductNameForeign = nullptr;
this->hDeliv->hProductCode1Foreign = nullptr;
this->hDeliv->hProductCode2Foreign = nullptr;
}
this->hDeliv->hReleaseYear = gcnew System::Int32( this->dateRelease->Value.Year );
this->hDeliv->hReleaseMonth = gcnew System::Int32( this->dateRelease->Value.Month );
this->hDeliv->hReleaseDay = gcnew System::Int32( this->dateRelease->Value.Day );
this->hDeliv->hSubmitYear = gcnew System::Int32( this->dateSubmit->Value.Year );
this->hDeliv->hSubmitMonth = gcnew System::Int32( this->dateSubmit->Value.Month );
this->hDeliv->hSubmitDay = gcnew System::Int32( this->dateSubmit->Value.Day );
this->hDeliv->hSubmitVersion = gcnew System::Int32( System::Decimal::ToInt32( this->numSubmitVersion->Value ) );
// SDK
this->hDeliv->hSDK = nullptr;
if( this->hSrl->hSDKList )
{
for each( RCSDKVersion ^sdk in this->hSrl->hSDKList ) // 書類には ARM9 static のバージョン情報を記入する
{
if( sdk->IsStatic )
this->hDeliv->hSDK = sdk->Version;
}
}
if( this->hDeliv->hSDK == nullptr )
{
this->hDeliv->hSDK = gcnew System::String( "Undefined" );
}
// 提出方法
if( this->rSubmitPost->Checked == true )
{
this->hDeliv->hSubmitWay = this->rSubmitPost->Text;
}
else
{
this->hDeliv->hSubmitWay = this->rSubmitHand->Text;
}
// 用途
if( this->rUsageSale->Checked == true )
{
this->hDeliv->hUsage = this->rUsageSale->Text;
this->hDeliv->hUsageOther = nullptr;
}
else if( this->rUsageSample->Checked == true )
{
this->hDeliv->hUsage = this->rUsageSample->Text;
this->hDeliv->hUsageOther = nullptr;
}
else if( this->rUsageDst->Checked == true )
{
this->hDeliv->hUsage = this->rUsageDst->Text;
this->hDeliv->hUsageOther = nullptr;
}
else if( this->rUsageOther->Checked == true )
{
this->hDeliv->hUsage = this->rUsageOther->Text;
this->hDeliv->hUsageOther = this->tboxUsageOther->Text;
}
// 会社情報
this->hDeliv->hCompany1 = this->tboxCompany1->Text + " " + this->tboxDepart1->Text;
this->hDeliv->hPerson1 = this->tboxPerson1->Text;
if( this->stripItemJapanese->Checked == true )
{
this->hDeliv->hFurigana1 = this->tboxFurigana1->Text;
}
else
{
this->hDeliv->hFurigana1 = nullptr;
}
this->hDeliv->hTel1 = this->tboxTel1->Text;
this->hDeliv->hFax1 = this->tboxFax1->Text;
this->hDeliv->hMail1 = this->tboxMail1->Text;
this->hDeliv->hNTSC1 = this->tboxNTSC1->Text;
if( this->cboxIsInputPerson2->Checked == true )
{
this->hDeliv->hCompany2 = this->tboxCompany2->Text + " " + this->tboxDepart2->Text;
this->hDeliv->hPerson2 = this->tboxPerson2->Text;
if( this->stripItemJapanese->Checked == true )
{
this->hDeliv->hFurigana2 = this->tboxFurigana2->Text;
}
else
{
this->hDeliv->hFurigana2 = nullptr;
}
this->hDeliv->hTel2 = this->tboxTel2->Text;
this->hDeliv->hFax2 = this->tboxFax2->Text;
this->hDeliv->hMail2 = this->tboxMail2->Text;
this->hDeliv->hNTSC2 = this->tboxNTSC2->Text;
}
else
{
this->hDeliv->hCompany2 = nullptr;
this->hDeliv->hPerson2 = nullptr;
this->hDeliv->hFurigana2 = nullptr;
this->hDeliv->hTel2 = nullptr;
this->hDeliv->hFax2 = nullptr;
this->hDeliv->hMail2 = nullptr;
this->hDeliv->hNTSC2 = nullptr;
}
// 備考
System::String ^tmp = this->tboxCaption->Text->Replace( " ", "" );
if( this->tboxCaption->Text->Equals("") || tmp->Equals("") ) // スペースのみの文字列は含めない
{
this->hDeliv->hCaption = nullptr;
}
else
{
this->hDeliv->hCaption = this->tboxCaption->Text;
}
// 備考欄に特殊な設定を追記
tmp = this->tboxCaptionEx->Text->Replace( " ", "" );
if( !(this->tboxCaptionEx->Text->Equals("")) && !(tmp->Equals("")) )
{
this->hDeliv->hCaption += ("(" + this->tboxCaptionEx->Text + ")");
}
// 一部のROM情報を登録
if( this->combBackup->SelectedIndex != (this->combBackup->Items->Count - 1) )
{
if( this->combBackup->SelectedIndex > 0 )
{
this->hDeliv->hBackupMemory = this->combBackup->SelectedItem->ToString();
}
else
{
this->hDeliv->hBackupMemory = gcnew System::String("");
}
}
else
{
this->hDeliv->hBackupMemory = this->tboxBackupOther->Text;
}
}
// ----------------------------------------------
// マスタ書類情報(SRL影響なし)のフォームチェック
// ----------------------------------------------
System::Boolean Form1::checkDeliverableForms(void)
{
// 不正な場合はダイアログで注意してreturn
// 提出情報
this->checkTextForm( this->tboxProductName->Text, LANG_PRODUCT_NAME_J, LANG_PRODUCT_NAME_E, false ); // SRL作成には問題のないエラー
this->checkTextForm( this->tboxProductCode1->Text, LANG_PRODUCT_CODE_J, LANG_PRODUCT_CODE_E, false );
this->checkTextForm( this->tboxProductCode2->Text, LANG_PRODUCT_CODE_J, LANG_PRODUCT_CODE_E, false );
if( this->cboxReleaseForeign->Checked == true )
{
this->checkTextForm( this->tboxProductNameForeign->Text, LANG_PRODUCT_NAME_F_J, LANG_PRODUCT_NAME_F_E, false );
this->checkTextForm( this->tboxProductCode1Foreign->Text, LANG_PRODUCT_CODE_F_J, LANG_PRODUCT_CODE_F_E, false );
this->checkTextForm( this->tboxProductCode2Foreign1->Text, LANG_PRODUCT_CODE_F_J, LANG_PRODUCT_CODE_F_E, false );
}
if( this->rUsageOther->Checked == true )
{
this->checkTextForm( this->tboxUsageOther->Text, LANG_USAGE_J, LANG_USAGE_E, false );
}
// 会社情報
this->checkTextForm( this->tboxPerson1->Text, LANG_PERSON_J, LANG_PERSON_E, false );
this->checkTextForm( this->tboxCompany1->Text, LANG_COMPANY_J, LANG_COMPANY_E, false );
this->checkTextForm( this->tboxDepart1->Text, LANG_DEPART_J, LANG_DEPART_E, false );
if( this->stripItemJapanese->Checked == true )
{
this->checkTextForm( this->tboxFurigana1->Text, LANG_FURIGANA_J, LANG_FURIGANA_J, false );
}
this->checkTextForm( this->tboxTel1->Text, LANG_TEL_J, LANG_TEL_E, false );
//this->checkTextForm( this->tboxFax1->Text, LANG_FAX_J, LANG_FAX_E, false );
this->checkTextForm( this->tboxMail1->Text, LANG_MAIL_J, LANG_MAIL_E, false );
//if( this->stripItemJapanese->Checked == true )
//{
// this->checkTextForm( this->tboxNTSC1->Text, LANG_NTSC_1_J + " " + LANG_NTSC_2_J, LANG_NTSC_1_J + " " + LANG_NTSC_2_J, false );
//}
if( this->cboxIsInputPerson2->Checked == true )
{
this->checkTextForm( this->tboxPerson2->Text, LANG_PERSON_J, LANG_PERSON_E, false );
this->checkTextForm( this->tboxCompany2->Text, LANG_COMPANY_J, LANG_COMPANY_E, false );
this->checkTextForm( this->tboxDepart2->Text, LANG_DEPART_J, LANG_DEPART_E, false );
if( this->stripItemJapanese->Checked == true )
{
this->checkTextForm( this->tboxFurigana2->Text, LANG_FURIGANA_J, LANG_FURIGANA_J, false );
}
this->checkTextForm( this->tboxTel2->Text, LANG_TEL_J, LANG_TEL_E, false );
//this->checkTextForm( this->tboxFax2->Text, LANG_FAX_J, LANG_FAX_E, false );
this->checkTextForm( this->tboxMail2->Text, LANG_MAIL_J, LANG_MAIL_E, false );
//if( this->stripItemJapanese->Checked == true )
//{
// this->checkTextForm( this->tboxNTSC2->Text, LANG_NTSC_1_J + " " + LANG_NTSC_2_J, LANG_NTSC_1_J + " " + LANG_NTSC_2_J, false );
//}
}
// 一部のROM情報(SRLバイナリに反映されない情報)をここでチェックする
this->checkBoxIndex( this->combBackup, LANG_BACKUP_J, LANG_BACKUP_E, false );
if( this->combBackup->SelectedIndex == (this->combBackup->Items->Count - 1) )
{
this->checkTextForm( this->tboxBackupOther->Text, LANG_BACKUP_J, LANG_BACKUP_E, false );
}
// ひととおりエラー登録をした後で
// 書類上のエラー(SRLバイナリには影響しない)が存在するかチェック
return this->isValidOnlyDeliverable();
}
// end of file

View File

@ -0,0 +1,221 @@
// ----------------------------------------------
// ファイルのR/W
// ----------------------------------------------
#include "stdafx.h"
#include <apptype.h>
#include "common.h"
#include "srl.h"
#include "deliverable.h"
#include "crc_whole.h"
#include "utility.h"
#include "lang.h"
#include "FormError.h"
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MasterEditorTWL;
// 設定ファイルの読み込み
void Form1::loadInit(void)
{
System::Xml::XmlDocument ^doc = gcnew System::Xml::XmlDocument();
// xmlファイルの読み込み
try
{
doc->Load( "../resource/ini.xml" );
}
catch( System::IO::FileNotFoundException ^s )
{
(void)s;
this->sucMsg( "設定ファイルを開くことができませんでした。", "Setting file can't be opened." );
return;
}
// <init>タグ : ルート
System::Xml::XmlElement ^root = doc->DocumentElement;
// <rw>タグ
System::Boolean bReadOnly = MasterEditorTWL::isXmlEqual( root, "rw", "r" );
if( bReadOnly )
{
this->readOnly();
}
// <output>タグ
System::Boolean bXML = MasterEditorTWL::isXmlEqual( root, "output", "XML" );
// <spcheck>タグ
System::Boolean bCheck = MasterEditorTWL::isXmlEqual( root, "spcheck", "ON" );
if( bCheck ) // チェックするときのみ追加チェック項目を設定
{
// チェックするかどうか
this->hSrl->hMrcSpecialList->hIsCheck = gcnew System::Boolean( true );
// SDK
try
{
u32 major = System::UInt32::Parse( MasterEditorTWL::getXPathText( root, "/init/sdk/major" ) );
u32 minor = System::UInt32::Parse( MasterEditorTWL::getXPathText( root, "/init/sdk/minor" ) );
u32 relstep = System::UInt32::Parse( MasterEditorTWL::getXPathText( root, "/init/sdk/relstep" ) );
u32 sdkver = (major << 24) | (minor << 16) | (relstep & 0xFFFF);
this->hSrl->hMrcSpecialList->hSDKVer = gcnew System::UInt32( sdkver );
}
catch ( System::Exception ^ex )
{
(void)ex;
this->errMsg( "設定ファイル中のSDKバージョンが読み込めませんでした。バージョンは0とみなされます。",
"SDK ver. can't be read from setting file. Therefore it is set by 0." );
this->hSrl->hMrcSpecialList->hSDKVer = gcnew System::UInt32( 0 );
}
// EULA
try
{
u8 eula = System::Byte::Parse( MasterEditorTWL::getXPathText( root, "/init/eula" ) );
this->hSrl->hMrcSpecialList->hEULAVer = gcnew System::Byte( eula );
}
catch ( System::Exception ^ex )
{
(void)ex;
this->errMsg( "設定ファイル中のEULAバージョンが読み込めませんでした。バージョンは0とみなされます。",
"EULA ver. can't be read from setting file. Therefore it is set by 0." );
this->hSrl->hMrcSpecialList->hEULAVer = gcnew System::Byte( 0 );
}
// Shared2File
try
{
System::Int32 i;
for( i=0; i < METWL_NUMOF_SHARED2FILES; i++ )
{
u8 size = System::UInt32::Parse( MasterEditorTWL::getXPathText( root, "/init/shared2/size" + i.ToString() ) );
this->hSrl->hMrcSpecialList->hShared2SizeArray[i] = gcnew System::UInt32( size );
}
}
catch ( System::Exception ^ex )
{
(void)ex;
this->errMsg( "設定ファイル中のShared2ファイルサイズが読み込めませんでした。サイズはすべて0とみなされます。",
"One of shared2 file sizes can't be read from setting file. Therefore they are set by 0." );
System::Int32 i;
for( i=0; i < METWL_NUMOF_SHARED2FILES; i++ )
{
this->hSrl->hMrcSpecialList->hShared2SizeArray[i] = gcnew System::UInt32( 0 );
}
}
} //if( bCheck )
if( bReadOnly || bXML | bCheck )
{
System::String ^msgJ = gcnew System::String("動作モード:");
System::String ^msgE = gcnew System::String("Processing Mode:");
if( bReadOnly )
{
msgJ += "\nリードオンリーモード";
msgE += "\nRead Only Mode";
}
if( bXML )
{
msgJ += "\nXML出力モード";
msgE += "\nXML Output Mode";
}
if( bCheck )
{
msgJ += "\n追加チェックモード";
msgE += "\nExtra Check Mode";
}
this->sucMsg( msgJ, msgE );
}
} // loadInit()
// SRLのオープン
System::Void Form1::loadSrl( System::String ^filename )
{
ECSrlResult result = this->hSrl->readFromFile( filename );
if( result != ECSrlResult::NOERROR )
{
switch( result )
{
case ECSrlResult::ERROR_PLATFORM:
this->errMsg( "本ツールはTWL対応ROM専用です。NTR専用ROMなどのTWL非対応ROMを読み込むことはできません。",
"This tool can only read TWL ROM. This can't read an other data e.g. NTR limited ROM." );
break;
case ECSrlResult::ERROR_SIGN_DECRYPT:
case ECSrlResult::ERROR_SIGN_VERIFY:
this->errMsg( "不正なROMデータです。TWL対応ROMでないかROMデータが改ざんされている可能性があります。",
"Illegal ROM data. It is not for TWL ROM, or is altered illegally." );
break;
default:
this->errMsg( "ROMデータファイルの読み込みに失敗しました。\n再度「ROMデータを開く」を選択してROMデータを読み出してください。",
"Reading the ROM data file failed. \nPlease read a ROM data file again, with \"Open a ROM data file\"" );
break;
}
return;
}
this->tboxFile->Text = filename;
// GUIにROM情報を格納
this->setSrlForms();
// 全体のCRCを算出
u16 crc;
if( !getWholeCRCInFile( filename, &crc ) )
{
this->errMsg( "ROMデータのCRC計算に失敗しました。ROMデータの読み込みはキャンセルされました。",
"Calculating CRC of the ROM data failed. Therefore reading ROM data is canceled." );
return;
}
System::UInt16 ^hcrc = gcnew System::UInt16( crc );
this->tboxWholeCRC->Clear();
this->tboxWholeCRC->AppendText( "0x" );
this->tboxWholeCRC->AppendText( hcrc->ToString("X") );
// 読み込み時エラーを登録する
this->rErrorReading->Checked = true;
this->setGridError();
this->setGridWarn();
//if( this->hSrl->hErrorList->Count > 0 )
//{
// this->errMsg( "ROMデータにエラーがあります。「エラー情報」タブをご確認ください。",
// "ROM data include error. Please look the tab \"Setting Error\"." );
// return;
//}
return;
} // loadSrl()
// SRLの保存
System::Void Form1::saveSrl( System::String ^filename )
{
// ROM情報をフォームから取得してSRLバイナリに反映させる
this->setSrlProperties();
// マスタ書類情報をフォームから取得して書類に反映させる -> 必要なし
//this->setDeliverableProperties();
// ファイルをコピー
if( !(filename->Equals( this->tboxFile->Text )) )
{
System::IO::File::Copy( this->tboxFile->Text, filename, true );
}
// コピーしたファイルにROMヘッダを上書き
if( this->hSrl->writeToFile( filename ) != ECSrlResult::NOERROR )
{
this->errMsg( "ROMデータの保存に失敗しました。", "Saving the ROM data file failed." );
return;
}
this->sucMsg( "ROMデータの保存が成功しました。", "Saving the ROM data file succeeded." );
this->tboxFile->Text = filename;
// 再リード
this->loadSrl( filename );
} // saveSrl()

View File

@ -0,0 +1,480 @@
// ----------------------------------------------
// 日英両対応
// ----------------------------------------------
#include "stdafx.h"
#include <apptype.h>
#include "common.h"
#include "srl.h"
#include "deliverable.h"
#include "crc_whole.h"
#include "utility.h"
#include "lang.h"
#include "FormError.h"
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MasterEditorTWL;
// 日本語版と英語版でテキストボックスの文字列制限が変わる
void Form1::changeMaxLength( System::Windows::Forms::TextBox ^tbox, System::Int32 maxlen )
{
if( tbox->Text->Length > maxlen )
tbox->Text = "";
tbox->MaxLength = maxlen;
}
// 日本語版への切り替え
void Form1::changeJapanese(void)
{
System::Int32 index;
// 入力文字数制限を変更する
this->changeMaxLength( this->tboxCompany1, 25 );
this->changeMaxLength( this->tboxDepart1, 25 );
this->changeMaxLength( this->tboxPerson1, 15 );
// タイトルバー
this->stripFile->Text = gcnew System::String( "ファイル" );
this->stripItemOpenRom->Text = gcnew System::String( "ROMデータを開く" );
this->stripItemSaveTemp->Text = gcnew System::String( "提出情報を一時保存する" );
this->stripItemLoadTemp->Text = gcnew System::String( "一時保存した提出情報を読み込む" );
this->stripMaster->Text = gcnew System::String( "マスター" );
this->stripItemSheet->Text = gcnew System::String( "提出確認書とマスターROMを作成する" );
this->stripItemMasterRom->Text = gcnew System::String( "マスターROMのみを作成する" );
// 入力ファイル
this->labFile->Text = gcnew System::String( "ROMデータファイル" );
// タブ
this->tabRomInfo->Text = gcnew System::String( "ROM基本情報(確認用)" );
this->tabTWLInfo->Text = gcnew System::String( "TWL拡張情報(確認用)" );
this->tabRomEditInfo->Text = gcnew System::String( "ROM登録情報(編集可)" );
this->tabSubmitInfo->Text = gcnew System::String( "提出情報(編集可)" );
this->tabCompanyInfo->Text = gcnew System::String( "会社情報(編集可)" );
this->tabErrorInfo->Text = gcnew System::String( "エラー情報(要修正)" );
// ガイド
this->tboxGuideRomInfo->Text = gcnew System::String( "このタブの情報は編集不可です。データに誤りがある場合にはROMデータの作成時の設定を見直してください。" );
this->tboxGuideTWLInfo->Text = gcnew System::String( "このタブの情報は編集不可です。データに誤りがある場合にはROMデータの作成時の設定を見直してください。" );
this->tboxGuideRomEditInfo->Text = gcnew System::String( "" );
this->tboxGuideRomEditInfo->Text += "このタブの情報は提出確認書およびマスターROMの作成に必要です。編集してください。";
this->tboxGuideRomEditInfo->Text += "\r\n(マスターROMの作成をするまでROMデータの中には登録されません。)";
this->tboxGuideSubmitInfo->Text = gcnew System::String( "このタブの情報は提出確認書の作成に必要です。入力してください。" );
this->tboxGuideCompanyInfo->Text = gcnew System::String( "このタブの情報は提出確認書の作成に必要です。入力してください。" );
this->tboxGuideErrorInfo->Text = gcnew System::String( "" );
this->tboxGuideErrorInfo->Text += "このタブには読み込んだROMデータの問題と本プログラムでの入力ミスが列挙されます。";
this->tboxGuideErrorInfo->Text += "\r\n赤文字の項目は、本プログラムで修正不可です。ROMデータ作成時の設定をご確認ください。";
this->tboxGuideErrorInfo->Text += "\r\n青文字の項目は、本プログラムで修正できますが、修正がマスターROMに反映されます。";
this->tboxGuideErrorInfo->Text += "\r\n黒文字の項目は、提出確認書にのみ反映され、マスターROMには反映されません。";
// SRL情報
this->gboxSrl->Text = gcnew System::String( "ROMデータ情報" );
this->labTitleName->Text = gcnew System::String( "ソフトタイトル" );
this->labGameCode->Text = gcnew System::String( "イニシャルコード" );
this->labMakerCode->Text = gcnew System::String( "メーカコード" );
this->labPlatform->Text = gcnew System::String( "プラットフォーム" );
this->labRomType->Text = gcnew System::String( "ROMタイプ設定" );
this->labRomSize->Text = gcnew System::String( "ROM容量" );
this->labRemasterVer->Text = gcnew System::String( "リマスターバージョン" );
this->cboxRemasterVerE->Text = gcnew System::String( "E(準備版)" );
this->labHeaderCRC->Text = gcnew System::String( "ヘッダCRC" );
this->labRomCRC->Text = gcnew System::String( "全体のCRC" );
index = this->combBackup->SelectedIndex;
// バックアップメモリ
this->gboxProd->Text = gcnew System::String( "ROM生産情報(必ず入力してください)" );
this->labBackup->Text = gcnew System::String( LANG_BACKUP_J );
this->combBackup->Items->Clear();
this->combBackup->Items->AddRange(gcnew cli::array< System::Object^ >(9) {L"4Kbit EEPROM", L"64Kbit EEPROM", L"512Kbit EEPROM",
L"256Kbit FRAM", L"2Mbit FLASH", L"4Mbit FLASH", L"8Mbit FLASH", L"なし", L"その他"});
this->combBackup->SelectedIndex = index;
// 提出情報
this->labProductName->Text = gcnew System::String( LANG_PRODUCT_NAME_J );
this->labProductCode->Text = gcnew System::String( LANG_PRODUCT_CODE_J );
this->labReleaseDate->Text = gcnew System::String( LANG_RELEASE_DATE_J );
this->labSubmiteDate->Text = gcnew System::String( LANG_SUBMIT_DATE_J );
this->gboxSubmitWay->Text = gcnew System::String( LANG_SUBMIT_WAY_J );
this->rSubmitPost->Text = gcnew System::String( LANG_SUBMIT_POST_J );
this->rSubmitHand->Text = gcnew System::String( LANG_SUBMIT_HAND_J );
this->gboxUsage->Text = gcnew System::String( LANG_USAGE_J );
this->rUsageSale->Text = gcnew System::String( LANG_USAGE_SALE_J );
this->rUsageSample->Text = gcnew System::String( LANG_USAGE_SAMPLE_J );
this->rUsageDst->Text = gcnew System::String( LANG_USAGE_DST_J );
this->rUsageOther->Text = gcnew System::String( LANG_USAGE_OTHER_J );
this->labSubmitVer->Text = gcnew System::String( LANG_SUBMIT_VER_J );
this->labCapSubmitVer->Text = gcnew System::String( LANG_SUBMIT_VER_CAP_J );
this->gboxForeign->Text = gcnew System::String( LANG_F_J );
this->labProductNameForeign->Text = gcnew System::String( LANG_PRODUCT_NAME_F_J );
this->labProductCodeForeign->Text = gcnew System::String( LANG_PRODUCT_CODE_F_J );
this->cboxReleaseForeign->Text = gcnew System::String( LANG_RELEASE_F_J );
this->labMultiForeign1->Text = gcnew System::String( LANG_MULTI_F_J );
this->labMultiForeign2->Text = gcnew System::String( LANG_MULTI_F_J );
this->labCaption->Text = gcnew System::String( LANG_CAPTION_J );
this->labProductNameLimit->Text = gcnew System::String( LANG_PRODUCT_LIMIT_J );
this->labProductNameLimitForeign->Text = gcnew System::String( LANG_PRODUCT_LIMIT_J );
// 会社情報
this->gboxPerson1->Text = gcnew System::String( LANG_PERSON_1_J );
this->gboxPerson2->Text = gcnew System::String( LANG_PERSON_2_J );
this->cboxIsInputPerson2->Text = gcnew System::String( LANG_INPUT_PERSON_2_J );
this->labCompany1->Text = gcnew System::String( LANG_COMPANY_J );
this->labDepart1->Text = gcnew System::String( LANG_DEPART_J );
this->labPerson1->Text = gcnew System::String( LANG_PERSON_J );
this->labCompany2->Text = gcnew System::String( LANG_COMPANY_J );
this->labDepart2->Text = gcnew System::String( LANG_DEPART_J );
this->labPerson2->Text = gcnew System::String( LANG_PERSON_J );
this->labArbit1->Text = gcnew System::String( "(任意)" );
this->labArbit2->Text = gcnew System::String( "(任意)" );
this->labArbit3->Text = gcnew System::String( "(任意)" );
this->labArbit4->Text = gcnew System::String( "(任意)" );
// ふりがな情報を有効にする
this->tboxFurigana1->Enabled = true;
this->labFurigana1->Text = gcnew System::String( LANG_FURIGANA_J );
this->tboxFurigana2->Enabled = true;
this->labFurigana2->Text = gcnew System::String( LANG_FURIGANA_J );
// NTSC-UserIDも日本語版のみ
this->tboxNTSC1->Enabled = true;
this->tboxNTSC2->Enabled = true;
this->labNTSC1Pre->Text = gcnew System::String( LANG_NTSC_1_J );
this->labNTSC1Sur->Text = gcnew System::String( LANG_NTSC_2_J );
this->labNTSC2Pre->Text = gcnew System::String( LANG_NTSC_1_J );
this->labNTSC2Sur->Text = gcnew System::String( LANG_NTSC_2_J );
// TWL仕様
this->gboxTWLExInfo->Text = gcnew System::String( "TWL拡張情報" );
this->labNormalRomOffset->Text = gcnew System::String( "TWLーマル領域ROMオフセット" );
this->labKeyTableRomOffset->Text = gcnew System::String( "TWL専用領域ROMオフセット" );
this->cboxIsNormalJump->Text = gcnew System::String( "ノーマルジャンプ許可" );
this->cboxIsTmpJump->Text = gcnew System::String( "tmpジャンプ許可" );
this->cboxIsSubBanner->Text = gcnew System::String( "サブバナーファイル有効" );
this->cboxIsWL->Text = gcnew System::String( "NTRホワイトリスト署名有効" );
this->gboxAccess->Text = gcnew System::String( "アクセスコントロール情報" );
this->cboxIsSD->Text = gcnew System::String( "SDカード" );
this->cboxIsNAND->Text = gcnew System::String( "NANDフラッシュメモリ" );
this->labIsGameCardOn->Text = gcnew System::String( "ゲームカード電源" );
this->labAccessOther->Text = gcnew System::String( "その他" );
this->gboxShared2Size->Text = gcnew System::String( "Shared2ファイルサイズ" );
this->cboxIsShared2->Text = gcnew System::String( "Shared2ファイル使用" );
this->labSDK->Text = gcnew System::String( "SDKバージョン" );
this->labLib->Text = gcnew System::String( "使用ライブラリ" );
this->labCaptionEx->Text = gcnew System::String( "特記事項" );
// SRL編集可能情報
this->cboxIsEULA->Text = gcnew System::String( LANG_EULA_J );
this->gboxIcon->Text = gcnew System::String( LANG_ICON_J );
this->rIsWirelessIcon->Text = gcnew System::String( LANG_WIRELESS_ICON_J );
this->rIsWiFiIcon->Text = gcnew System::String( LANG_WIFI_ICON_J );
this->rIsNoIcon->Text = gcnew System::String( LANG_NO_ICON_J );
this->labRegion->Text = gcnew System::String( LANG_REGION_J );
// リージョン
index = this->combRegion->SelectedIndex;
this->combRegion->Items->Clear();
this->combRegion->Items->AddRange(gcnew cli::array< System::Object^ >(5)
{L"日本のみ", L"米国のみ", L"欧州のみ", L"豪州のみ", L"欧州および豪州"});
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
this->combRegion->Items->Add( gcnew System::String( L"全リージョン" ) );
#endif
this->combRegion->SelectedIndex = index;
//// ペアレンタルコントロール
this->gboxParental->Text = gcnew System::String( LANG_REGION_PCTL_J );
this->labParentalRating->Text = gcnew System::String( LANG_PCTL_RATING_J );
index = this->combCERO->SelectedIndex; // いったんclearすると現在のindexに意味がなくなるので退避
this->combCERO->Items->Clear();
this->combCERO->Items->AddRange(gcnew cli::array< System::Object^ >(6)
{L"A (全年齢)", L"B (12歳以上)", L"C (15歳以上)", L"D (17歳以上)", L"Z (18歳以上)", L"審査中"});
this->combCERO->SelectedIndex = index;
index = this->combESRB->SelectedIndex;
this->combESRB->Items->Clear();
this->combESRB->Items->AddRange(gcnew cli::array< System::Object^ >(7)
{L"年齢制限なし", L"EC (3歳以上)", L"E (6歳以上)", L"E10+ (10歳以上)", L"T (13歳以上)", L"M (17歳以上)", L"審査中"});
this->combESRB->SelectedIndex = index;
index = this->combUSK->SelectedIndex;
this->combUSK->Items->Clear();
this->combUSK->Items->AddRange(gcnew cli::array< System::Object^ >(6)
{L"年齢制限なし", L"6歳以上", L"12歳以上", L"16歳以上", L"青少年には不適切", L"審査中"});
this->combUSK->SelectedIndex = index;
index = this->combPEGI->SelectedIndex;
this->combPEGI->Items->Clear();
this->combPEGI->Items->AddRange(gcnew cli::array< System::Object^ >(7)
{L"年齢制限なし", L"3歳以上", L"7歳以上", L"12歳以上", L"16歳以上", L"18歳以上", L"審査中"});
this->combPEGI->SelectedIndex = index;
index = this->combPEGI_PRT->SelectedIndex;
this->combPEGI_PRT->Items->Clear();
this->combPEGI_PRT->Items->AddRange(gcnew cli::array< System::Object^ >(7)
{L"年齢制限なし", L"4歳以上", L"6歳以上", L"12歳以上", L"16歳以上", L"18歳以上", L"審査中"});
this->combPEGI_PRT->SelectedIndex = index;
index = this->combPEGI_BBFC->SelectedIndex;
this->combPEGI_BBFC->Items->Clear();
this->combPEGI_BBFC->Items->AddRange(gcnew cli::array< System::Object^ >(10)
{L"年齢制限なし", L"3歳以上", L"4歳以上推奨", L"7歳以上", L"8歳以上推奨", L"12歳以上", L"15歳以上", L"16歳以上", L"18歳以上", L"審査中"});
this->combPEGI_BBFC->SelectedIndex = index;
index = this->combOFLC->SelectedIndex;
this->combOFLC->Items->Clear();
this->combOFLC->Items->AddRange(gcnew cli::array< System::Object^ >(6)
{L"年齢制限なし", L"G", L"PG", L"M", L"MA15+", L"審査中"});
this->combOFLC->SelectedIndex = index;
// エラー情報
this->labError->Text = gcnew System::String( "エラー(必ず修正してください。)" );
this->colErrorName->HeaderText = gcnew System::String( "項目名" );
this->colErrorBegin->HeaderText = gcnew System::String( "開始" );
this->colErrorEnd->HeaderText = gcnew System::String( "終了" );
this->colErrorCause->HeaderText = gcnew System::String( "要因" );
this->labWarn->Text = gcnew System::String( "警告(修正は必須ではありませんが情報に誤りがないかご確認ください。)" );
this->colWarnName->HeaderText = gcnew System::String( "項目名" );
this->colWarnBegin->HeaderText = gcnew System::String( "開始" );
this->colWarnEnd->HeaderText = gcnew System::String( "終了" );
this->colWarnCause->HeaderText = gcnew System::String( "要因" );
this->gboxErrorTiming->Text = gcnew System::String( "いつの情報を表示するか" );
this->rErrorReading->Text = gcnew System::String( "ROMデータ読み込み時" );
this->rErrorCurrent->Text = gcnew System::String( "現在の入力を反映" );
// 特殊な設定用のテキストボックスの表記を変更
this->setSrlFormsCaptionEx();
}
// 英語版への切り替え
void Form1::changeEnglish(void)
{
System::Int32 index;
// 入力文字数制限を変更する
this->changeMaxLength( this->tboxCompany1, 40 );
this->changeMaxLength( this->tboxDepart1, 40 );
this->changeMaxLength( this->tboxPerson1, 30 );
// タイトルバー
this->stripFile->Text = gcnew System::String( "File" );
this->stripItemOpenRom->Text = gcnew System::String( "Open a ROM data file" );
this->stripItemSaveTemp->Text = gcnew System::String( "Save a temporary info." );
this->stripItemLoadTemp->Text = gcnew System::String( "Load a temporary info. saved previously" );
this->stripMaster->Text = gcnew System::String( "Master" );
this->stripItemSheet->Text = gcnew System::String( "Make a submission sheet and a master ROM data file" );
this->stripItemMasterRom->Text = gcnew System::String( "Make a master ROM data file only" );
// 入力ファイル
this->labFile->Text = gcnew System::String( "ROM Data File" );
// タブ
this->tabRomInfo->Text = gcnew System::String( "ROM Info.(Read Only)" );
this->tabTWLInfo->Text = gcnew System::String( "TWL Info.(Read Only)" );
this->tabRomEditInfo->Text = gcnew System::String( "ROM Settings(Editable)" );
this->tabSubmitInfo->Text = gcnew System::String( "Submission Info.(Editable)" );
this->tabCompanyInfo->Text = gcnew System::String( "Company Info.(Editable)" );
this->tabErrorInfo->Text = gcnew System::String( "Setting Error" );
// ガイド
this->tboxGuideRomInfo->Text = gcnew System::String( "This tab is for checking ROM data. When ROM data is illegal, please check settings of building ROM data" );
this->tboxGuideTWLInfo->Text = gcnew System::String( "This tab is for checking ROM data. When ROM data is illegal, please check settings of building ROM data" );
this->tboxGuideRomEditInfo->Text = gcnew System::String( "" );
this->tboxGuideRomEditInfo->Text += "These items is necessary not only to make a submission sheet and but also to make a master ROM data. Please edit certainly.";
this->tboxGuideRomEditInfo->Text += "\r\n(In making a master ROM data, these info will be registered in it.)";
this->tboxGuideSubmitInfo->Text = gcnew System::String( "These items are necessary for making a submission sheet. Please input." );
this->tboxGuideCompanyInfo->Text = gcnew System::String( "These items are necessary for making a submission sheet. Please input." );
this->tboxGuideErrorInfo->Text = gcnew System::String( "" );
this->tboxGuideErrorInfo->Text += "This tab discribes errors in the ROM data file and edit mistakes.";
this->tboxGuideErrorInfo->Text += "\r\nItems highlighted by Red can't be modified by this program. Please modify build settings.";
this->tboxGuideErrorInfo->Text += "\r\nItems highlighted by Blue can be modified by this program and will register in a master ROM.";
this->tboxGuideErrorInfo->Text += "\r\nItems highlighted by Black are discribed in a submission sheet and aren't affect a master ROM.";
// SRL情報
this->gboxSrl->Text = gcnew System::String( "ROM Info." );
this->labTitleName->Text = gcnew System::String( "Game Title" );
this->labGameCode->Text = gcnew System::String( "Game Code" );
this->labMakerCode->Text = gcnew System::String( "Maker Code" );
this->labPlatform->Text = gcnew System::String( "Platform" );
this->labRomType->Text = gcnew System::String( "ROM Type" );
this->labRomSize->Text = gcnew System::String( "ROM Size" );
this->labRemasterVer->Text = gcnew System::String( "Release Ver." );
this->cboxRemasterVerE->Text = gcnew System::String( "E(Preliminary Ver.)" );
this->labHeaderCRC->Text = gcnew System::String( "Header CRC" );
this->labRomCRC->Text = gcnew System::String( "ROM CRC" );
index = this->combBackup->SelectedIndex;
// バックアップメモリ
this->gboxProd->Text = gcnew System::String( "ROM Production Info." );
this->labBackup->Text = gcnew System::String( LANG_BACKUP_E );
this->combBackup->Items->Clear();
this->combBackup->Items->AddRange(gcnew cli::array< System::Object^ >(9) {L"4Kbit EEPROM", L"64Kbit EEPROM", L"512Kbit EEPROM",
L"256Kbit FRAM", L"2Mbit FLASH", L"4Mbit FLASH", L"8Mbit FLASH", L"Nothing", L"Other"});
this->combBackup->SelectedIndex = index;
// 提出情報
this->labProductName->Text = gcnew System::String( LANG_PRODUCT_NAME_E );
this->labProductCode->Text = gcnew System::String( LANG_PRODUCT_CODE_E );
this->labReleaseDate->Text = gcnew System::String( LANG_RELEASE_DATE_E );
this->labSubmiteDate->Text = gcnew System::String( LANG_SUBMIT_DATE_E );
this->gboxSubmitWay->Text = gcnew System::String( LANG_SUBMIT_WAY_E );
this->rSubmitPost->Text = gcnew System::String( LANG_SUBMIT_POST_E );
this->rSubmitHand->Text = gcnew System::String( LANG_SUBMIT_HAND_E );
this->gboxUsage->Text = gcnew System::String( LANG_USAGE_E );
this->rUsageSale->Text = gcnew System::String( LANG_USAGE_SALE_E );
this->rUsageSample->Text = gcnew System::String( LANG_USAGE_SAMPLE_E );
this->rUsageDst->Text = gcnew System::String( LANG_USAGE_DST_E );
this->rUsageOther->Text = gcnew System::String( LANG_USAGE_OTHER_E );
this->labSubmitVer->Text = gcnew System::String( LANG_SUBMIT_VER_E );
this->labCapSubmitVer->Text = gcnew System::String( LANG_SUBMIT_VER_CAP_E );
this->gboxForeign->Text = gcnew System::String( LANG_F_E );
this->labProductNameForeign->Text = gcnew System::String( LANG_PRODUCT_NAME_F_E );
this->labProductCodeForeign->Text = gcnew System::String( LANG_PRODUCT_CODE_F_E );
this->cboxReleaseForeign->Text = gcnew System::String( LANG_RELEASE_F_E );
this->labMultiForeign1->Text = gcnew System::String( LANG_MULTI_F_E );
this->labMultiForeign2->Text = gcnew System::String( LANG_MULTI_F_E );
this->labCaption->Text = gcnew System::String( LANG_CAPTION_E );
this->labProductNameLimit->Text = gcnew System::String( LANG_PRODUCT_LIMIT_E );
this->labProductNameLimitForeign->Text = gcnew System::String( LANG_PRODUCT_LIMIT_E );
// 会社情報
this->gboxPerson1->Text = gcnew System::String( LANG_PERSON_1_E );
this->gboxPerson2->Text = gcnew System::String( LANG_PERSON_2_E );
this->cboxIsInputPerson2->Text = gcnew System::String( LANG_INPUT_PERSON_2_E );
this->labCompany1->Text = gcnew System::String( LANG_COMPANY_E );
this->labDepart1->Text = gcnew System::String( LANG_DEPART_E );
this->labPerson1->Text = gcnew System::String( LANG_PERSON_E );
this->labCompany2->Text = gcnew System::String( LANG_COMPANY_E );
this->labDepart2->Text = gcnew System::String( LANG_DEPART_E );
this->labPerson2->Text = gcnew System::String( LANG_PERSON_E );
this->labArbit1->Text = gcnew System::String( "(Arbitrary)" );
this->labArbit2->Text = gcnew System::String( "(Arbitrary)" );
this->labArbit3->Text = gcnew System::String( "(Arbitrary)" );
this->labArbit4->Text = gcnew System::String( "(Arbitrary)" );
// ふりがな情報を削除
this->tboxFurigana1->Clear();
this->tboxFurigana1->Enabled = false;
this->labFurigana1->Text = gcnew System::String( LANG_FURIGANA_E );
this->tboxFurigana2->Clear();
this->tboxFurigana2->Enabled = false;
this->labFurigana2->Text = gcnew System::String( LANG_FURIGANA_E );
this->tboxNTSC1->Enabled = false;
this->tboxNTSC1->Text = gcnew System::String("");
this->tboxNTSC2->Enabled = false;
this->tboxNTSC2->Text = gcnew System::String("");
this->labNTSC1Pre->Text = gcnew System::String( LANG_NTSC_1_E );
this->labNTSC1Sur->Text = gcnew System::String( LANG_NTSC_2_E );
this->labNTSC2Pre->Text = gcnew System::String( LANG_NTSC_1_E );
this->labNTSC2Sur->Text = gcnew System::String( LANG_NTSC_2_E );
// TWL仕様
this->gboxTWLExInfo->Text = gcnew System::String( "TWL Extended Info" );
this->labNormalRomOffset->Text = gcnew System::String( "TWL Normal Area ROM Offset" );
this->labKeyTableRomOffset->Text = gcnew System::String( "TWL Secure Area ROM Offset" );
this->cboxIsNormalJump->Text = gcnew System::String( "Enable Normal App. Jump" );
this->cboxIsTmpJump->Text = gcnew System::String( "Enable Temp. App. Jump" );
this->cboxIsSubBanner->Text = gcnew System::String( "Enable SubBanner File" );
this->cboxIsWL->Text = gcnew System::String( "Enable NTR WhiteList Signature" );
this->gboxAccess->Text = gcnew System::String( "Access Control" );
this->cboxIsSD->Text = gcnew System::String( "SD Card" );
this->cboxIsNAND->Text = gcnew System::String( "NAND Flash Memory" );
this->labIsGameCardOn->Text = gcnew System::String( "Card Power" );
this->labAccessOther->Text = gcnew System::String( "Others" );
this->gboxShared2Size->Text = gcnew System::String( "Size of Shared2 Files" );
this->cboxIsShared2->Text = gcnew System::String( "Use Shared2 Files" );
this->labSDK->Text = gcnew System::String( "SDK Ver." );
this->labLib->Text = gcnew System::String( "Libraries used by the program" );
this->labCaptionEx->Text = gcnew System::String( "Special Note" );
// SRL編集可能情報
this->cboxIsEULA->Text = gcnew System::String( LANG_EULA_E );
this->gboxIcon->Text = gcnew System::String( LANG_ICON_E );
this->rIsWirelessIcon->Text = gcnew System::String( LANG_WIRELESS_ICON_E );
this->rIsWiFiIcon->Text = gcnew System::String( LANG_WIFI_ICON_E );
this->rIsNoIcon->Text = gcnew System::String( LANG_NO_ICON_E );
this->labRegion->Text = gcnew System::String( LANG_REGION_E );
// リージョン
index = this->combRegion->SelectedIndex;
this->combRegion->Items->Clear();
this->combRegion->Items->AddRange(gcnew cli::array< System::Object^ >(5)
{L"Japan Only", L"USA Only", L"Europe Only", L"Australia Only", L"Europe and Australia"});
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
this->combRegion->Items->Add( gcnew System::String( L"All Region" ) );
#endif
this->combRegion->SelectedIndex = index;
//// ペアレンタルコントロール
this->gboxParental->Text = gcnew System::String( LANG_REGION_PCTL_E );
this->labParentalRating->Text = gcnew System::String( LANG_PCTL_RATING_E );
index = this->combCERO->SelectedIndex; // いったんclearすると現在のindexに意味がなくなるので退避
this->combCERO->Items->Clear();
this->combCERO->Items->AddRange(gcnew cli::array< System::Object^ >(6)
{L"A (All ages)", L"B (aged 12 or older)", L"C (aged 15 or older)", L"D (aged 17 or older)", L"Z (aged 18 or older)", L"Rating Pending"});
this->combCERO->SelectedIndex = index;
index = this->combESRB->SelectedIndex;
this->combESRB->Items->Clear();
this->combESRB->Items->AddRange(gcnew cli::array< System::Object^ >(7)
{L"All ages", L"EC (aged 3 or older)", L"E (aged 6 or older)", L"E10+ (aged 10 or older)", L"T (aged 13 or older)", L"M (aged 17 or older)", L"Rating Pending"});
this->combESRB->SelectedIndex = index;
index = this->combUSK->SelectedIndex;
this->combUSK->Items->Clear();
this->combUSK->Items->AddRange(gcnew cli::array< System::Object^ >(6)
{L"All ages", L"aged 6 or older", L"aged 12 or older", L"aged 16 or older", L"Inadequent for young", L"Rating Pending"});
this->combUSK->SelectedIndex = index;
index = this->combPEGI->SelectedIndex;
this->combPEGI->Items->Clear();
this->combPEGI->Items->AddRange(gcnew cli::array< System::Object^ >(7)
{L"All ages", L"aged 3 or older", L"aged 7 or older", L"aged 12 or older", L"aged 16 or older", L"aged 18 or older", L"Rating Pending"});
this->combPEGI->SelectedIndex = index;
index = this->combPEGI_PRT->SelectedIndex;
this->combPEGI_PRT->Items->Clear();
this->combPEGI_PRT->Items->AddRange(gcnew cli::array< System::Object^ >(7)
{L"All ages", L"aged 4 or older", L"aged 6 or older", L"aged 12 or older", L"aged 16 or older", L"aged 18 or older", L"Rating Pending"});
this->combPEGI_PRT->SelectedIndex = index;
index = this->combPEGI_BBFC->SelectedIndex;
this->combPEGI_BBFC->Items->Clear();
this->combPEGI_BBFC->Items->AddRange(gcnew cli::array< System::Object^ >(10)
{L"All ages", L"aged 3 or older", L"aged 4 or older recommended", L"aged 7 or older", L"aged 8 or older recommended",
L"aged 12 or older", L"aged 15 or older", L"aged 16 or older", L"aged 18 or older", L"Rating Pending"});
this->combPEGI_BBFC->SelectedIndex = index;
index = this->combOFLC->SelectedIndex;
this->combOFLC->Items->Clear();
this->combOFLC->Items->AddRange(gcnew cli::array< System::Object^ >(6)
{L"All ages", L"G", L"PG", L"M", L"MA15+", L"Rating Pending"});
this->combOFLC->SelectedIndex = index;
// エラー情報
this->labError->Text = gcnew System::String( "Error Information(Modification is necessary.)" );
this->colErrorName->HeaderText = gcnew System::String( "Name" );
this->colErrorBegin->HeaderText = gcnew System::String( "Begin" );
this->colErrorEnd->HeaderText = gcnew System::String( "End" );
this->colErrorCause->HeaderText = gcnew System::String( "Reason" );
this->labWarn->Text = gcnew System::String( "Warning(Modification is not necessary. Please check validity of these information.)" );
this->colWarnName->HeaderText = gcnew System::String( "Name" );
this->colWarnBegin->HeaderText = gcnew System::String( "Begin" );
this->colWarnEnd->HeaderText = gcnew System::String( "End" );
this->colWarnCause->HeaderText = gcnew System::String( "Reason" );
this->gboxErrorTiming->Text = gcnew System::String( "Error Of Timing" );
this->rErrorReading->Text = gcnew System::String( "When ROM data was read" );
this->rErrorCurrent->Text = gcnew System::String( "In current settings" );
// 特殊な設定用のテキストボックスの表記を変更
this->setSrlFormsCaptionEx();
}
// end of file

View File

@ -0,0 +1,187 @@
// ---------------------------------------------------------------------
// ペアレンタルコントロール設定は複雑なので外部ファイルに切り出す
// ---------------------------------------------------------------------
#include "stdafx.h"
#include <apptype.h>
#include "common.h"
#include "srl.h"
#include "deliverable.h"
#include "crc_whole.h"
#include "utility.h"
#include "lang.h"
#include "FormError.h"
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MasterEditorTWL;
// フォーム入力をSRLに反映させる
void Form1::setParentalSrlProperties(void)
{
// 各団体のフォーム入力を反映
this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_CERO ] = this->combCERO->SelectedIndex;
this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_ESRB ] = this->combESRB->SelectedIndex;
this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_USK ] = this->combUSK->SelectedIndex;
this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_PEGI_GEN ] = this->combPEGI->SelectedIndex;
this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_PEGI_PRT ] = this->combPEGI_PRT->SelectedIndex;
this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_PEGI_BBFC ] = this->combPEGI_BBFC->SelectedIndex;
this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_OFLC ] = this->combOFLC->SelectedIndex;
} //setParentalSrlProperties()
// SRL内のペアレンタルコントロール情報を抜き出してフォームに反映させる
void Form1::setParentalForms(void)
{
// 各団体のコンボボックスのインデックスを設定
this->combCERO->SelectedIndex = this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_CERO ];
this->combESRB->SelectedIndex = this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_ESRB ];
this->combUSK->SelectedIndex = this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_USK ];
this->combPEGI->SelectedIndex = this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_PEGI_GEN ];
this->combPEGI_PRT->SelectedIndex = this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_PEGI_PRT ];
this->combPEGI_BBFC->SelectedIndex = this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_PEGI_BBFC ];
this->combOFLC->SelectedIndex = this->hSrl->hArrayParentalIndex[ OS_TWL_PCTL_OGN_OFLC ];
} //setParentalForms()
// リージョン情報からペアレンタルコントロールの編集可能団体をマスクする
void Form1::maskParentalForms(void)
{
this->enableParental( this->combCERO, this->labCERO, nullptr );
this->enableParental( this->combESRB, this->labESRB, nullptr );
this->enableParental( this->combUSK, this->labUSK, nullptr );
this->enableParental( this->combPEGI, this->labPEGI, nullptr );
this->enableParental( this->combPEGI_PRT, this->labPEGI_PRT, nullptr );
this->enableParental( this->combPEGI_BBFC, this->labPEGI_BBFC, nullptr );
this->enableParental( this->combOFLC, this->labOFLC, nullptr );
switch( this->combRegion->SelectedIndex )
{
case 0:
// 日本
this->enableParental( this->combCERO, this->labCERO, nullptr );
this->disableParental( this->combESRB, this->labESRB, nullptr );
this->disableParental( this->combUSK, this->labUSK, nullptr );
this->disableParental( this->combPEGI, this->labPEGI, nullptr );
this->disableParental( this->combPEGI_PRT, this->labPEGI_PRT, nullptr );
this->disableParental( this->combPEGI_BBFC, this->labPEGI_BBFC, nullptr );
this->disableParental( this->combOFLC, this->labOFLC, nullptr );
break;
case 1:
// 米国
this->disableParental( this->combCERO, this->labCERO, nullptr );
this->enableParental( this->combESRB, this->labESRB, nullptr );
this->disableParental( this->combUSK, this->labUSK, nullptr );
this->disableParental( this->combPEGI, this->labPEGI, nullptr );
this->disableParental( this->combPEGI_PRT, this->labPEGI_PRT, nullptr );
this->disableParental( this->combPEGI_BBFC, this->labPEGI_BBFC, nullptr );
this->disableParental( this->combOFLC, this->labOFLC, nullptr );
break;
case 2:
// 欧州
this->disableParental( this->combCERO, this->labCERO, nullptr );
this->disableParental( this->combESRB, this->labESRB, nullptr );
this->enableParental( this->combUSK, this->labUSK, nullptr );
this->enableParental( this->combPEGI, this->labPEGI, nullptr );
this->enableParental( this->combPEGI_PRT, this->labPEGI_PRT, nullptr );
this->enableParental( this->combPEGI_BBFC, this->labPEGI_BBFC, nullptr );
this->disableParental( this->combOFLC, this->labOFLC, nullptr );
break;
case 3:
// 豪州
this->disableParental( this->combCERO, this->labCERO, nullptr );
this->disableParental( this->combESRB, this->labESRB, nullptr );
this->disableParental( this->combUSK, this->labUSK, nullptr );
this->disableParental( this->combPEGI, this->labPEGI, nullptr );
this->disableParental( this->combPEGI_PRT, this->labPEGI_PRT, nullptr );
this->disableParental( this->combPEGI_BBFC, this->labPEGI_BBFC, nullptr );
this->enableParental( this->combOFLC, this->labOFLC, nullptr );
break;
case 4:
// 欧州と豪州
this->disableParental( this->combCERO, this->labCERO, nullptr );
this->disableParental( this->combESRB, this->labESRB, nullptr );
this->enableParental( this->combUSK, this->labUSK, nullptr );
this->enableParental( this->combPEGI, this->labPEGI, nullptr );
this->enableParental( this->combPEGI_PRT, this->labPEGI_PRT, nullptr );
this->enableParental( this->combPEGI_BBFC, this->labPEGI_BBFC, nullptr );
this->enableParental( this->combOFLC, this->labOFLC, nullptr );
break;
// 全リージョンのときは何もdisableにしない
default:
break;
}
} //maskParentalForms()
// ペアレンタルコントロール関連のフォーム入力が正しいか書き込み前チェック
void Form1::checkParentalForms( System::Boolean inRegion, System::Windows::Forms::ComboBox ^comb, System::String ^msg )
{
// リージョンに含まれていないとき: 0クリアが保証されるのでチェック必要なし
if( !inRegion )
return;
// 設定されていないときエラー
if( (comb->SelectedIndex < 0) || (comb->SelectedIndex >= comb->Items->Count) )
{
this->hErrorList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
msg + ": レーティングを選択してください。",
"Parental Control",
msg + ": Rating Pending is setting. When rating age is examined, Please submit again.", true, true ) );
}
// 審査中のとき警告
if( comb->SelectedIndex == (comb->Items->Count - 1) )
{
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
msg + ": 審査中指定がされています。審査が決まりしだい、再提出してください。",
"Parental Control", msg + ": Save ROM data as Game soft which needs rating examinination.", true, true ) );
}
} //checkParentalForms()
// ペアレンタルコントロール情報をクリアする
void Form1::clearParental( System::Windows::Forms::ComboBox ^comb )
{
comb->SelectedIndex = -1; // 空白にする
}
// ペアレンタルコントロール情報を編集できるようにする
void Form1::enableParental( System::Windows::Forms::ComboBox ^comb,
System::Windows::Forms::Label ^lab1,
System::Windows::Forms::Label ^lab2 )
{
comb->Enabled = true;
comb->Visible = true;
lab1->Visible = true;
if( lab2 != nullptr )
{
lab2->Visible = true;
}
}
// ペアレンタルコントロール情報を編集できなくする
void Form1::disableParental( System::Windows::Forms::ComboBox ^comb,
System::Windows::Forms::Label ^lab1,
System::Windows::Forms::Label ^lab2 )
{
this->clearParental( comb );
comb->Enabled = false;
comb->Visible = false;
lab1->Visible = false;
if( lab2 != nullptr )
{
lab2->Visible = false;
}
}
// end of file

View File

@ -0,0 +1,369 @@
// ----------------------------------------------
// フォームとSRL内情報とのデータのやりとり
// ----------------------------------------------
#include "stdafx.h"
#include <apptype.h>
#include "common.h"
#include "srl.h"
#include "deliverable.h"
#include "crc_whole.h"
#include "utility.h"
#include "lang.h"
#include "FormError.h"
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MasterEditorTWL;
// ROM情報をフォームから取得してSRLクラスのプロパティに反映させる
// (ROMヘッダへの反映やCRCと署名の再計算をしない)
void Form1::setSrlProperties(void)
{
// ROMヘッダの[0,0x160)の領域はRead Onlyで変更しない
// TWL拡張領域のいくつかの情報をROMヘッダに反映させる
this->hSrl->hIsEULA = this->cboxIsEULA->Checked;
this->hSrl->hIsWiFiIcon = this->rIsWiFiIcon->Checked;
this->hSrl->hIsWirelessIcon = this->rIsWirelessIcon->Checked;
// リージョン
this->hSrl->hIsRegionJapan = gcnew System::Boolean(false);
this->hSrl->hIsRegionAmerica = gcnew System::Boolean(false);
this->hSrl->hIsRegionEurope = gcnew System::Boolean(false);
this->hSrl->hIsRegionAustralia = gcnew System::Boolean(false);
switch( this->combRegion->SelectedIndex )
{
case 0:
this->hSrl->hIsRegionJapan = gcnew System::Boolean(true);
break;
case 1:
this->hSrl->hIsRegionAmerica = gcnew System::Boolean(true);
break;
case 2:
this->hSrl->hIsRegionEurope = gcnew System::Boolean(true);
break;
case 3:
this->hSrl->hIsRegionAustralia = gcnew System::Boolean(true);
break;
case 4:
this->hSrl->hIsRegionEurope = gcnew System::Boolean(true);
this->hSrl->hIsRegionAustralia = gcnew System::Boolean(true);
break;
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
case 5:
this->hSrl->hIsRegionJapan = gcnew System::Boolean(true);
this->hSrl->hIsRegionAmerica = gcnew System::Boolean(true);
this->hSrl->hIsRegionEurope = gcnew System::Boolean(true);
this->hSrl->hIsRegionAustralia = gcnew System::Boolean(true);
break;
#endif //defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
default:
break;
}
// ペアレンタルコントロール
this->setParentalSrlProperties();
} //setSrlProperties()
// SRLのROM情報をフォームに反映させる(ファイルが読み込まれていることが前提)
void Form1::setSrlForms(void)
{
// NTR互換情報
this->tboxTitleName->Text = this->hSrl->hTitleName;
this->tboxGameCode->Text = this->hSrl->hGameCode;
this->tboxMakerCode->Text = this->hSrl->hMakerCode;
this->tboxPlatform->Text = this->hSrl->hPlatform;
this->tboxRomSize->Text = this->hSrl->hRomSize;
this->tboxRomLatency->Text = this->hSrl->hLatency;
if( *(this->hSrl->hRomVersion) == 0xE0 )
{
this->tboxRemasterVer->Text = gcnew System::String("E");
this->cboxRemasterVerE->Checked = true;
}
else
{
this->tboxRemasterVer->Text = this->hSrl->hRomVersion->ToString();
this->cboxRemasterVerE->Checked = false;
}
this->tboxHeaderCRC->Clear();
this->tboxHeaderCRC->AppendText( "0x" );
this->tboxHeaderCRC->AppendText( this->hSrl->hHeaderCRC->ToString("X") );
if( this->hSrl->hPlatform == nullptr )
{
this->errMsg( "プラットホーム指定が不正です。ROMデータのビルド設定を見直してください。",
"Illegal Platform: Please check build settings of the ROM data.");
}
// TWL拡張情報
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");
this->tboxPublicSize->Text = MasterEditorTWL::transSizeToString( this->hSrl->hPublicSize );
this->tboxPrivateSize->Text = MasterEditorTWL::transSizeToString( this->hSrl->hPrivateSize );
this->cboxIsNormalJump->Checked = *(this->hSrl->hIsNormalJump);
this->cboxIsTmpJump->Checked = *(this->hSrl->hIsTmpJump);
this->cboxIsSubBanner->Checked = *(this->hSrl->hIsSubBanner);
this->cboxIsWL->Checked = *(this->hSrl->hIsWL);
if( *(this->hSrl->hIsCodecTWL) == true )
{
this->tboxIsCodec->Text = gcnew System::String( "TWL" );
}
else
{
this->tboxIsCodec->Text = gcnew System::String( "NTR" );
}
this->cboxIsSD->Checked = *(this->hSrl->hIsSD);
this->cboxIsNAND->Checked = *(this->hSrl->hIsNAND);
if( *(this->hSrl->hIsGameCardNitro) == true )
{
this->tboxIsGameCardOn->Text = gcnew System::String( "ON(NTR)" );
}
else if( *(this->hSrl->hIsGameCardOn) == true )
{
this->tboxIsGameCardOn->Text = gcnew System::String( "ON(normal)" );
}
else
{
this->tboxIsGameCardOn->Text = gcnew System::String( "OFF" );
}
this->cboxIsShared2->Checked = *(this->hSrl->hIsShared2);
this->tboxShared2Size0->Text = MasterEditorTWL::transSizeToString( this->hSrl->hShared2SizeArray[0] );
this->tboxShared2Size1->Text = MasterEditorTWL::transSizeToString( this->hSrl->hShared2SizeArray[1] );
this->tboxShared2Size2->Text = MasterEditorTWL::transSizeToString( this->hSrl->hShared2SizeArray[2] );
this->tboxShared2Size3->Text = MasterEditorTWL::transSizeToString( this->hSrl->hShared2SizeArray[3] );
this->tboxShared2Size4->Text = MasterEditorTWL::transSizeToString( this->hSrl->hShared2SizeArray[4] );
this->tboxShared2Size5->Text = MasterEditorTWL::transSizeToString( this->hSrl->hShared2SizeArray[5] );
// アプリ種別
if( *this->hSrl->hIsMediaNand )
{
this->tboxMedia->Text = gcnew System::String( "NAND" );
}
else
{
this->tboxMedia->Text = gcnew System::String( "Game Card" );
}
if( *(this->hSrl->hIsAppLauncher) == true )
{
this->tboxAppType->Text = gcnew System::String( "Launcher" );
}
else if( *(this->hSrl->hIsAppSecure) == true )
{
this->tboxAppType->Text = gcnew System::String( "Secure" );
}
else if( *(this->hSrl->hIsAppSystem) == true )
{
this->tboxAppType->Text = gcnew System::String( "System" );
}
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 )
{
appother += "Not-Launch.\r\n";
}
if( *(this->hSrl->hIsDataOnly) == true )
{
appother += "DataOnly.\r\n";
}
this->tboxAppTypeOther->Text = appother;
// アクセスコントロール その他
System::String ^acc = gcnew System::String("");
if( *(this->hSrl->hIsCommonClientKey) == true )
{
acc += "commonClientKey.\r\n";
}
if( *(this->hSrl->hIsAesSlotBForES) == true )
{
acc += "AES-SlotB(ES).\r\n";
}
if( *(this->hSrl->hIsAesSlotCForNAM) == true )
{
acc += "AES-SlotC(NAM).\r\n";
}
if( *(this->hSrl->hIsAesSlotBForJpegEnc) == true )
{
acc += "AES-SlotB(JpegEnc.).\r\n";
}
if( *(this->hSrl->hIsAesSlotAForSSL) == true )
{
acc += "AES-SlotA(SSL).\r\n";
}
if( *(this->hSrl->hIsCommonClientKeyForDebugger) == true )
{
acc += "commonClientKey(Debug.).\r\n";
}
this->tboxAccessOther->Text = acc;
// 特殊な設定をテキストボックスに反映
this->setSrlFormsCaptionEx();
// SDKバージョンとライブラリ
this->tboxSDK->Clear();
if( this->hSrl->hSDKList != nullptr )
{
for each( RCSDKVersion ^ver in this->hSrl->hSDKList )
{
if( ver->IsStatic )
this->tboxSDK->Text += ver->Version + " (main static)\r\n";
else
this->tboxSDK->Text += ver->Version + "\r\n";
}
}
this->gridLibrary->Rows->Clear();
if( this->hSrl->hLicenseList != nullptr )
{
for each( RCLicense ^lic in this->hSrl->hLicenseList )
{
this->gridLibrary->Rows->Add( gcnew cli::array<System::Object^>{lic->Publisher, lic->Name} );
}
}
// 編集可能情報
this->cboxIsEULA->Checked = *(this->hSrl->hIsEULA);
if( ( *this->hSrl->hIsWiFiIcon && *this->hSrl->hIsWirelessIcon) ||
(!(*this->hSrl->hIsWiFiIcon) && !(*this->hSrl->hIsWirelessIcon)) )
{
this->rIsNoIcon->Checked = true;
}
else if( *(this->hSrl->hIsWiFiIcon) && !*(this->hSrl->hIsWirelessIcon) )
{
this->rIsWiFiIcon->Checked = true;
}
else
{
this->rIsWirelessIcon->Checked = true;
}
System::Boolean isJapan = *(this->hSrl->hIsRegionJapan); // リージョン
System::Boolean isAmerica = *(this->hSrl->hIsRegionAmerica);
System::Boolean isEurope = *(this->hSrl->hIsRegionEurope);
System::Boolean isAustralia = *(this->hSrl->hIsRegionAustralia);
System::Int32 index;
if( isJapan && !isAmerica && !isEurope && !isAustralia )
index = 0;
else if( !isJapan && isAmerica && !isEurope && !isAustralia )
index = 1;
else if( !isJapan && !isAmerica && isEurope && !isAustralia )
index = 2;
else if( !isJapan && !isAmerica && !isEurope && isAustralia )
index = 3;
else if( !isJapan && !isAmerica && isEurope && isAustralia )
index = 4;
else
index = -1; // 不正
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
if( isJapan && isAmerica && isEurope && isAustralia )
index = 5;
#endif
this->combRegion->SelectedIndex = index;
this->maskParentalForms();
this->setParentalForms(); // ペアレンタルコントロール関連
} // setSrlForms()
// SRLの特殊な設定をフォームにセットする(言語切り替えで表示を変えたいので独立させる)
void Form1::setSrlFormsCaptionEx()
{
// 特殊な設定は備考欄に書き加えておく
this->tboxCaptionEx->Clear();
if( (this->hSrl->hHasDSDLPlaySign != nullptr) && (*(this->hSrl->hHasDSDLPlaySign) == true) )
{
if( this->stripItemJapanese->Checked == true )
this->tboxCaptionEx->Text += gcnew System::String( "DSクローンブート対応.\r\n" );
else
this->tboxCaptionEx->Text += gcnew System::String( "DS Clone Boot.\r\n" );
}
if( (this->hSrl->hIsSCFGAccess != nullptr) && (*(this->hSrl->hIsSCFGAccess) == true) )
{
if( this->stripItemJapanese->Checked == true )
this->tboxCaptionEx->Text += gcnew System::String( "SCFGレジスタアクセス可能.\r\n" );
else
this->tboxCaptionEx->Text += gcnew System::String( "SDFC Register Accessible.\r\n" );
}
} // setSrlFormsCaptionEx()
// フォームの入力をチェックする
System::Boolean Form1::checkSrlForms(void)
{
// リージョン
if( this->checkBoxIndex( this->combRegion, LANG_REGION_J, LANG_REGION_E, true ) == false )
return false;
// リージョンを決める
System::Boolean bJapan = false;
System::Boolean bAmerica = false;
System::Boolean bEurope = false;
System::Boolean bAustralia = false;
switch( this->combRegion->SelectedIndex )
{
case 0:
bJapan = true;
break;
case 1:
bAmerica = true;
break;
case 2:
bEurope = true;
break;
case 3:
bAustralia = true;
break;
case 4:
bEurope = true;
bAustralia = true;
break;
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
case 5:
bJapan = true;
bAmerica = true;
bEurope = true;
bAustralia = true;
break;
#endif
default:
break;
}
// ペアレンタルコントロール
this->checkParentalForms( bJapan, this->combCERO, this->labCERO->Text );
this->checkParentalForms( bAmerica, this->combESRB, this->labESRB->Text );
this->checkParentalForms( bEurope, this->combUSK, this->labUSK->Text );
this->checkParentalForms( bEurope, this->combPEGI, this->labPEGI->Text );
this->checkParentalForms( bEurope, this->combPEGI_PRT, this->labPEGI_PRT->Text );
this->checkParentalForms( bEurope, this->combPEGI_BBFC, this->labPEGI_BBFC->Text );
this->checkParentalForms( bAustralia, this->combOFLC, this->labOFLC->Text );
// ひととおりエラー登録をした後で
// SRLバイナリに影響を与えるエラーが存在するかチェック
#ifdef METWL_LIGHT_CHECK
return this->isValidAffectRomModified();
#else
return this->isValidAffectRom();
#endif
} // checkSrlForms()
// end of file

View File

@ -0,0 +1,342 @@
// ----------------------------------------------
// 一時ファイルの取り扱い
// ----------------------------------------------
#include "stdafx.h"
#include <apptype.h>
#include "common.h"
#include "srl.h"
#include "deliverable.h"
#include "crc_whole.h"
#include "utility.h"
#include "lang.h"
#include "FormError.h"
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MasterEditorTWL;
// 一時保存
System::Void Form1::saveTmp( System::String ^filename )
{
System::Xml::XmlDocument ^doc = gcnew System::Xml::XmlDocument();
doc->AppendChild( doc->CreateXmlDeclaration("1.0","UTF-8",nullptr) );
System::Xml::XmlElement ^root = doc->CreateElement( "MasterEditorTWL" );
doc->AppendChild( root );
// SRLのパス
MasterEditorTWL::appendXmlTag( doc, root, "Srl", this->tboxFile->Text );
// 言語
MasterEditorTWL::appendXmlTag( doc, root, "Lang", (this->stripItemJapanese->Checked)?"J":"E" );
// フォーム
System::Xml::XmlElement ^form = doc->CreateElement( "Form" );
root->AppendChild( form );
MasterEditorTWL::appendXmlTag( doc, form, "ProductName", this->tboxProductName->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ProductCode1", this->tboxProductCode1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ProductCode2", this->tboxProductCode2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ProductNameForeign", this->tboxProductNameForeign->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ProductCode1Foreign", this->tboxProductCode1Foreign->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ProductCode2Foreign1", this->tboxProductCode2Foreign1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ProductCode2Foreign2", this->tboxProductCode2Foreign2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ProductCode2Foreign3", this->tboxProductCode2Foreign3->Text );
MasterEditorTWL::appendXmlTag( doc, form, "SubmitVersion", this->numSubmitVersion->Value.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "Backup", this->combBackup->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "BackupOther", this->tboxBackupOther->Text );
MasterEditorTWL::appendXmlTag( doc, form, "ReleaseForeign", (this->cboxReleaseForeign->Checked)?"Y":"N" );
MasterEditorTWL::appendXmlTag( doc, form, "Remarks", this->tboxCaption->Text );
MasterEditorTWL::appendXmlTag( doc, form, "SubmitWay", (this->rSubmitHand->Checked)?"Hand":"Mail" );
if( this->rUsageSale->Checked )
MasterEditorTWL::appendXmlTag( doc, form, "Purpose", "Sale" );
else if( this->rUsageSample->Checked )
MasterEditorTWL::appendXmlTag( doc, form, "Purpose", "Sample" );
else if( this->rUsageDst->Checked )
MasterEditorTWL::appendXmlTag( doc, form, "Purpose", "Dst" );
else if( this->rUsageOther->Checked )
MasterEditorTWL::appendXmlTag( doc, form, "Purpose", "Other" );
MasterEditorTWL::appendXmlTag( doc, form, "PurposeOther", this->tboxUsageOther->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Company1", this->tboxCompany1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Depart1", this->tboxDepart1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Name1", this->tboxPerson1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Furigana1", this->tboxFurigana1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Tel1", this->tboxTel1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Fax1", this->tboxFax1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Mail1", this->tboxMail1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "NTSC1", this->tboxNTSC1->Text );
MasterEditorTWL::appendXmlTag( doc, form, "InputPerson2", (this->cboxIsInputPerson2->Checked)?"Y":"N" );
MasterEditorTWL::appendXmlTag( doc, form, "Company2", this->tboxCompany2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Depart2", this->tboxDepart2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Name2", this->tboxPerson2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Furigana2", this->tboxFurigana2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Tel2", this->tboxTel2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Fax2", this->tboxFax2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "Mail2", this->tboxMail2->Text );
MasterEditorTWL::appendXmlTag( doc, form, "NTSC2", this->tboxNTSC2->Text );
if( this->rIsWirelessIcon->Checked )
MasterEditorTWL::appendXmlTag( doc, form, "DisplayIcon", "Wireless" );
else if( this->rIsWiFiIcon->Checked )
MasterEditorTWL::appendXmlTag( doc, form, "DisplayIcon", "WiFi" );
else
MasterEditorTWL::appendXmlTag( doc, form, "DisplayIcon", "None" );
MasterEditorTWL::appendXmlTag( doc, form, "IsEULA", (this->cboxIsEULA->Checked)?"Y":"N" );
MasterEditorTWL::appendXmlTag( doc, form, "Region", this->combRegion->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "RatingCERO", this->combCERO->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "RatingESRB", this->combESRB->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "RatingUSK", this->combUSK->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "RatingPEGI", this->combPEGI->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "RatingPEGI_PRT", this->combPEGI_PRT->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "RatingPEGI_BBFC", this->combPEGI_BBFC->SelectedIndex.ToString() );
MasterEditorTWL::appendXmlTag( doc, form, "RatingOFLC", this->combOFLC->SelectedIndex.ToString() );
doc->Save( filename );
} //saveTmp()
// 一時ファイルの読み出し
void Form1::loadTmp( System::String ^filename )
{
System::Xml::XmlDocument ^doc = gcnew System::Xml::XmlDocument;
doc->Load( filename );
System::Xml::XmlElement ^root = doc->DocumentElement;
System::String ^text;
// SRL
text = MasterEditorTWL::getXPathText( root, "/MasterEditorTWL/Srl" );
if( !System::String::IsNullOrEmpty(text) ) // SRLファイル名がないときはスルー
{
this->loadSrl(text);
}
// 言語
text = MasterEditorTWL::getXPathText( root, "/MasterEditorTWL/Lang" );
if( !System::String::IsNullOrEmpty(text) && text->Equals("E") )
{
this->stripItemEnglish->Checked = true;
this->stripItemJapanese->Checked = false;
this->changeEnglish();
}
else
{
this->stripItemEnglish->Checked = false;
this->stripItemJapanese->Checked = true;
this->changeJapanese();
}
// フォーム
this->parseTmp( root, "/MasterEditorTWL/Form/ProductName", this->tboxProductName );
this->parseTmp( root, "/MasterEditorTWL/Form/ProductCode1", this->tboxProductCode1 );
this->parseTmp( root, "/MasterEditorTWL/Form/ProductCode2", this->tboxProductCode2 );
this->parseTmp( root, "/MasterEditorTWL/Form/SubmitVersion", this->numSubmitVersion );
this->parseTmp( root, "/MasterEditorTWL/Form/Backup", this->combBackup );
this->tboxBackupOther->Enabled = false;
this->tboxBackupOther->Clear();
if( this->combBackup->SelectedIndex == (this->combBackup->Items->Count - 1) )
{
this->parseTmp( root, "/MasterEditorTWL/Form/BackupOther", this->tboxBackupOther );
this->tboxBackupOther->Enabled = true;
}
cli::array<System::Windows::Forms::RadioButton^> ^rbuts;
cli::array<System::String^> ^strs;
rbuts = gcnew cli::array<System::Windows::Forms::RadioButton^>{this->rSubmitHand, this->rSubmitPost};
strs = gcnew cli::array<System::String^>{"Hand","Mail"};
this->parseTmp( root, "/MasterEditorTWL/Form/SubmitWay", rbuts, strs );
rbuts = gcnew cli::array<System::Windows::Forms::RadioButton^>{this->rUsageSale, this->rUsageSample, this->rUsageDst, this->rUsageOther};
strs = gcnew cli::array<System::String^>{"Sale","Sample","Dst","Other"};
this->parseTmp( root, "/MasterEditorTWL/Form/Purpose", rbuts, strs );
this->tboxUsageOther->Enabled = false;
this->tboxUsageOther->Clear();
if( this->rUsageOther->Checked )
{
this->tboxUsageOther->Enabled = true;
this->parseTmp( root, "/MasterEditorTWL/Form/PurposeOther", this->tboxUsageOther );
}
this->parseTmp( root, "/MasterEditorTWL/Form/ReleaseForeign", this->cboxReleaseForeign );
this->tboxProductNameForeign->Enabled = false;
this->tboxProductCode1Foreign->Enabled = false;
this->tboxProductCode2Foreign1->Enabled = false;
this->tboxProductCode2Foreign2->Enabled = false;
this->tboxProductCode2Foreign3->Enabled = false;
this->tboxProductNameForeign->Clear();
this->tboxProductCode1Foreign->Clear();
this->tboxProductCode2Foreign1->Clear();
this->tboxProductCode2Foreign2->Clear();
this->tboxProductCode2Foreign3->Clear();
if( this->cboxReleaseForeign->Checked )
{
this->tboxProductNameForeign->Enabled = true;
this->tboxProductCode1Foreign->Enabled = true;
this->tboxProductCode2Foreign1->Enabled = true;
this->tboxProductCode2Foreign2->Enabled = true;
this->tboxProductCode2Foreign3->Enabled = true;
this->parseTmp( root, "/MasterEditorTWL/Form/ProductNameForeign", this->tboxProductNameForeign );
this->parseTmp( root, "/MasterEditorTWL/Form/ProductCode1Foreign", this->tboxProductCode1Foreign );
this->parseTmp( root, "/MasterEditorTWL/Form/ProductCode2Foreign1", this->tboxProductCode2Foreign1 );
this->parseTmp( root, "/MasterEditorTWL/Form/ProductCode2Foreign2", this->tboxProductCode2Foreign2 );
this->parseTmp( root, "/MasterEditorTWL/Form/ProductCode2Foreign3", this->tboxProductCode2Foreign3 );
}
this->parseTmp( root, "/MasterEditorTWL/Form/Remarks", this->tboxCaption );
this->parseTmp( root, "/MasterEditorTWL/Form/Company1", this->tboxCompany1 );
this->parseTmp( root, "/MasterEditorTWL/Form/Depart1", this->tboxDepart1 );
this->parseTmp( root, "/MasterEditorTWL/Form/Name1", this->tboxPerson1 );
this->parseTmp( root, "/MasterEditorTWL/Form/Furigana1", this->tboxFurigana1 );
this->parseTmp( root, "/MasterEditorTWL/Form/Tel1", this->tboxTel1 );
this->parseTmp( root, "/MasterEditorTWL/Form/Fax1", this->tboxFax1 );
this->parseTmp( root, "/MasterEditorTWL/Form/Mail1", this->tboxMail1 );
this->parseTmp( root, "/MasterEditorTWL/Form/NTSC1", this->tboxNTSC1 );
this->parseTmp( root, "/MasterEditorTWL/Form/InputPerson2", this->cboxIsInputPerson2 );
this->parseTmp( root, "/MasterEditorTWL/Form/Company2", this->tboxCompany2 );
this->parseTmp( root, "/MasterEditorTWL/Form/Depart2", this->tboxDepart2 );
this->parseTmp( root, "/MasterEditorTWL/Form/Name2", this->tboxPerson2 );
this->parseTmp( root, "/MasterEditorTWL/Form/Furigana2", this->tboxFurigana2 );
this->parseTmp( root, "/MasterEditorTWL/Form/Tel2", this->tboxTel2 );
this->parseTmp( root, "/MasterEditorTWL/Form/Fax2", this->tboxFax2 );
this->parseTmp( root, "/MasterEditorTWL/Form/Mail2", this->tboxMail2 );
this->parseTmp( root, "/MasterEditorTWL/Form/NTSC2", this->tboxNTSC2 );
rbuts = gcnew cli::array<System::Windows::Forms::RadioButton^>{this->rIsWirelessIcon, this->rIsWiFiIcon, this->rIsNoIcon};
strs = gcnew cli::array<System::String^>{"Wireless","WiFi","None"};
this->parseTmp( root, "/MasterEditorTWL/Form/DisplayIcon", rbuts, strs );
this->parseTmp( root, "/MasterEditorTWL/Form/IsEULA", this->cboxIsEULA );
this->parseTmp( root, "/MasterEditorTWL/Form/Region", this->combRegion );
this->parseTmp( root, "/MasterEditorTWL/Form/RatingCERO", this->combCERO );
this->parseTmp( root, "/MasterEditorTWL/Form/RatingESRB", this->combESRB );
this->parseTmp( root, "/MasterEditorTWL/Form/RatingUSK", this->combUSK );
this->parseTmp( root, "/MasterEditorTWL/Form/RatingPEGI", this->combPEGI );
this->parseTmp( root, "/MasterEditorTWL/Form/RatingPEGI_PRT", this->combPEGI_PRT );
this->parseTmp( root, "/MasterEditorTWL/Form/RatingPEGI_BBFC", this->combPEGI_BBFC );
this->parseTmp( root, "/MasterEditorTWL/Form/RatingOFLC", this->combOFLC );
this->maskParentalForms(); // ペアレンタルコントロール情報をリージョンに合わせる
} //loadTmp()
// 一時保存情報をフォーム情報に変換
System::Boolean Form1::parseTmp( System::Xml::XmlElement ^root, System::String ^xpath, System::Windows::Forms::ComboBox ^comb )
{
// コンボボックスの保存情報 - インデックスの範囲に含まれるか調べる(含まれない場合は-1)
System::String ^text = MasterEditorTWL::getXPathText( root, xpath );
if( System::String::IsNullOrEmpty( text ) )
return false;
try
{
System::Int32 index = System::Int32::Parse( text ); // テキストにはインデックスが保存されている
if( (0 <= index) && (index < comb->Items->Count) )
{
comb->SelectedIndex = index;
return true;
}
else
{
comb->SelectedIndex = -1;
return false;
}
}
catch ( System::Exception ^ex ) // 改ざんされていたとき
{
(void)ex;
comb->SelectedIndex = -1;
return false;
}
return false;
}
System::Boolean Form1::parseTmp( System::Xml::XmlElement ^root, System::String ^xpath, System::Windows::Forms::NumericUpDown ^num )
{
// テキストボックスの保存情報 - そのまま代入(ただし最大を超える場合は0にする)
System::String ^text = MasterEditorTWL::getXPathText( root, xpath );
if( System::String::IsNullOrEmpty( text ) )
return false;
try
{
System::Int32 val = System::Int32::Parse( text ); // テキストには値が保存されている
if( (0 <= val) && (val <= num->Maximum) )
{
num->Value = val;
return true;
}
else
{
num->Value = 0;
return false;
}
}
catch ( System::Exception ^ex ) // 改ざんされていたとき
{
(void)ex;
num->Value = 0;
return false;
}
return false;
}
System::Boolean Form1::parseTmp( System::Xml::XmlElement ^root, System::String ^xpath,
cli::array<System::Windows::Forms::RadioButton^>^rbuts, cli::array<System::String ^>^textCands )
{
// ラジオボタンの保存情報 - テキスト候補に合致するか調べる(合致しない場合は先頭のラジオボタンをチェック)
System::String ^text = MasterEditorTWL::getXPathText( root, xpath );
if( System::String::IsNullOrEmpty( text ) )
return false;
System::Int32 i;
System::Boolean bSearch = false;
for( i=0; i < rbuts->Length; i++ ) // XML中のテキストがどのラジオボタンのテキストに合致するかチェック
{
rbuts[i]->Checked = false;
if( textCands[i]->Equals( text ) )
{
rbuts[i]->Checked = true;
bSearch = true;
}
}
if( !bSearch ) // 合致しない場合は最初のラジオボタンをチェック
{
rbuts[0]->Checked = true;
}
return bSearch;
}
System::Boolean Form1::parseTmp( System::Xml::XmlElement ^root, System::String ^xpath, System::Windows::Forms::CheckBox ^cbox )
{
// チェックボタンの保存情報 - Y/Nを調べる(それ以外の場合にはチェックしない)
System::String ^text = MasterEditorTWL::getXPathText( root, xpath );
if( System::String::IsNullOrEmpty( text ) )
return false;
if( text->Equals("Y") )
cbox->Checked = true;
else
cbox->Checked = false; // 不正な値も含む
return cbox->Checked;
}
System::Boolean Form1::parseTmp( System::Xml::XmlElement ^root, System::String ^xpath, System::Windows::Forms::TextBox ^tbox )
{
// テキストボックスの保存情報 - そのまま代入(ただし長さが合わない場合は空白にする)
System::String ^text = MasterEditorTWL::getXPathText( root, xpath );
if( System::String::IsNullOrEmpty( text ) )
return false;
if( text->Length > tbox->MaxLength )
{
tbox->Text = gcnew System::String("");
return false;
}
tbox->Text = text;
return true;
}

View File

@ -0,0 +1,265 @@
#include "stdafx.h"
#include <apptype.h>
#include "common.h"
#include "srl.h"
#include "deliverable.h"
#include "crc_whole.h"
#include "utility.h"
#include "lang.h"
#include "FormError.h"
#include "Form1.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MasterEditorTWL;
// ----------------------------------------------
// フォームのチェック
// ----------------------------------------------
// テキスト入力がされているかチェック
System::Boolean Form1::checkTextForm( System::String ^formtext, System::String ^labelJ, System::String ^labelE, System::Boolean affectRom )
{
System::String ^msgJ = gcnew System::String( "入力されていません。" );
System::String ^msgE = gcnew System::String( "No item is set. Please retry to input." );
System::String ^tmp = formtext->Replace( " ", "" ); // スペースのみの文字列もエラー
if( (formtext == nullptr) || formtext->Equals("") || tmp->Equals("") )
{
this->hErrorList->Add( gcnew RCMrcError( labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
return false;
}
return true;
}
// 数値入力が正常かどうかチェック
System::Boolean Form1::checkNumRange(
System::Int32 val, System::Int32 min, System::Int32 max, System::String ^labelJ, System::String ^labelE, System::Boolean affectRom )
{
System::String ^msgJ = gcnew System::String( "値の範囲が不正です。やり直してください。" );
System::String ^msgE = gcnew System::String( "Invalidate range of value. Please retry." );
if( (val < min) || (max < val) )
{
this->hErrorList->Add( gcnew RCMrcError( labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
return false;
}
return true;
}
System::Boolean Form1::checkNumRange( System::String ^strval, System::Int32 min, System::Int32 max,
System::String ^labelJ, System::String ^labelE, System::Boolean affectRom )
{
try
{
System::Int32 i = System::Int32::Parse(strval);
return (this->checkNumRange( i, min, max, labelJ, labelE, affectRom ));
}
catch ( System::FormatException ^ex )
{
(void)ex;
return (this->checkNumRange( max+1, min, max, labelJ, labelE, affectRom )); // 必ず失敗するように max+1 を検査
}
}
// コンボボックスをチェック
System::Boolean Form1::checkBoxIndex( System::Windows::Forms::ComboBox ^box, System::String ^labelJ, System::String ^labelE, System::Boolean affectRom )
{
System::String ^msgJ = gcnew System::String( "選択されていません。" );
System::String ^msgE = gcnew System::String( "One item is not selected." );
if( box->SelectedIndex < 0 )
{
this->hErrorList->Add( gcnew RCMrcError(
labelJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE, msgJ, labelE, msgE, true, affectRom ) );
}
return true;
}
// --------------------------------------------------------
// エラー情報の登録
// --------------------------------------------------------
// 読み込み時エラーの登録
void Form1::setGridError( void )
{
this->gridError->Rows->Clear();
if( this->hSrl->hErrorList != nullptr )
{
for each( RCMrcError ^err in this->hSrl->hErrorList )
{
this->gridError->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridError( err );
}
}
}
void Form1::setGridWarn( void )
{
this->gridWarn->Rows->Clear();
if( this->hSrl->hWarnList != nullptr )
{
for each( RCMrcError ^err in this->hSrl->hWarnList )
{
this->gridWarn->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridWarn( err );
}
}
}
// 読み込み時に検出した修正可能エラーに現在の入力を反映
void Form1::overloadGridError( void )
{
this->gridError->Rows->Clear();
if( this->hSrl->hErrorList != nullptr )
{
for each( RCMrcError ^err in this->hSrl->hErrorList )
{
if( !err->EnableModify ) // 修正可能な情報は表示しない
{
this->gridError->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridError( err );
}
}
}
if( this->hErrorList != nullptr )
{
for each( RCMrcError ^err in this->hErrorList )
{
this->gridError->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridError( err );
}
}
}
void Form1::overloadGridWarn( void )
{
this->gridWarn->Rows->Clear();
if( this->hSrl->hWarnList != nullptr )
{
for each( RCMrcError ^err in this->hSrl->hWarnList )
{
if( !err->EnableModify )
{
this->gridWarn->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridWarn( err );
}
}
}
if( this->hWarnList != nullptr )
{
for each( RCMrcError ^err in this->hWarnList )
{
this->gridWarn->Rows->Add( err->getAll( this->stripItemJapanese->Checked ) );
this->colorGridWarn( err );
}
}
}
// セルの色を変える
void Form1::colorGridError( RCMrcError ^err )
{
if( err->AffectRom && !err->EnableModify ) // SRLに関係ありで修正不可
{
System::Int32 last = this->gridError->Rows->Count - 2; // 追加直後の行
this->gridError->Rows[ last ]->DefaultCellStyle->ForeColor = System::Drawing::Color::Red;
}
else if( err->AffectRom && err->EnableModify ) // SRLに関係ありで修正可
{
System::Int32 last = this->gridError->Rows->Count - 2;
this->gridError->Rows[ last ]->DefaultCellStyle->ForeColor = System::Drawing::Color::Blue;
}
}
void Form1::colorGridWarn( RCMrcError ^err )
{
if( err->AffectRom && !err->EnableModify )
{
System::Int32 last = this->gridWarn->Rows->Count - 2;
this->gridWarn->Rows[ last ]->DefaultCellStyle->ForeColor = System::Drawing::Color::Red;
}
else if( err->AffectRom && err->EnableModify )
{
System::Int32 last = this->gridWarn->Rows->Count - 2;
this->gridWarn->Rows[ last ]->DefaultCellStyle->ForeColor = System::Drawing::Color::Blue;
}
}
// まとめて更新
void Form1::updateGrid(void)
{
if( this->rErrorReading->Checked == true )
{
this->setGridError();
this->setGridWarn();
}
else
{
if( !System::String::IsNullOrEmpty(this->tboxFile->Text) )
{
this->hErrorList->Clear();
this->hWarnList->Clear();
this->checkSrlForms();
this->checkDeliverableForms();
this->overloadGridError();
this->overloadGridWarn();
}
}
}
// ----------------------------------------------
// エラーカウント
// ----------------------------------------------
// SRLには関係しない書類上のエラーをチェック
System::Boolean Form1::isValidOnlyDeliverable(void)
{
System::Int32 count = 0;
// SRLクラスのエラーリストはすべてSRLに関係するのでチェックしない
// -> 入力エラーのみのチェックでよい
for each( RCMrcError ^err in this->hErrorList )
{
if( !err->AffectRom )
count++;
}
return (count == 0);
}
// SRLのバイナリに影響する項目にエラーがあるかチェック
System::Boolean Form1::isValidAffectRom(void)
{
System::Int32 count = 0;
// SRLクラスの修正不可エラーをカウント
// (修正可エラーは入力によって修正されてるかもしれないのでチェックしない)
for each( RCMrcError ^err in this->hSrl->hErrorList )
{
if( !err->EnableModify ) // すべてSRLバイナリに影響する
count++;
}
// SRLバイナリに影響するエラーの中で
// 修正可エラーがフォーム入力によって修正されているかカウント
// (エラーリストが更新されていることが前提)
for each( RCMrcError ^err in this->hErrorList )
{
if( err->AffectRom ) // 修正不可エラーは存在しない
count++;
}
return (count == 0);
}
// SRLのバイナリに影響する項目の中で修正可能なエラーだけをチェック
System::Boolean Form1::isValidAffectRomModified(void)
{
System::Int32 count = 0;
for each( RCMrcError ^err in this->hErrorList )
{
if( err->AffectRom ) // 修正不可エラーは存在しない
count++;
}
return (count == 0);
}
// end of file

View File

@ -211,6 +211,34 @@
RelativePath=".\deliverable.cpp" RelativePath=".\deliverable.cpp"
> >
</File> </File>
<File
RelativePath=".\Form_deliv.cpp"
>
</File>
<File
RelativePath=".\Form_file.cpp"
>
</File>
<File
RelativePath=".\Form_lang.cpp"
>
</File>
<File
RelativePath=".\Form_pctl.cpp"
>
</File>
<File
RelativePath=".\Form_srl.cpp"
>
</File>
<File
RelativePath=".\Form_tmp.cpp"
>
</File>
<File
RelativePath=".\Form_util.cpp"
>
</File>
<File <File
RelativePath=".\keys.cpp" RelativePath=".\keys.cpp"
> >

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#define METWL_WHETHER_PLATFORM_CHECK // プラットフォームがTWL対応以外かどうかをチェックする #define METWL_WHETHER_PLATFORM_CHECK // プラットフォームがTWL対応以外かどうかをチェックする
//#define METWL_WHETHER_SIGN_DECRYPT // 署名を外してダイジェストをベリファイする #define METWL_WHETHER_SIGN_DECRYPT // 署名を外してダイジェストをベリファイする
#define METWL_WHETHER_MRC // MRC機能を含めるか #define METWL_WHETHER_MRC // MRC機能を含めるか
//#define METWL_LIGHT_CHECK // 提出条件を緩くするか //#define METWL_LIGHT_CHECK // 提出条件を緩くするか

View File

@ -491,194 +491,194 @@ ECDeliverableResult RCDeliverable::writeSpreadsheet(
} }
// ペアレンタルコントロール // ペアレンタルコントロール
if( node->FirstChild->Value->Equals( "TagRatingCERO" ) ) //if( node->FirstChild->Value->Equals( "TagRatingCERO" ) )
{ //{
node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_CERO ]->ToString(); // node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_CERO ]->ToString();
} //}
if( node->FirstChild->Value->Equals( "TagRatingCEROStr" ) ) //if( node->FirstChild->Value->Equals( "TagRatingCEROStr" ) )
{ //{
node->FirstChild->Value = MasterEditorTWL::transRatingToString( // node->FirstChild->Value = MasterEditorTWL::transRatingToString(
OS_TWL_PCTL_OGN_CERO, // OS_TWL_PCTL_OGN_CERO,
*(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_CERO ]), // *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_CERO ]),
*(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_CERO ]), // *(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_CERO ]),
english ); // english );
} //}
if( node->FirstChild->Value->Equals( "TagEnableCERO" ) ) //if( node->FirstChild->Value->Equals( "TagEnableCERO" ) )
{ //{
if( *(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_CERO ]) ) // if( *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_CERO ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagAlwaysCERO" ) ) //if( node->FirstChild->Value->Equals( "TagAlwaysCERO" ) )
{ //{
if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_CERO ]) ) // if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_CERO ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagRatingESRB" ) ) //if( node->FirstChild->Value->Equals( "TagRatingESRB" ) )
{ //{
node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_ESRB ]->ToString(); // node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_ESRB ]->ToString();
} //}
if( node->FirstChild->Value->Equals( "TagRatingESRBStr" ) ) //if( node->FirstChild->Value->Equals( "TagRatingESRBStr" ) )
{ //{
node->FirstChild->Value = MasterEditorTWL::transRatingToString( // node->FirstChild->Value = MasterEditorTWL::transRatingToString(
OS_TWL_PCTL_OGN_ESRB, // OS_TWL_PCTL_OGN_ESRB,
*(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_ESRB ]), // *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_ESRB ]),
*(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_ESRB ]), // *(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_ESRB ]),
english ); // english );
} //}
if( node->FirstChild->Value->Equals( "TagEnableESRB" ) ) //if( node->FirstChild->Value->Equals( "TagEnableESRB" ) )
{ //{
if( *(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_ESRB ]) ) // if( *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_ESRB ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagAlwaysESRB" ) ) //if( node->FirstChild->Value->Equals( "TagAlwaysESRB" ) )
{ //{
if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_ESRB ]) ) // if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_ESRB ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagRatingUSK" ) ) //if( node->FirstChild->Value->Equals( "TagRatingUSK" ) )
{ //{
node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_USK ]->ToString(); // node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_USK ]->ToString();
} //}
if( node->FirstChild->Value->Equals( "TagRatingUSKStr" ) ) //if( node->FirstChild->Value->Equals( "TagRatingUSKStr" ) )
{ //{
node->FirstChild->Value = MasterEditorTWL::transRatingToString( // node->FirstChild->Value = MasterEditorTWL::transRatingToString(
OS_TWL_PCTL_OGN_USK, // OS_TWL_PCTL_OGN_USK,
*(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_USK ]), // *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_USK ]),
*(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_USK ]), // *(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_USK ]),
english ); // english );
} //}
if( node->FirstChild->Value->Equals( "TagEnableUSK" ) ) //if( node->FirstChild->Value->Equals( "TagEnableUSK" ) )
{ //{
if( *(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_USK ]) ) // if( *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_USK ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagAlwaysUSK" ) ) //if( node->FirstChild->Value->Equals( "TagAlwaysUSK" ) )
{ //{
if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_USK ]) ) // if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_USK ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagRatingPEGI" ) ) //if( node->FirstChild->Value->Equals( "TagRatingPEGI" ) )
{ //{
node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_GEN ]->ToString(); // node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_GEN ]->ToString();
} //}
if( node->FirstChild->Value->Equals( "TagRatingPEGIStr" ) ) //if( node->FirstChild->Value->Equals( "TagRatingPEGIStr" ) )
{ //{
node->FirstChild->Value = MasterEditorTWL::transRatingToString( // node->FirstChild->Value = MasterEditorTWL::transRatingToString(
OS_TWL_PCTL_OGN_PEGI_GEN, // OS_TWL_PCTL_OGN_PEGI_GEN,
*(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_PEGI_GEN ]), // *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_PEGI_GEN ]),
*(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_GEN ]), // *(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_GEN ]),
english ); // english );
} //}
if( node->FirstChild->Value->Equals( "TagEnablePEGI" ) ) //if( node->FirstChild->Value->Equals( "TagEnablePEGI" ) )
{ //{
if( *(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_PEGI_GEN ]) ) // if( *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_PEGI_GEN ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagAlwaysPEGI" ) ) //if( node->FirstChild->Value->Equals( "TagAlwaysPEGI" ) )
{ //{
if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_PEGI_GEN ]) ) // if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_PEGI_GEN ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagRatingPEGIPRT" ) ) //if( node->FirstChild->Value->Equals( "TagRatingPEGI_PRT" ) )
{ //{
node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_PRT ]->ToString(); // node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_PRT ]->ToString();
} //}
if( node->FirstChild->Value->Equals( "TagRatingPEGIPRTStr" ) ) //if( node->FirstChild->Value->Equals( "TagRatingPEGI_PRTStr" ) )
{ //{
node->FirstChild->Value = MasterEditorTWL::transRatingToString( // node->FirstChild->Value = MasterEditorTWL::transRatingToString(
OS_TWL_PCTL_OGN_PEGI_PRT, // OS_TWL_PCTL_OGN_PEGI_PRT,
*(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_PEGI_PRT ]), // *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_PEGI_PRT ]),
*(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_PRT ]), // *(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_PRT ]),
english ); // english );
} //}
if( node->FirstChild->Value->Equals( "TagEnablePEGIPRT" ) ) //if( node->FirstChild->Value->Equals( "TagEnablePEGI_PRT" ) )
{ //{
if( *(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_PEGI_PRT ]) ) // if( *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_PEGI_PRT ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagAlwaysPEGIPRT" ) ) //if( node->FirstChild->Value->Equals( "TagAlwaysPEGI_PRT" ) )
{ //{
if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_PEGI_PRT ]) ) // if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_PEGI_PRT ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagRatingPEGIBBFC" ) ) //if( node->FirstChild->Value->Equals( "TagRatingPEGI_BBFC" ) )
{ //{
node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_BBFC ]->ToString(); // node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_BBFC ]->ToString();
} //}
if( node->FirstChild->Value->Equals( "TagRatingPEGIBBFCStr" ) ) //if( node->FirstChild->Value->Equals( "TagRatingPEGI_BBFCStr" ) )
{ //{
node->FirstChild->Value = MasterEditorTWL::transRatingToString( // node->FirstChild->Value = MasterEditorTWL::transRatingToString(
OS_TWL_PCTL_OGN_PEGI_BBFC, // OS_TWL_PCTL_OGN_PEGI_BBFC,
*(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_PEGI_BBFC ]), // *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_PEGI_BBFC ]),
*(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_BBFC ]), // *(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_PEGI_BBFC ]),
english ); // english );
} //}
if( node->FirstChild->Value->Equals( "TagEnablePEGIBBFC" ) ) //if( node->FirstChild->Value->Equals( "TagEnablePEGI_BBFC" ) )
{ //{
if( *(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_PEGI_BBFC ]) ) // if( *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_PEGI_BBFC ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagAlwaysPEGIBBFC" ) ) //if( node->FirstChild->Value->Equals( "TagAlwaysPEGI_BBFC" ) )
{ //{
if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_PEGI_BBFC ]) ) // if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_PEGI_BBFC ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagRatingOFLC" ) ) //if( node->FirstChild->Value->Equals( "TagRatingOFLC" ) )
{ //{
node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_OFLC ]->ToString(); // node->FirstChild->Value = hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_OFLC ]->ToString();
} //}
if( node->FirstChild->Value->Equals( "TagRatingOFLCStr" ) ) //if( node->FirstChild->Value->Equals( "TagRatingOFLCStr" ) )
{ //{
node->FirstChild->Value = MasterEditorTWL::transRatingToString( // node->FirstChild->Value = MasterEditorTWL::transRatingToString(
OS_TWL_PCTL_OGN_OFLC, // OS_TWL_PCTL_OGN_OFLC,
*(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_OFLC ]), // *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_OFLC ]),
*(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_OFLC ]), // *(hSrl->hArrayParentalRating[ OS_TWL_PCTL_OGN_OFLC ]),
english ); // english );
} //}
if( node->FirstChild->Value->Equals( "TagEnableOFLC" ) ) //if( node->FirstChild->Value->Equals( "TagEnableOFLC" ) )
{ //{
if( *(hSrl->hArrayParentalEffect[ OS_TWL_PCTL_OGN_OFLC ]) ) // if( *(hSrl->hArrayParentalEnable[ OS_TWL_PCTL_OGN_OFLC ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
if( node->FirstChild->Value->Equals( "TagAlwaysOFLC" ) ) //if( node->FirstChild->Value->Equals( "TagAlwaysOFLC" ) )
{ //{
if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_OFLC ]) ) // if( *(hSrl->hArrayParentalAlways[ OS_TWL_PCTL_OGN_OFLC ]) )
node->FirstChild->Value = gcnew System::String( "<EFBFBD>" ); // node->FirstChild->Value = gcnew System::String( "<22>" );
else // else
node->FirstChild->Value = nullptr; // node->FirstChild->Value = nullptr;
} //}
// ROM内登録データを1バイトずつ表に書き込む // ROM内登録データを1バイトずつ表に書き込む
if( node->FirstChild->Value->Equals( "TagRomVersionHex" ) ) if( node->FirstChild->Value->Equals( "TagRomVersionHex" ) )

View File

@ -93,6 +93,6 @@
#define LANG_NO_ICON_E ("Display No Icon") #define LANG_NO_ICON_E ("Display No Icon")
#define LANG_REGION_PCTL_E ("Card Region and Parental Control") #define LANG_REGION_PCTL_E ("Card Region and Parental Control")
#define LANG_REGION_E ("Card Region") #define LANG_REGION_E ("Card Region")
#define LANG_PCTL_RATING_E ("Rating Age") #define LANG_PCTL_RATING_E ("Rating Information")
#define LANG_PCTL_ENABLE_E ("Enable Control") #define LANG_PCTL_ENABLE_E ("Enable Control")
#define LANG_PCTL_ALWAYS_E ("Rating Pending") #define LANG_PCTL_ALWAYS_E ("Rating Pending")

View File

@ -77,6 +77,14 @@ ECSrlResult RCSrl::readFromFile( System::String ^filename )
} }
} }
// エラーリストをクリア
this->hErrorList = gcnew System::Collections::Generic::List<RCMrcError^>;
this->hWarnList = gcnew System::Collections::Generic::List<RCMrcError^>;
this->hParentalErrorList = gcnew System::Collections::Generic::List<RCMrcError^>;
this->hErrorList->Clear();
this->hWarnList->Clear();
this->hParentalErrorList->Clear();
// ROMヘッダの値をROM固有情報フィールドに反映させる // ROMヘッダの値をROM固有情報フィールドに反映させる
(void)this->setRomInfo(); (void)this->setRomInfo();
@ -182,21 +190,6 @@ ECSrlResult RCSrl::setRomInfo(void)
break; break;
} }
// ペアレンタルコントロール
this->hArrayParentalRating = gcnew cli::array<System::Byte ^>(PARENTAL_CONTROL_INFO_SIZE);
this->hArrayParentalEffect = gcnew cli::array<System::Boolean ^>(PARENTAL_CONTROL_INFO_SIZE);
this->hArrayParentalAlways = gcnew cli::array<System::Boolean ^>(PARENTAL_CONTROL_INFO_SIZE);
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
{
System::Byte rating = this->pRomHeader->s.parental_control_rating_info[i] & OS_TWL_PCTL_OGNINFO_AGE_MASK;
System::Boolean effect = ((this->pRomHeader->s.parental_control_rating_info[i] & OS_TWL_PCTL_OGNINFO_ENABLE_MASK) != 0)?true:false;
System::Boolean force = ((this->pRomHeader->s.parental_control_rating_info[i] & OS_TWL_PCTL_OGNINFO_ALWAYS_MASK) != 0)?true:false;
this->hArrayParentalRating[i] = gcnew System::Byte( rating );
this->hArrayParentalEffect[i] = gcnew System::Boolean( effect );
this->hArrayParentalAlways[i] = gcnew System::Boolean( force );
}
// TWL専用情報 // TWL専用情報
this->hIsNormalJump = gcnew System::Boolean( (this->pRomHeader->s.permit_landing_normal_jump != 0)?true:false ); this->hIsNormalJump = gcnew System::Boolean( (this->pRomHeader->s.permit_landing_normal_jump != 0)?true:false );
this->hIsTmpJump = gcnew System::Boolean( (this->pRomHeader->s.permit_landing_tmp_jump != 0)?true:false ); this->hIsTmpJump = gcnew System::Boolean( (this->pRomHeader->s.permit_landing_tmp_jump != 0)?true:false );
@ -324,15 +317,142 @@ ECSrlResult RCSrl::setRomInfo(void)
this->hIsRegionEurope = gcnew System::Boolean( ((map & METWL_MASK_REGION_EUROPE) != 0)?true:false ); this->hIsRegionEurope = gcnew System::Boolean( ((map & METWL_MASK_REGION_EUROPE) != 0)?true:false );
this->hIsRegionAustralia = gcnew System::Boolean( ((map & METWL_MASK_REGION_AUSTRALIA) != 0)?true:false ); this->hIsRegionAustralia = gcnew System::Boolean( ((map & METWL_MASK_REGION_AUSTRALIA) != 0)?true:false );
// ペアレンタルコントロール
this->setParentalControlInfo();
return ECSrlResult::NOERROR; return ECSrlResult::NOERROR;
} // ECSrlResult RCSrl::setRomInfo(void) } // ECSrlResult RCSrl::setRomInfo(void)
// ROMヘッダ内のペアレンタルコントロール情報をフィールドに反映させる
void RCSrl::setParentalControlInfo(void)
{
// リージョンに含まれていないものは読み込まない
this->hArrayParentalIndex = gcnew cli::array<int>(PARENTAL_CONTROL_INFO_SIZE);
int i;
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
{
this->hArrayParentalIndex[i] = -1;
}
// リージョンに含まれている団体をリストアップ
u32 region = this->pRomHeader->s.card_region_bitmap;
switch( region )
{
case METWL_MASK_REGION_JAPAN:
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_CERO ); // リージョンに含まれない団体の情報は読み込まない
break;
case METWL_MASK_REGION_AMERICA:
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_ESRB );
break;
case METWL_MASK_REGION_EUROPE:
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_USK );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_GEN );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_PRT );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_BBFC );
break;
case METWL_MASK_REGION_AUSTRALIA:
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_OFLC );
break;
case (METWL_MASK_REGION_EUROPE|METWL_MASK_REGION_AUSTRALIA):
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_USK );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_GEN );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_PRT );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_BBFC );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_OFLC );
break;
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
case METWL_MASK_REGION_ALL:
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_CERO );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_ESRB );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_USK );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_GEN );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_PRT );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_PEGI_BBFC );
this->setOneRatingOrgInfo( OS_TWL_PCTL_OGN_OFLC );
break;
#endif //#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
default:
this->hParentalErrorList->Add( gcnew RCMrcError(
"カードリージョン", 0x1b0, 0x1b3, "仕向地の組み合わせが不正です。ペアレンタルコントロール情報は無視して読み込まれました。",
"Card Region", "Illigal Region. Parental Control Information is ignored in reading.", true, true ) );
break;
}
}
// 団体のレーティング情報からコンボボックスのインデックスを決定する
void RCSrl::setOneRatingOrgInfo( int ogn )
{
System::Boolean enable = ((this->pRomHeader->s.parental_control_rating_info[ ogn ] & OS_TWL_PCTL_OGNINFO_ENABLE_MASK) != 0)?true:false;
System::Boolean rp = ((this->pRomHeader->s.parental_control_rating_info[ ogn ] & OS_TWL_PCTL_OGNINFO_ALWAYS_MASK) != 0)?true:false;
System::Byte age = this->pRomHeader->s.parental_control_rating_info[ ogn ] & OS_TWL_PCTL_OGNINFO_AGE_MASK;
cli::array<System::Byte> ^ages = MasterEditorTWL::getOgnRatingAges( ogn );
System::String ^name = MasterEditorTWL::getOgnName( ogn );
int index = -1;
if( !enable ) // 未定義
{
index = -1;
this->hParentalErrorList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff,
name + ": 未定義です。",
"Parental Control Info.",
name + ": Undefined.", true, true ) );
}
else
{
if( rp ) // 審査中
{
if( age == 0 ) // 年齢が0のときは審査中とみなす
{
index = ages->Length; // 配列の最後の要素の次が「審査中」
}
else
{
index = -1; // それ以外はエラー
this->hParentalErrorList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff,
name + ": 審査中指定とレーティング年齢が同時に設定されています。",
"Parental Control Info.",
name + ": Both the Rating-Peding setting and the rating age are setting.", true, true ) );
}
}
else
{
index = -1; // 団体が認めていない年齢が格納されているときエラー
int i;
for( i=0; i < ages->Length; i++ )
{
if( age == ages[i] )
{
index = i;
}
}
if( index < 0 )
{
this->hParentalErrorList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff,
name + ": レーティング年齢が団体によって指定された値ではありません。",
"Parental Control Info.",
name + ": An age isn't accepted by the organization.", true, true ) );
}
}
}
this->hArrayParentalIndex[ ogn ] = index;
}
// //
// ROMヘッダにROM固有情報フィールドの値を反映させる // ROMヘッダにROM固有情報フィールドの値を反映させる
// //
ECSrlResult RCSrl::setRomHeader(void) ECSrlResult RCSrl::setRomHeader(void)
{ {
System::Int32 i;
ECSrlResult result; ECSrlResult result;
// ROMヘッダの[0,0x160)の領域はRead Onlyで変更しない // ROMヘッダの[0,0x160)の領域はRead Onlyで変更しない
@ -359,21 +479,7 @@ ECSrlResult RCSrl::setRomHeader(void)
this->pRomHeader->s.card_region_bitmap = map; this->pRomHeader->s.card_region_bitmap = map;
// ペアレンタルコントロール // ペアレンタルコントロール
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ ) this->setParentalControlHeader();
{
System::Byte effect = 0;
System::Byte force = 0;
if( this->hArrayParentalEffect[i]->Equals(true) )
{
effect = OS_TWL_PCTL_OGNINFO_ENABLE_MASK;
}
if( this->hArrayParentalAlways[i]->Equals(true) )
{
force = OS_TWL_PCTL_OGNINFO_ALWAYS_MASK;
}
this->pRomHeader->s.parental_control_rating_info[i] = effect | force | *(this->hArrayParentalRating[i]);
}
// ROMヘッダのCRCと署名を更新する // ROMヘッダのCRCと署名を更新する
result = this->calcRomHeaderCRC(); result = this->calcRomHeaderCRC();
@ -390,6 +496,35 @@ ECSrlResult RCSrl::setRomHeader(void)
return ECSrlResult::NOERROR; return ECSrlResult::NOERROR;
} // ECSrlResult RCSrl::setRomHeader(void) } // ECSrlResult RCSrl::setRomHeader(void)
// ペアレンタルコントロールのプロパティをROMヘッダに反映させる
void RCSrl::setParentalControlHeader(void)
{
int i;
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
{
cli::array<System::Byte> ^ages = MasterEditorTWL::getOgnRatingAges( i ); // 設定可能年齢リストを取得
u8 rating;
if( this->hArrayParentalIndex[i] < 0 ) // 未定義
{
rating = 0x00;
}
else
{
int index = this->hArrayParentalIndex[i];
if( index == ages->Length ) // 審査中
{
rating = OS_TWL_PCTL_OGNINFO_ENABLE_MASK | OS_TWL_PCTL_OGNINFO_ALWAYS_MASK;
}
else // レーティング年齢を設定
{
rating = OS_TWL_PCTL_OGNINFO_ALWAYS_MASK | ages[ index ];
}
}
this->pRomHeader->s.parental_control_rating_info[i] = rating;
}
}
// //
// ヘッダのCRCを算出 // ヘッダのCRCを算出
// //
@ -749,12 +884,6 @@ ECSrlResult RCSrl::searchLicenses(FILE *fp)
// //
ECSrlResult RCSrl::mrc( FILE *fp ) ECSrlResult RCSrl::mrc( FILE *fp )
{ {
this->hErrorList = gcnew System::Collections::Generic::List<RCMrcError^>;
this->hWarnList = gcnew System::Collections::Generic::List<RCMrcError^>;
this->hErrorList->Clear();
this->hWarnList->Clear();
#ifdef METWL_WHETHER_MRC #ifdef METWL_WHETHER_MRC
ECSrlResult result; ECSrlResult result;
result = this->mrcNTR( fp ); result = this->mrcNTR( fp );
@ -767,6 +896,7 @@ ECSrlResult RCSrl::mrc( FILE *fp )
{ {
return result; return result;
} }
this->hErrorList->AddRange( this->hParentalErrorList ); // ペアレンタルコントロールのリストは別につくっているので追加
#endif #endif
return ECSrlResult::NOERROR; return ECSrlResult::NOERROR;
} }
@ -1332,12 +1462,6 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
false, true ) ); false, true ) );
} }
ECSrlResult pctl = this->mrcTWLParentalControl();
if( pctl != ECSrlResult::NOERROR )
{
return pctl;
}
this->mrcBanner( fp ); this->mrcBanner( fp );
// 追加チェック // 追加チェック
@ -1378,269 +1502,6 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
return ECSrlResult::NOERROR; return ECSrlResult::NOERROR;
} // mrcTWL() } // mrcTWL()
// PCTL専用
ECSrlResult RCSrl::mrcTWLParentalControl(void)
{
// リージョンが正常か
u32 region = this->pRomHeader->s.card_region_bitmap;
if( !this->mrcRegion( region ) )
{
return ECSrlResult::NOERROR; // これ以上チェックしない
}
// リージョンに含まれている団体/含まれていない団体の設定をチェック
this->mrcRegionOrganization( region );
return ECSrlResult::NOERROR;
} //mrcParentalControl()
// PCTLチェックの一部 リージョンが正常かチェック
System::Boolean RCSrl::mrcRegion( System::UInt32 region )
{
System::Boolean bRegionResult = true; // リージョン設定が正常であるか
if( (region != METWL_MASK_REGION_JAPAN) && (region != METWL_MASK_REGION_AMERICA) &&
(region != METWL_MASK_REGION_EUROPE) && (region != METWL_MASK_REGION_AUSTRALIA) &&
(region != (METWL_MASK_REGION_EUROPE | METWL_MASK_REGION_AUSTRALIA)) )
{
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
if( region != METWL_MASK_REGION_ALL ) // オールリージョンを許す
{
this->hErrorList->Add( gcnew RCMrcError(
"カードリージョン", 0x1b0, 0x1b3, "仕向地の組み合わせが不正です。本ツールを用いて修正できます。",
"Card Region", "Illigal Region. This tool can modify this information.", true, true ) );
bRegionResult = false;
}
#else
{
this->hErrorList->Add( gcnew RCMrcError(
"カードリージョン", 0x1b0, 0x1b3, "仕向地の組み合わせが不正です。本ツールを用いて修正してください。",
"Card Region", "Illigal Region. Please modify this information using this tool.", true, true ) );
bRegionResult = false;
}
#endif
}
// リージョンが不正のときすべてのPCTL情報をクリア(ROMヘッダには影響しない)
if( !bRegionResult )
{
int i;
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
{
this->clearParentalControl( i );
}
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff,
"仕向地の設定が不正のため、ROMデータ内のすべてのレーティング団体の情報を無視して読み込みました。本ツールを用いて修正してください。",
"Parental Control",
"Illigal region. In reading, therefore, settings for all rating organizations are ignored. Please set this infomation using this tool.",
true, true ) );
}
return bRegionResult;
}
// PCTLチェックの一部 リージョンに含まれる団体/含まれない団体の設定をチェック
void RCSrl::mrcRegionOrganization( System::UInt32 region )
{
// 表示用の団体ラベル
cli::array<System::String^> ^ognArray = gcnew cli::array<System::String^>(PARENTAL_CONTROL_INFO_SIZE);
System::Int32 i;
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
{
switch(i)
{
case OS_TWL_PCTL_OGN_CERO:
ognArray[i] = gcnew System::String( "CERO: " );
break;
case OS_TWL_PCTL_OGN_ESRB:
ognArray[i] = gcnew System::String( "ESRB: " );
break;
case OS_TWL_PCTL_OGN_USK:
ognArray[i] = gcnew System::String( "USK: " );
break;
case OS_TWL_PCTL_OGN_PEGI_GEN:
ognArray[i] = gcnew System::String( "PEGI(General): " );
break;
case OS_TWL_PCTL_OGN_PEGI_PRT:
ognArray[i] = gcnew System::String( "PEGI(Portugal): " );
break;
case OS_TWL_PCTL_OGN_PEGI_BBFC:
ognArray[i] = gcnew System::String( "PEGI and BBFC: " );
break;
case OS_TWL_PCTL_OGN_OFLC:
ognArray[i] = gcnew System::String( "OFLC: " );
break;
}
}
// リージョンに含まれる団体と含まれない団体をリスト化する
System::Collections::Generic::List<System::Byte> ^inList = gcnew System::Collections::Generic::List<System::Byte>();
inList->Clear();
System::Collections::Generic::List<System::Byte> ^exList = gcnew System::Collections::Generic::List<System::Byte>();
exList->Clear();
switch( region )
{
case METWL_MASK_REGION_JAPAN:
inList->Add( OS_TWL_PCTL_OGN_CERO ); // 含まれるリスト
exList->Add( OS_TWL_PCTL_OGN_ESRB ); // 含まれないリスト
exList->Add( OS_TWL_PCTL_OGN_USK );
exList->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
exList->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
exList->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
exList->Add( OS_TWL_PCTL_OGN_OFLC );
break;
case METWL_MASK_REGION_AMERICA:
exList->Add( OS_TWL_PCTL_OGN_CERO );
inList->Add( OS_TWL_PCTL_OGN_ESRB );
exList->Add( OS_TWL_PCTL_OGN_USK );
exList->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
exList->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
exList->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
exList->Add( OS_TWL_PCTL_OGN_OFLC );
break;
case METWL_MASK_REGION_EUROPE:
exList->Add( OS_TWL_PCTL_OGN_CERO );
exList->Add( OS_TWL_PCTL_OGN_ESRB );
inList->Add( OS_TWL_PCTL_OGN_USK );
inList->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
inList->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
inList->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
exList->Add( OS_TWL_PCTL_OGN_OFLC );
break;
case METWL_MASK_REGION_AUSTRALIA:
exList->Add( OS_TWL_PCTL_OGN_CERO );
exList->Add( OS_TWL_PCTL_OGN_ESRB );
exList->Add( OS_TWL_PCTL_OGN_USK );
exList->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
exList->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
exList->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
inList->Add( OS_TWL_PCTL_OGN_OFLC );
break;
case (METWL_MASK_REGION_EUROPE|METWL_MASK_REGION_AUSTRALIA):
exList->Add( OS_TWL_PCTL_OGN_CERO );
exList->Add( OS_TWL_PCTL_OGN_ESRB );
inList->Add( OS_TWL_PCTL_OGN_USK );
inList->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
inList->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
inList->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
inList->Add( OS_TWL_PCTL_OGN_OFLC );
break;
#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
case METWL_MASK_REGION_ALL:
inList->Add( OS_TWL_PCTL_OGN_CERO );
inList->Add( OS_TWL_PCTL_OGN_ESRB );
inList->Add( OS_TWL_PCTL_OGN_USK );
inList->Add( OS_TWL_PCTL_OGN_PEGI_GEN );
inList->Add( OS_TWL_PCTL_OGN_PEGI_PRT );
inList->Add( OS_TWL_PCTL_OGN_PEGI_BBFC );
inList->Add( OS_TWL_PCTL_OGN_OFLC );
break;
#endif //#if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER)
}
// リージョンに含まれる団体の情報が正しいか調べる
for each ( System::Byte ogn in inList )
{
this->mrcRating( ogn );
}
// リージョンに含まれない団体の情報は無視する
for each ( System::Byte ogn in exList )
{
this->clearParentalControl( ogn );
}
} //mrcRegion
// レーティング値が正常かどうかチェック
void RCSrl::mrcRating( System::Byte ogn )
{
System::String ^warnDisableJ = gcnew System::String( "制限が無効であるにもかかわらずレーティングが設定されていため、レーティングを無視して読み込みました。本ツールを用いて修正してください。" );
System::String ^warnDisableE = gcnew System::String( "Rating can't be set when control isn't enable. rating setting is ignored. Please set this infomation using this tool." );
System::String ^warnIllegalJ = gcnew System::String( "レーティング情報が不正であるため、無視して読み込みました。本ツールを用いて修正してください。" );
System::String ^warnIllegalE = gcnew System::String( "Illegal rating. rating setting is ignored. Please set this information using this tool." );
System::String ^warnPendingJ = gcnew System::String( "Rating Pendingが指定されています。この指定とレーティング値は同時に設定できないため、レーティング値を無視して読み込みました。" );
System::String ^warnPendingE = gcnew System::String( "Rating Pending is setting. It is exclusive a rating age. The age is ignored." );
cli::array<System::String^> ^ognArray = gcnew cli::array<System::String^>(PARENTAL_CONTROL_INFO_SIZE);
System::Int32 i;
for( i=0; i < PARENTAL_CONTROL_INFO_SIZE; i++ )
{
switch(i)
{
case OS_TWL_PCTL_OGN_CERO:
ognArray[i] = gcnew System::String( "CERO: " );
break;
case OS_TWL_PCTL_OGN_ESRB:
ognArray[i] = gcnew System::String( "ESRB: " );
break;
case OS_TWL_PCTL_OGN_USK:
ognArray[i] = gcnew System::String( "USK: " );
break;
case OS_TWL_PCTL_OGN_PEGI_GEN:
ognArray[i] = gcnew System::String( "PEGI(General): " );
break;
case OS_TWL_PCTL_OGN_PEGI_PRT:
ognArray[i] = gcnew System::String( "PEGI(Portugal): " );
break;
case OS_TWL_PCTL_OGN_PEGI_BBFC:
ognArray[i] = gcnew System::String( "PEGI and BBFC: " );
break;
case OS_TWL_PCTL_OGN_OFLC:
ognArray[i] = gcnew System::String( "OFLC: " );
break;
}
}
if( *(this->hArrayParentalEffect[ ogn ]) == false )
{
if( *this->hArrayParentalAlways[ ogn ] || (*this->hArrayParentalRating[ ogn ] != 0 ) )
{
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ ogn ] + warnDisableJ,
"Parental Control", ognArray[ ogn ] + warnDisableE, true, true ) );
this->clearParentalControl( ogn );
}
}
else
{
// 間違っていたら"未審査"が返ってくる
System::String ^str =
MasterEditorTWL::transRatingToString( ogn, true, *(this->hArrayParentalRating[ogn]), false );
if( *(this->hArrayParentalAlways[ogn]) == false )
{
// RPが立っていないときレーティング値が設定されていなかったらダメ
if( (str != nullptr) && str->Equals( L"未審査" ) )
{
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ ogn ] + warnIllegalJ,
"Parental Control", ognArray[ ogn ] + warnIllegalE, true, true ) );
this->clearParentalControl( ogn );
}
}
else
{
// RPが立っていたら問答無用に警告
this->hWarnList->Add( gcnew RCMrcError(
"ペアレンタルコントロール情報", 0x2f0, 0x2ff, ognArray[ ogn ] + warnPendingJ,
"Parental Control", ognArray[ ogn ] + warnPendingE, true, true ) );
this->clearParentalControl( ogn );
}
}
} //mrcRating()
// ペアレンタルコントロールのクリア
void RCSrl::clearParentalControl( System::Byte ogn )
{
this->hArrayParentalRating[ ogn ] = gcnew System::Byte( 0x00 );
this->hArrayParentalEffect[ ogn ] = gcnew System::Boolean( false );
this->hArrayParentalAlways[ ogn ] = gcnew System::Boolean( false );
}
// パディングのチェック // パディングのチェック
void RCSrl::mrcPadding(FILE *fp) void RCSrl::mrcPadding(FILE *fp)
{ {

View File

@ -260,9 +260,7 @@ namespace MasterEditorTWL
property System::String ^hLatency; // MROM/1TROM/Illegal property System::String ^hLatency; // MROM/1TROM/Illegal
// ペアレンタルコントロール // ペアレンタルコントロール
property cli::array<System::Byte^> ^hArrayParentalRating; // 各団体での制限年齢 property cli::array<System::Int32> ^hArrayParentalIndex; // 表示用のコンボボックスのインデックス
property cli::array<System::Boolean^> ^hArrayParentalEffect; // 制限有効フラグ
property cli::array<System::Boolean^> ^hArrayParentalAlways; // 制限強制有効フラグ
// TWL専用情報 一部編集可能 // TWL専用情報 一部編集可能
property System::UInt32 ^hNormalRomOffset; property System::UInt32 ^hNormalRomOffset;
@ -322,6 +320,7 @@ namespace MasterEditorTWL
// MRC機能でチェックされたエラー情報のリスト // MRC機能でチェックされたエラー情報のリスト
property System::Collections::Generic::List<RCMrcError^> ^hErrorList; property System::Collections::Generic::List<RCMrcError^> ^hErrorList;
property System::Collections::Generic::List<RCMrcError^> ^hWarnList; property System::Collections::Generic::List<RCMrcError^> ^hWarnList;
property System::Collections::Generic::List<RCMrcError^> ^hParentalErrorList; // ペアレンタルコントロールのチェックはsetと同時に行なう
// MRC追加項目 // MRC追加項目
property RCMrcSpecialList ^hMrcSpecialList; property RCMrcSpecialList ^hMrcSpecialList;
@ -341,13 +340,18 @@ namespace MasterEditorTWL
// //
ECSrlResult readFromFile ( System::String ^filename ); ECSrlResult readFromFile ( System::String ^filename );
ECSrlResult writeToFile( System::String ^filename ); ECSrlResult writeToFile( System::String ^filename );
// internal method // internal method
private: private:
// ROM固有情報とROMヘッダの設定 // ROM固有情報とROMヘッダの設定
ECSrlResult setRomInfo(void); // ROMヘッダから取得したROM固有情報をフィールドに反映させる ECSrlResult setRomInfo(void); // ROMヘッダから取得したROM固有情報をフィールドに反映させる
ECSrlResult setRomHeader(void); // ROMヘッダにROM固有情報フィールドの値を反映させる ECSrlResult setRomHeader(void); // ROMヘッダにROM固有情報フィールドの値を反映させる
// ペアレンタルコントロールの設定
void setParentalControlInfo(void);
void setOneRatingOrgInfo( int ogn );
void setParentalControlHeader(void);
// ROMヘッダの更新 // ROMヘッダの更新
ECSrlResult calcRomHeaderCRC(void); // ROMヘッダのCRCを再計算 ECSrlResult calcRomHeaderCRC(void); // ROMヘッダのCRCを再計算
ECSrlResult signRomHeader(void); // ROMヘッダ更新後の再署名 ECSrlResult signRomHeader(void); // ROMヘッダ更新後の再署名
@ -364,16 +368,9 @@ namespace MasterEditorTWL
ECSrlResult mrc( FILE *fp ); ECSrlResult mrc( FILE *fp );
ECSrlResult mrcNTR( FILE *fp ); ECSrlResult mrcNTR( FILE *fp );
ECSrlResult mrcTWL( FILE *fp ); ECSrlResult mrcTWL( FILE *fp );
ECSrlResult mrcTWLParentalControl(void);
System::Boolean mrcRegion( System::UInt32 region ); // @ret リージョンが正しいかどうか
void mrcRegionOrganization( System::UInt32 region );
void mrcRating( System::Byte ogn );
void mrcPadding( FILE *fp ); void mrcPadding( FILE *fp );
void mrcBanner( FILE *fp ); void mrcBanner( FILE *fp );
// utility
void clearParentalControl( System::Byte ogn );
}; // end of ref class RCSrl }; // end of ref class RCSrl
} // end of namespace MasterEditorTWL } // end of namespace MasterEditorTWL

View File

@ -340,6 +340,78 @@ System::String^ MasterEditorTWL::transRatingToString( System::Byte ogn, System::
return str; return str;
} // MasterEditorTWL::transRatingToString } // MasterEditorTWL::transRatingToString
// 設定可能なインデックスのリストを取得する
cli::array<System::Byte>^ MasterEditorTWL::getOgnRatingAges( int ogn )
{
cli::array<System::Byte> ^ages = gcnew cli::array<System::Byte>{0};
if( ogn == OS_TWL_PCTL_OGN_CERO )
{
ages = gcnew cli::array<System::Byte>{0,12,15,17,18};
}
else if( ogn == OS_TWL_PCTL_OGN_ESRB )
{
ages = gcnew cli::array<System::Byte>{0,3,6,10,13,17};
}
else if( ogn == OS_TWL_PCTL_OGN_USK )
{
ages = gcnew cli::array<System::Byte>{0,6,12,16,18};
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_GEN )
{
ages = gcnew cli::array<System::Byte>{0,3,7,12,16,18};
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_PRT )
{
ages = gcnew cli::array<System::Byte>{0,4,6,12,16,18};
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_BBFC )
{
ages = gcnew cli::array<System::Byte>{0,3,4,7,8,12,15,16,18};
}
else if( ogn == OS_TWL_PCTL_OGN_OFLC )
{
ages = gcnew cli::array<System::Byte>{0,7,14,15};
}
return ages;
}
// 設定可能なインデックスのリストを取得する
System::String^ MasterEditorTWL::getOgnName( int ogn )
{
System::String ^name = gcnew System::String("");
if( ogn == OS_TWL_PCTL_OGN_CERO )
{
name = gcnew System::String("CERO");
}
else if( ogn == OS_TWL_PCTL_OGN_ESRB )
{
name = gcnew System::String("ESRB");
}
else if( ogn == OS_TWL_PCTL_OGN_USK )
{
name = gcnew System::String("USK");
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_GEN )
{
name = gcnew System::String("PEGI(General)");
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_PRT )
{
name = gcnew System::String("PEGI(Portugal)");
}
else if( ogn == OS_TWL_PCTL_OGN_PEGI_BBFC )
{
name = gcnew System::String("PEGI and BBFC");
}
else if( ogn == OS_TWL_PCTL_OGN_OFLC )
{
name = gcnew System::String("OFLC");
}
return name;
}
// //
// バイト列に特定のパターンが含まれるかどうかマッチングする // バイト列に特定のパターンが含まれるかどうかマッチングする
// //

View File

@ -53,6 +53,20 @@ namespace MasterEditorTWL
// //
System::String^ transRatingToString( System::Byte ogn, System::Boolean enable, System::Byte rating, System::Boolean english ); System::String^ transRatingToString( System::Byte ogn, System::Boolean enable, System::Byte rating, System::Boolean english );
//
// ペアレンタルコントロールの各団体の設定可能年齢を取得する
//
// @arg [in] 団体
//
cli::array<System::Byte>^ getOgnRatingAges( int ogn );
//
// ペアレンタルコントロールの各団体の団体名を取得する
//
// @arg [in] 団体
//
System::String^ getOgnName( int ogn );
// //
// バイト列に特定のパターンが含まれるかどうかマッチングする // バイト列に特定のパターンが含まれるかどうかマッチングする
// //