mirror of
https://github.com/rvtr/TwlToolsRED.git
synced 2025-10-31 06:41:18 -04:00
マスタエディタ:MRCにNAND使用量のチェックを追加。メッセージをいくつか変更。
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@127 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
parent
4d92a20c6e
commit
2306447ed8
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,7 +11,8 @@
|
|||||||
#define METWL_ROMSIZE_MAX 4096 // <20>Å‘å‚Ì.. 4Gbit
|
#define METWL_ROMSIZE_MAX 4096 // <20>Å‘å‚Ì.. 4Gbit
|
||||||
#define METWL_ROMSIZE_MIN_NAND 1
|
#define METWL_ROMSIZE_MIN_NAND 1
|
||||||
#define METWL_ROMSIZE_MAX_NAND 256
|
#define METWL_ROMSIZE_MAX_NAND 256
|
||||||
#define METWL_ALLSIZE_MAX_NAND (32*1024*1024) // Public/Privateセーブデータのサイズを含めたNANDアプリの容量制限(単位Byte)
|
#define METWL_ALLSIZE_MAX_NAND (32*1024*1024) // システム上のNANDアプリの容量制限(単位Byte)
|
||||||
|
#define METWL_ALLSIZE_MAX_NAND_LIC (16*1024*1024) // 運用上の(契約上の)NANDアプリの容量制限(単位Byte)
|
||||||
#define METWL_MASK_REGION_JAPAN 0x00000001
|
#define METWL_MASK_REGION_JAPAN 0x00000001
|
||||||
#define METWL_MASK_REGION_AMERICA 0x00000002
|
#define METWL_MASK_REGION_AMERICA 0x00000002
|
||||||
#define METWL_MASK_REGION_EUROPE 0x00000004
|
#define METWL_MASK_REGION_EUROPE 0x00000004
|
||||||
|
|||||||
@ -271,6 +271,29 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// NANDアプリがHYBRIDとなるのはクローンブートのときのみ
|
||||||
|
if( this->IsMediaNand )
|
||||||
|
{
|
||||||
|
if( !this->HasDSDLPlaySign && (this->pRomHeader->s.platform_code == PLATFORM_CODE_TWL_HYBLID) )
|
||||||
|
{
|
||||||
|
this->hErrorList->Add( gcnew RCMrcError(
|
||||||
|
"NANDアプリのHYBRID条件", 0x12, 0x12,
|
||||||
|
"クローンブート対応でないNANDアプリをHYBRID版として作成することは許可されていません。",
|
||||||
|
"HYBRID NAND application",
|
||||||
|
"Building HYBRID NAND Application supported Clone Boot is not permitted.",
|
||||||
|
false, true ) );
|
||||||
|
}
|
||||||
|
if( this->HasDSDLPlaySign && (this->pRomHeader->s.platform_code == PLATFORM_CODE_TWL_LIMITED) )
|
||||||
|
{
|
||||||
|
this->hErrorList->Add( gcnew RCMrcError(
|
||||||
|
"NANDアプリのLIMITED条件", 0x12, 0x12,
|
||||||
|
"クローンブート対応のNANDアプリをLIMITED版として作成することは許可されていません。",
|
||||||
|
"LIMITED NAND application",
|
||||||
|
"Building LIMITED NAND Application supported Clone Boot is not permitted.",
|
||||||
|
false, true ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 旧開発用暗号フラグとクローンブートの組み合わせはマスタリングで矛盾が生じる
|
// 旧開発用暗号フラグとクローンブートの組み合わせはマスタリングで矛盾が生じる
|
||||||
if( this->IsOldDevEncrypt && this->HasDSDLPlaySign )
|
if( this->IsOldDevEncrypt && this->HasDSDLPlaySign )
|
||||||
{
|
{
|
||||||
@ -322,14 +345,23 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
|
|||||||
"デバイス容量", 0x14, 0x14, "NANDアプリに対して指定可能な容量ではありません。",
|
"デバイス容量", 0x14, 0x14, "NANDアプリに対して指定可能な容量ではありません。",
|
||||||
"Device Capacity", "Invalid capacity.", false, true ) );
|
"Device Capacity", "Invalid capacity.", false, true ) );
|
||||||
}
|
}
|
||||||
u32 allsize = filesize + this->pRomHeader->s.public_save_data_size + this->pRomHeader->s.private_save_data_size;
|
//u32 allsize = filesize + this->pRomHeader->s.public_save_data_size + this->pRomHeader->s.private_save_data_size;
|
||||||
|
u32 allsize = this->hNandUsedSize->NandUsedSize; // TMDやサブバナーのサイズを含める
|
||||||
if( allsize > METWL_ALLSIZE_MAX_NAND )
|
if( allsize > METWL_ALLSIZE_MAX_NAND )
|
||||||
{
|
{
|
||||||
this->hErrorList->Add( gcnew RCMrcError(
|
this->hErrorList->Add( gcnew RCMrcError(
|
||||||
"実ファイルサイズ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
"NAND領域の使用サイズ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
||||||
"ROMデータの実ファイルサイズとPublicセーブデータおよびPrivateセーブデータのサイズの総和が32MByteを超えています。",
|
"NANDアプリによるNAND領域の使用サイズ(セーブデータ含む)が32MBを超えています。",
|
||||||
"Actual File Size",
|
"Actual File Size",
|
||||||
"The sum of this size, the public save data size and private save data size exceed 32MByte.", false, true ) );
|
"NAND size used by NAND application, including Save Data, exceeds 32MB.", false, true ) );
|
||||||
|
}
|
||||||
|
if( (allsize > METWL_ALLSIZE_MAX_NAND_LIC) && this->IsAppUser ) // ユーザアプリのときのみ
|
||||||
|
{
|
||||||
|
this->hWarnList->Add( gcnew RCMrcError( // 運用上問題あるがシステム上では問題ないので警告にしておく
|
||||||
|
"NAND領域の使用サイズ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
||||||
|
"NANDアプリによるNAND領域の使用サイズ(セーブデータ含む)が16MBを超えています。",
|
||||||
|
"Used NAND Size",
|
||||||
|
"NAND size used by NAND application, including Save Data, exceeds 16MB.", false, true ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -369,7 +401,7 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
|
|||||||
|
|
||||||
// デバッガ動作禁止フラグはユーザアプリでは立っていてはいけない
|
// デバッガ動作禁止フラグはユーザアプリでは立っていてはいけない
|
||||||
// システムアプリではデバッガで解析されないように通常では立っていなければならない
|
// システムアプリではデバッガで解析されないように通常では立っていなければならない
|
||||||
if( this->IsAppLauncher || this->IsAppSecure || this->IsAppSystem )
|
if( !this->IsAppUser )
|
||||||
{
|
{
|
||||||
if( this->pRomHeader->s.disable_debug == 0 )
|
if( this->pRomHeader->s.disable_debug == 0 )
|
||||||
{
|
{
|
||||||
@ -395,7 +427,6 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ノーマルジャンプ
|
// ノーマルジャンプ
|
||||||
if( !(this->IsAppLauncher || this->IsAppSecure || this->IsAppSystem) )
|
|
||||||
{
|
{
|
||||||
u8 okbits = 0x01 | 0x02 | 0x40 | 0x80;
|
u8 okbits = 0x01 | 0x02 | 0x40 | 0x80;
|
||||||
u8 *p = (u8*)&(this->pRomHeader->s);
|
u8 *p = (u8*)&(this->pRomHeader->s);
|
||||||
@ -408,16 +439,18 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
|
|||||||
"Illegal bit is setting. This setting is unavailable.",
|
"Illegal bit is setting. This setting is unavailable.",
|
||||||
false, true ) );
|
false, true ) );
|
||||||
}
|
}
|
||||||
|
if( this->IsAppUser )
|
||||||
if( (this->pRomHeader->s.permit_landing_normal_jump != 0) &&
|
|
||||||
!this->hMrcExternalCheckItems->IsPermitNormalJump ) // 設定ファイルでアクセス許可されていないときにチェック
|
|
||||||
{
|
{
|
||||||
this->hErrorList->Add( gcnew RCMrcError(
|
if( (this->pRomHeader->s.permit_landing_normal_jump != 0) &&
|
||||||
"ノーマルアプリジャンプ", 0x1d, 0x1d,
|
!this->hMrcExternalCheckItems->IsPermitNormalJump ) // 設定ファイルでアクセス許可されていないときにチェック
|
||||||
"ノーマルアプリジャンプは許可されていません。",
|
{
|
||||||
"Normal App Jump",
|
this->hErrorList->Add( gcnew RCMrcError(
|
||||||
"This setting is not permitted.",
|
"ノーマルアプリジャンプ", 0x1d, 0x1d,
|
||||||
false, true ) );
|
"ノーマルアプリジャンプは許可されていません。",
|
||||||
|
"Normal App Jump",
|
||||||
|
"This setting is not permitted.",
|
||||||
|
false, true ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -520,6 +553,19 @@ ECSrlResult RCSrl::mrcTWL( FILE *fp )
|
|||||||
"Title ID", "Lower 4 bytes don't match ones of Game Code.", false, true ) );
|
"Title ID", "Lower 4 bytes don't match ones of Game Code.", false, true ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// カードアプリでPublic/Privateセーブデータを設定してはいけない
|
||||||
|
if( !this->IsMediaNand )
|
||||||
|
{
|
||||||
|
if( (this->PublicSize > 0) || (this->PrivateSize) )
|
||||||
|
{
|
||||||
|
this->hErrorList->Add( gcnew RCMrcError(
|
||||||
|
"Pubilc/Privateセーブデータ", METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
||||||
|
"ゲームカード向けソフトではPublicセーブデータおよびPrivateセーブデータのサイズを指定することはできません。",
|
||||||
|
"Public/Private Save Data",
|
||||||
|
"Application for GameCard can not have Public Save Data or Private Save Data.", false, true ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// バナーの文字コード
|
// バナーの文字コード
|
||||||
this->mrcBanner( fp );
|
this->mrcBanner( fp );
|
||||||
|
|
||||||
@ -644,7 +690,7 @@ void RCSrl::mrcAppType(FILE *fp)
|
|||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void RCSrl::mrcAccessControl(FILE *fp)
|
void RCSrl::mrcAccessControl(FILE *fp)
|
||||||
{
|
{
|
||||||
if( this->IsAppLauncher || this->IsAppSecure || this->IsAppSystem )
|
if( !this->IsAppUser )
|
||||||
{
|
{
|
||||||
if( (this->pRomHeader->s.access_control.game_card_on != 0) &&
|
if( (this->pRomHeader->s.access_control.game_card_on != 0) &&
|
||||||
(this->pRomHeader->s.access_control.game_card_nitro_mode != 0) )
|
(this->pRomHeader->s.access_control.game_card_nitro_mode != 0) )
|
||||||
@ -654,7 +700,7 @@ void RCSrl::mrcAccessControl(FILE *fp)
|
|||||||
"Access Control Info.", "Game card access setting is either normal mode or NTR mode.", false, true ) );
|
"Access Control Info.", "Game card access setting is either normal mode or NTR mode.", false, true ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else // ユーザアプリ
|
||||||
{
|
{
|
||||||
if( this->pRomHeader->s.access_control.sd_card_access != 0 )
|
if( this->pRomHeader->s.access_control.sd_card_access != 0 )
|
||||||
{
|
{
|
||||||
@ -680,7 +726,7 @@ void RCSrl::mrcAccessControl(FILE *fp)
|
|||||||
u32 okbits;
|
u32 okbits;
|
||||||
if( !this->IsMediaNand )
|
if( !this->IsMediaNand )
|
||||||
{
|
{
|
||||||
okbits = 0x00000008 | 0x00000010 | 0x00000040;
|
okbits = 0x00000008 | 0x00000010 | 0x00000040; // NAND | SD | Shared2ファイル (それぞれ個別でチェックするためここではチェックしない)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -862,12 +908,12 @@ void RCSrl::mrcShared2(FILE *fp)
|
|||||||
System::String ^filenoE = "Shared File(No." + i.ToString() + ")";
|
System::String ^filenoE = "Shared File(No." + i.ToString() + ")";
|
||||||
if( !this->hMrcExternalCheckItems->hIsPermitShared2Array[i] )
|
if( !this->hMrcExternalCheckItems->hIsPermitShared2Array[i] )
|
||||||
{
|
{
|
||||||
// 一般公開されていないのにファイルを使用する場合を考慮してシステムアプリ場合のメッセージを変更する
|
// 一般公開されていないのにファイルを使用する場合を考慮してシステムアプリのときのメッセージを変更する
|
||||||
if( this->IsAppSystem || this->IsAppSecure || this->IsAppLauncher )
|
if( !this->IsAppUser )
|
||||||
{
|
{
|
||||||
this->hWarnList->Add( gcnew RCMrcError(
|
this->hWarnList->Add( gcnew RCMrcError(
|
||||||
filenoJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
filenoJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
||||||
"一般公開されていない" + filenoJ + "へのアクセスが設定されています。"
|
filenoJ + "へのアクセス(非公開)が設定されています。"
|
||||||
+ "アクセス許可されているかご確認ください。",
|
+ "アクセス許可されているかご確認ください。",
|
||||||
filenoE,
|
filenoE,
|
||||||
filenoE + " is not revealed to licencies. Please check permission of access to this file.",
|
filenoE + " is not revealed to licencies. Please check permission of access to this file.",
|
||||||
@ -885,9 +931,9 @@ void RCSrl::mrcShared2(FILE *fp)
|
|||||||
}
|
}
|
||||||
if( this->hShared2SizeArray[i] != this->hMrcExternalCheckItems->hShared2SizeArray[i] )
|
if( this->hShared2SizeArray[i] != this->hMrcExternalCheckItems->hShared2SizeArray[i] )
|
||||||
{
|
{
|
||||||
if( this->IsAppSystem || this->IsAppSecure || this->IsAppLauncher )
|
if( !this->IsAppUser )
|
||||||
{
|
{
|
||||||
this->hWarnList->Add( gcnew RCMrcError(
|
this->hWarnList->Add( gcnew RCMrcError( // システムのとき警告
|
||||||
filenoJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
filenoJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
||||||
filenoJ + "のファイルサイズが "
|
filenoJ + "のファイルサイズが "
|
||||||
+ MasterEditorTWL::transSizeToString(this->hShared2SizeArray[i]) + " に設定されています。"
|
+ MasterEditorTWL::transSizeToString(this->hShared2SizeArray[i]) + " に設定されています。"
|
||||||
@ -899,11 +945,15 @@ void RCSrl::mrcShared2(FILE *fp)
|
|||||||
false, true ) );
|
false, true ) );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
this->hErrorList->Add( gcnew RCMrcError(
|
this->hErrorList->Add( gcnew RCMrcError( // ユーザのときエラー
|
||||||
filenoJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
filenoJ, METWL_ERRLIST_NORANGE, METWL_ERRLIST_NORANGE,
|
||||||
filenoJ + "のファイルサイズに不正な値が設定されています。",
|
filenoJ + "のファイルサイズが "
|
||||||
|
+ MasterEditorTWL::transSizeToString(this->hShared2SizeArray[i]) + " に設定されています。"
|
||||||
|
+ "正しい値かどうかをご確認ください。",
|
||||||
filenoE,
|
filenoE,
|
||||||
"Illegal file size of " + filenoE + ".",
|
"File size of " + filenoE + " is "
|
||||||
|
+ MasterEditorTWL::transSizeToString(this->hShared2SizeArray[i]) + "."
|
||||||
|
+ " Please check validation of this size.",
|
||||||
false, true ) );
|
false, true ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -145,9 +145,9 @@ System::String^ MasterEditorTWL::transSizeToStringMB( const System::UInt32 size,
|
|||||||
pow = pow * 10;
|
pow = pow * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
System::UInt32 div = size * pow / MB; // 小数点の位置をずらす
|
System::UInt32 div = size * pow / MB; // 小数点の位置をずらす
|
||||||
System::UInt32 mod = size * pow % MB;
|
System::UInt32 mod = size * pow % MB;
|
||||||
if( mod > 0 ) // ずらした小数点以下を切り上げ
|
if( mod > 0 ) // ずらした小数点以下を切り上げ(直後の桁が0であってもそれ以降が0でなければ切り上げ)
|
||||||
{
|
{
|
||||||
div++;
|
div++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user