diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb index 7a27f0a..aa3b74e 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb and b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.ncb differ diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo index 2081ae9..8cba8d5 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo and b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL.suo differ diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm index b39abb4..817a4bf 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm and b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Debug/BuildLog.htm differ diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_pctl.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_pctl.cpp index 42cdb24..e05f0a7 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_pctl.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/Form_pctl.cpp @@ -101,7 +101,7 @@ void Form1::setRegionForms(void) System::Boolean isKorea = this->hSrl->IsRegionKorea; System::Boolean isChina = this->hSrl->IsRegionChina; System::Int32 index; - if( isJapan && !isAmerica && !isEurope && !isAustralia ) + if( isJapan && !isAmerica && !isEurope && !isAustralia && !isKorea && !isChina ) index = 0; else if( !isJapan && isAmerica && !isEurope && !isAustralia && !isKorea && !isChina ) index = 1; @@ -122,7 +122,7 @@ void Form1::setRegionForms(void) else index = -1; // 不正 #if defined(METWL_VER_APPTYPE_SYSTEM) || defined(METWL_VER_APPTYPE_SECURE) || defined(METWL_VER_APPTYPE_LAUNCHER) - if( isJapan && isAmerica && isEurope && isAustralia %% isKorea && isChina ) + if( isJapan && isAmerica && isEurope && isAustralia && isKorea && isChina ) index = 7; #endif this->combRegion->SelectedIndex = index; diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj index 57d4e51..7995e62 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/MasterEditorTWL.vcproj @@ -203,6 +203,18 @@ RelativePath=".\AssemblyInfo.cpp" > + + + + + + @@ -309,6 +321,10 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" > + + diff --git a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/srl_mrc.cpp b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/srl_mrc.cpp index a9ccdac..51f99b5 100644 --- a/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/srl_mrc.cpp +++ b/build/tools/MasterEditor/MasterEditorTWL/MasterEditorTWL/srl_mrc.cpp @@ -7,6 +7,7 @@ #include "utility.h" #include "keys.h" #include "crc_whole.h" +#include "banner_char.h" #include #include #include @@ -14,7 +15,6 @@ using namespace MasterEditorTWL; -extern const u8 gBannerFont[]; extern u16 calcCRC( const u16 start, const u8 *data, const int allsize ); // **************************************************************** @@ -921,9 +921,11 @@ void RCSrl::mrcSDKVersion(FILE *fp) // ------------------------------------------------------------------- void RCSrl::mrcBanner(FILE *fp) { - u8 map[ 0x10000 ]; - u32 i; - + u8 mapWorldwide[ 0x10000 ]; + u8 mapChina[ 0x10000 ]; + u8 mapKorea[ 0x10000 ]; + int i; +/* // 本体設定だけはガイドライン無視 if( memcmp( this->pRomHeader->s.game_code, "HNB", 3 ) == 0 ) { @@ -935,7 +937,7 @@ void RCSrl::mrcBanner(FILE *fp) // false, true ) ); return; } - +*/ // バナーオフセットにエラーがあるときには調べない if( this->pRomHeader->s.banner_offset == 0 ) { @@ -947,19 +949,25 @@ void RCSrl::mrcBanner(FILE *fp) // そうでないなら 0 が入る for( i=0; i < 0x10000; i++ ) { - map[i] = 0; + mapWorldwide[i] = 0; + mapChina[i] = 0; + mapKorea[i] = 0; } - for( i=2; ; i+=2 ) // 0個目の要素はマジックコードなので含めない + for( i=0; i < MasterEditorTWL::NumOf_BannerCharCodes_Worldwide; i++ ) { - u16 index = (u16)gBannerFont[i+1]; - index = (index << 8) + gBannerFont[i]; - if( index == 0xFEFF ) - { - break; - } - map[ index ] = 1; + mapWorldwide[ MasterEditorTWL::BannerCharCodes_Worldwide[i] ] = 1; } - map[ 0x0000 ] = 1; // 0x0000は許される + for( i=0; i < MasterEditorTWL::NumOf_BannerCharCodes_China; i++ ) + { + mapChina[ MasterEditorTWL::BannerCharCodes_China[i] ] = 1; + } + for( i=0; i < MasterEditorTWL::NumOf_BannerCharCodes_Korea; i++ ) + { + mapKorea[ MasterEditorTWL::BannerCharCodes_Korea[i] ] = 1; + } + mapWorldwide[ 0x0000 ] = 1; // 0x0000は許される + mapChina[ 0x0000 ] = 1; + mapKorea[ 0x0000 ] = 1; // バナーを読み込む u32 size = this->pRomHeader->s.banner_size; @@ -971,89 +979,55 @@ void RCSrl::mrcBanner(FILE *fp) } // バナーの各文字がマップに登録されているかチェック - System::Boolean bResult = true; - u32 start = 0x240; - u32 end = (size < 0x1240)?(size):(0x1240); // NTR互換領域までのときはTWL拡張領域をサーチしない + System::Boolean bResultWorldwide = true; + System::Boolean bResultChina = true; + System::Boolean bResultKorea = true; + int start = 0x240; + int end = (size < 0x1240)?(size):(0x1240); // NTR互換領域までのときはTWL拡張領域をサーチしない for( i=0x240; i < end; i+=2 ) { - if( (0x840 <= i) && (i < 0xA40) ) // 中韓のフォント箇所はチェックしない + u16 code = banner[i+1]; + code = (code << 8) + banner[i]; + + // 中国のフォント箇所 + if( (0x840 <= i) && (i < 0x940) ) { - continue; + if( (mapWorldwide[ code ] == 0) && (mapChina[ code ] == 0) ) // ワールドワイド版が使われててもOK + { + bResultChina = false; + } } - u16 index = banner[i+1]; - u16 indexbak = index; - index = (index << 8) + banner[i]; - if( map[ index ] == 0 ) + // 韓国のフォント箇所 + else if( (0x940 <= i) && (i < 0xA40) ) { - //System::Diagnostics::Debug::WriteLine( i.ToString("X") + ":" + index.ToString("X") + ":" + indexbak.ToString("X") ); - bResult = false; - break; + if( (mapWorldwide[ code ] == 0) && (mapKorea[ code ] == 0) ) + { + bResultKorea = false; + } + } + // ワールドワイド版 + else + { + if( mapWorldwide[ code ] == 0 ) + { + bResultWorldwide = false; + } } } - if( !bResult ) + if( !bResultWorldwide ) { - this->hErrorList->Add( this->makeMrcError("BannerChar") ); + if( memcmp( this->pRomHeader->s.game_code, "HNB", 3 ) != 0 ) // 本体設定は特別に許される + { + this->hErrorList->Add( this->makeMrcError("BannerChar") ); + } + } + if( !bResultChina ) + { + this->hErrorList->Add( this->makeMrcError("ChinaBannerCharSet") ); + } + if( !bResultKorea ) + { + this->hErrorList->Add( this->makeMrcError("KoreaBannerCharSet") ); } delete []banner; } //RCSrl::mrcBanner() - -// バナーとして使用可能なフォントリスト(u16リトルエンディアン) -const u8 gBannerFont[] = -{ - 0xff, 0xfe, 0x20, 0x00, 0x21, 0x00, 0x22, 0x00, 0x23, 0x00, 0x24, 0x00, 0x25, 0x00, 0x26, 0x00, - 0x27, 0x00, 0x28, 0x00, 0x29, 0x00, 0x2a, 0x00, 0x2b, 0x00, 0x2c, 0x00, 0x2d, 0x00, 0x2e, 0x00, - 0x2f, 0x00, 0x30, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, - 0x37, 0x00, 0x38, 0x00, 0x39, 0x00, 0x3a, 0x00, 0x3b, 0x00, 0x3c, 0x00, 0x3d, 0x00, 0x3e, 0x00, - 0x3f, 0x00, 0x40, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44, 0x00, 0x45, 0x00, 0x46, 0x00, - 0x47, 0x00, 0x48, 0x00, 0x49, 0x00, 0x4a, 0x00, 0x4b, 0x00, 0x4c, 0x00, 0x4d, 0x00, 0x4e, 0x00, - 0x4f, 0x00, 0x50, 0x00, 0x51, 0x00, 0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00, - 0x57, 0x00, 0x58, 0x00, 0x59, 0x00, 0x5a, 0x00, 0x5b, 0x00, 0x5c, 0x00, 0x5d, 0x00, 0x5e, 0x00, - 0x5f, 0x00, 0x60, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x64, 0x00, 0x65, 0x00, 0x66, 0x00, - 0x67, 0x00, 0x68, 0x00, 0x69, 0x00, 0x6a, 0x00, 0x6b, 0x00, 0x6c, 0x00, 0x6d, 0x00, 0x6e, 0x00, - 0x6f, 0x00, 0x70, 0x00, 0x71, 0x00, 0x72, 0x00, 0x73, 0x00, 0x74, 0x00, 0x75, 0x00, 0x76, 0x00, - 0x77, 0x00, 0x78, 0x00, 0x79, 0x00, 0x7a, 0x00, 0x7b, 0x00, 0x7c, 0x00, 0x7d, 0x00, 0x7e, 0x00, - 0x7f, 0x00, 0xac, 0x20, 0x1a, 0x20, 0x1e, 0x20, 0x26, 0x20, 0xc6, 0x02, 0x52, 0x01, 0x18, 0x20, - 0x19, 0x20, 0x1c, 0x20, 0x1d, 0x20, 0x22, 0x20, 0xdc, 0x02, 0x22, 0x21, 0x3a, 0x20, 0x53, 0x01, - 0xa1, 0x00, 0xa2, 0x00, 0xa3, 0x00, 0xa8, 0x00, 0xa9, 0x00, 0xae, 0x00, 0xb7, 0x00, 0xbf, 0x00, - 0xc0, 0x00, 0xc1, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xc4, 0x00, 0xc5, 0x00, 0xc6, 0x00, 0xc7, 0x00, - 0xc8, 0x00, 0xc9, 0x00, 0xca, 0x00, 0xcb, 0x00, 0xcc, 0x00, 0xcd, 0x00, 0xce, 0x00, 0xcf, 0x00, - 0xd0, 0x00, 0xd1, 0x00, 0xd2, 0x00, 0xd3, 0x00, 0xd4, 0x00, 0xd5, 0x00, 0xd6, 0x00, 0xd8, 0x00, - 0xd9, 0x00, 0xda, 0x00, 0xdb, 0x00, 0xdc, 0x00, 0xdd, 0x00, 0xdf, 0x00, 0xe0, 0x00, 0xe1, 0x00, - 0xe2, 0x00, 0xe3, 0x00, 0xe4, 0x00, 0xe5, 0x00, 0xe6, 0x00, 0xe7, 0x00, 0xe8, 0x00, 0xe9, 0x00, - 0xea, 0x00, 0xeb, 0x00, 0xec, 0x00, 0xed, 0x00, 0xee, 0x00, 0xef, 0x00, 0xf0, 0x00, 0xf1, 0x00, - 0xf2, 0x00, 0xf3, 0x00, 0xf4, 0x00, 0xf5, 0x00, 0xf6, 0x00, 0xf7, 0x00, 0xf8, 0x00, 0xf9, 0x00, - 0xfa, 0x00, 0xfb, 0x00, 0xfc, 0x00, 0xfd, 0x00, 0x00, 0x30, 0x01, 0x30, 0x02, 0x30, 0x0c, 0xff, - 0x0e, 0xff, 0xfb, 0x30, 0x3a, 0x00, 0x3b, 0x00, 0x1f, 0xff, 0x01, 0xff, 0xfc, 0x30, 0x41, 0x30, - 0x42, 0x30, 0x43, 0x30, 0x44, 0x30, 0x45, 0x30, 0x46, 0x30, 0x47, 0x30, 0x48, 0x30, 0x49, 0x30, - 0x4a, 0x30, 0x4b, 0x30, 0x4c, 0x30, 0x4d, 0x30, 0x4e, 0x30, 0x4f, 0x30, 0x50, 0x30, 0x51, 0x30, - 0x52, 0x30, 0x53, 0x30, 0x54, 0x30, 0x55, 0x30, 0x56, 0x30, 0x57, 0x30, 0x58, 0x30, 0x59, 0x30, - 0x5a, 0x30, 0x5b, 0x30, 0x5c, 0x30, 0x5d, 0x30, 0x5e, 0x30, 0x5f, 0x30, 0x60, 0x30, 0x61, 0x30, - 0x62, 0x30, 0x63, 0x30, 0x64, 0x30, 0x65, 0x30, 0x66, 0x30, 0x67, 0x30, 0x68, 0x30, 0x69, 0x30, - 0x6a, 0x30, 0x6b, 0x30, 0x6c, 0x30, 0x6d, 0x30, 0x6e, 0x30, 0x6f, 0x30, 0x70, 0x30, 0x71, 0x30, - 0x72, 0x30, 0x73, 0x30, 0x74, 0x30, 0x75, 0x30, 0x76, 0x30, 0x77, 0x30, 0x78, 0x30, 0x79, 0x30, - 0x7a, 0x30, 0x7b, 0x30, 0x7c, 0x30, 0x7d, 0x30, 0x7e, 0x30, 0x7f, 0x30, 0x80, 0x30, 0x81, 0x30, - 0x82, 0x30, 0x83, 0x30, 0x84, 0x30, 0x85, 0x30, 0x86, 0x30, 0x87, 0x30, 0x88, 0x30, 0x89, 0x30, - 0x8a, 0x30, 0x8b, 0x30, 0x8c, 0x30, 0x8d, 0x30, 0x8e, 0x30, 0x8f, 0x30, 0x90, 0x30, 0x91, 0x30, - 0x92, 0x30, 0x93, 0x30, 0x9b, 0x30, 0x9c, 0x30, 0x9d, 0x30, 0x9e, 0x30, 0xa1, 0x30, 0xa2, 0x30, - 0xa3, 0x30, 0xa4, 0x30, 0xa5, 0x30, 0xa6, 0x30, 0xa7, 0x30, 0xa8, 0x30, 0xa9, 0x30, 0xaa, 0x30, - 0xab, 0x30, 0xac, 0x30, 0xad, 0x30, 0xae, 0x30, 0xaf, 0x30, 0xb0, 0x30, 0xb1, 0x30, 0xb2, 0x30, - 0xb3, 0x30, 0xb4, 0x30, 0xb5, 0x30, 0xb6, 0x30, 0xb7, 0x30, 0xb8, 0x30, 0xb9, 0x30, 0xba, 0x30, - 0xbb, 0x30, 0xbc, 0x30, 0xbd, 0x30, 0xbe, 0x30, 0xbf, 0x30, 0xc0, 0x30, 0xc1, 0x30, 0xc2, 0x30, - 0xc3, 0x30, 0xc4, 0x30, 0xc5, 0x30, 0xc6, 0x30, 0xc7, 0x30, 0xc8, 0x30, 0xc9, 0x30, 0xca, 0x30, - 0xcb, 0x30, 0xcc, 0x30, 0xcd, 0x30, 0xce, 0x30, 0xcf, 0x30, 0xd0, 0x30, 0xd1, 0x30, 0xd2, 0x30, - 0xd3, 0x30, 0xd4, 0x30, 0xd5, 0x30, 0xd6, 0x30, 0xd7, 0x30, 0xd8, 0x30, 0xd9, 0x30, 0xda, 0x30, - 0xdb, 0x30, 0xdc, 0x30, 0xdd, 0x30, 0xde, 0x30, 0xdf, 0x30, 0xe0, 0x30, 0xe1, 0x30, 0xe2, 0x30, - 0xe3, 0x30, 0xe4, 0x30, 0xe5, 0x30, 0xe6, 0x30, 0xe7, 0x30, 0xe8, 0x30, 0xe9, 0x30, 0xea, 0x30, - 0xeb, 0x30, 0xec, 0x30, 0xed, 0x30, 0xee, 0x30, 0xef, 0x30, 0xf0, 0x30, 0xf1, 0x30, 0xf2, 0x30, - 0xf3, 0x30, 0xf4, 0x30, 0xf5, 0x30, 0xf6, 0x30, 0x01, 0x30, 0x02, 0x30, 0x0c, 0xff, 0x0e, 0xff, - 0xfb, 0x30, 0x1a, 0xff, 0x1b, 0xff, 0x1f, 0xff, 0x01, 0xff, 0x9b, 0x30, 0x9c, 0x30, 0xb4, 0x00, - 0x40, 0xff, 0x3e, 0xff, 0xe3, 0xff, 0x3f, 0xff, 0x05, 0x30, 0xfc, 0x30, 0x15, 0x20, 0x10, 0x20, - 0x0f, 0xff, 0x3c, 0xff, 0x5e, 0xff, 0x5c, 0xff, 0x26, 0x20, 0x18, 0x20, 0x19, 0x20, 0x1c, 0x20, - 0x1d, 0x20, 0x08, 0xff, 0x09, 0xff, 0x14, 0x30, 0x15, 0x30, 0x3b, 0xff, 0x3d, 0xff, 0x5b, 0xff, - 0x5d, 0xff, 0x08, 0x30, 0x09, 0x30, 0x0c, 0x30, 0x0d, 0x30, 0x0b, 0xff, 0x0d, 0xff, 0xb1, 0x00, - 0xd7, 0x00, 0xf7, 0x00, 0x1d, 0xff, 0x1e, 0x22, 0x34, 0x22, 0xb0, 0x00, 0x32, 0x20, 0x33, 0x20, - 0x06, 0xff, 0x06, 0x26, 0x05, 0x26, 0xcb, 0x25, 0xcf, 0x25, 0xce, 0x25, 0xc7, 0x25, 0xc6, 0x25, - 0xa1, 0x25, 0xa0, 0x25, 0xb3, 0x25, 0xb2, 0x25, 0xbd, 0x25, 0xbc, 0x25, 0x3b, 0x20, 0x12, 0x30, - 0x92, 0x21, 0x90, 0x21, 0x91, 0x21, 0x93, 0x21, 0x6f, 0x26, 0x6d, 0x26, 0x6a, 0x26, 0x0a, 0x00, - 0xff, 0xfe, // 終わりを表す意味で0xFEFFを最後につける -};