diff --git a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.ncb b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.ncb index 220890f..f2dd041 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.ncb and b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.ncb differ diff --git a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.suo b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.suo index 49e764c..f52dcc3 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.suo and b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker.suo differ diff --git a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/Debug/BuildLog.htm b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/Debug/BuildLog.htm index 02b73c9..c322f98 100644 Binary files a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/Debug/BuildLog.htm and b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/Debug/BuildLog.htm differ diff --git a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.cpp b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.cpp index 07cd87a..72c840a 100644 --- a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.cpp +++ b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.cpp @@ -35,14 +35,18 @@ int main(array ^args) { setDebugPrint( true ); } - if( argc <= 0 ) + if( argc <= 1 ) { - throw (gcnew System::Exception("Argc is 0.")); + throw (gcnew System::Exception("Argc is less than 2.")); } - else if( argc == 1 ) + + // 拡張子で判定 + if( System::IO::Path::GetExtension(args[1])->ToUpper() == ".XML" ) { - System::String ^sheet = args[0]; + // args[0] はダミー + System::String ^sheet = args[1]; DebugPrint( "Sheet file : " + sheet ); + Console::Write( System::IO::Path::GetFileName( sheet ) + "\t" ); FilenameItem ^fItem = gcnew FilenameItem; fItem->parseFilename( sheet ); @@ -56,6 +60,7 @@ int main(array ^args) System::String ^target = args[1]; DebugPrint( "Original file : " + original ); DebugPrint( "Target file : " + target ); + Console::Write( System::IO::Path::GetFileName( target ) + "\t" ); FilenameItem ^fItem = gcnew FilenameItem; fItem->parseFilename( target ); diff --git a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.vcproj b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.vcproj index eb0c0bd..16e623f 100644 --- a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.vcproj +++ b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/MasterEditorTWLChecker.vcproj @@ -115,7 +115,7 @@ /> getRatingValue(); if( rh.s.parental_control_rating_info[ ogn ] != rating ) { - throw (gcnew System::Exception("Mismatch Rating Ogn " + ogn.ToString() + ".")); + throw (gcnew System::Exception("mismatch Rating Ogn " + ogn.ToString() + ".")); return; } @@ -101,7 +101,7 @@ System::Void checkRom( FilenameItem ^fItem, System::String ^orgSrl, System::Stri { if( (ognlist->IndexOf(i) < 0) && (rh.s.parental_control_rating_info[i] != 0) ) { - throw (gcnew System::Exception("Rating Ogn " + i.ToString() + " is not Cleared in ROM Header.")); + throw (gcnew System::Exception("Rating Ogn " + i.ToString() + " is not cleared in ROM Header.")); return; } } @@ -111,13 +111,13 @@ System::Void checkRom( FilenameItem ^fItem, System::String ^orgSrl, System::Stri FILE *fp1 = NULL; if( fopen_s( &fp1, chorg, "rb" ) != NULL ) { - throw (gcnew System::Exception("Fail to Open SRL File.")); + throw (gcnew System::Exception("Fail to open the original SRL file.")); return; } FILE *fp2 = NULL; if( fopen_s( &fp2, chtarget, "rb" ) != NULL ) { - throw (gcnew System::Exception("Fail to Open SRL File.")); + throw (gcnew System::Exception("Fail to open the target SRL file.")); return; } // ファイルサイズをまずチェック @@ -231,12 +231,12 @@ System::Void verifyArea( FILE *fp1, FILE *fp2, const int offset, const int size int len = (rest > VERIFY_AREA_BUFSIZE)?(VERIFY_AREA_BUFSIZE):(rest); if( fread(buf1, 1, len, fp1) != len ) { - throw (gcnew System::Exception("In Verify, fail to fread")); + throw (gcnew System::Exception("In Verify, fail to fread fp1")); return; } if( fread(buf2, 1, len, fp2) != len ) { - throw (gcnew System::Exception("In Verify, fail to fread")); + throw (gcnew System::Exception("In Verify, fail to fread fp2")); return; } if( memcmp(buf1, buf2, len) != 0 ) diff --git a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/check_sheet.cpp b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/check_sheet.cpp index f1c958b..83bdd67 100644 --- a/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/check_sheet.cpp +++ b/build/tools/MasterEditor/MasterEditorTWLChecker/MasterEditorTWLChecker/check_sheet.cpp @@ -125,7 +125,7 @@ System::Void checkSheet( FilenameItem ^fItem, SheetItem ^sItem ) DebugPrint( "{0,-10} {1,-20} {2,-20}", fItem->ogn, rating, sItem->ratings[fItem->getOgnNumber()] ); if( sItem->ratings[fItem->getOgnNumber()] != rating ) { - throw (gcnew System::Exception("In Sheet, " + fItem->ogn + " is an Illegal String.")); + throw (gcnew System::Exception("In Sheet, " + fItem->ogn + " mismatch.")); return; } @@ -143,7 +143,7 @@ System::Void checkSheet( FilenameItem ^fItem, SheetItem ^sItem ) // 提出確認書の文字列をチェック if( sItem->ratings[ogn] != other ) { - throw (gcnew System::Exception("In Sheet, " + str + " is not a String for \"All ages\"")); + throw (gcnew System::Exception("In Sheet, " + str + " mismatch a String for \"All ages\"")); return; } } @@ -165,7 +165,7 @@ System::Void checkSheet( FilenameItem ^fItem, SheetItem ^sItem ) // 提出確認書の文字列をチェック if( sItem->ratings[ogn] != unnecessary ) { - throw (gcnew System::Exception("In Sheet, " + str + " is not a String for \"Unnecessary\"")); + throw (gcnew System::Exception("In Sheet, " + str + " mismatch a string for \"Unnecessary\"")); return; } } @@ -201,7 +201,7 @@ System::Void checkSheet( FilenameItem ^fItem, SheetItem ^sItem ) DebugPrint( "{0,-10} {1,-20} {2,-20}", fItem->getOgnString(i), disable, sItem->ratings[i] ); if( sItem->ratings[i] != disable ) { - throw (gcnew System::Exception("In Sheet, " + fItem->getOgnString(i) + " is not a String for \"Disable\"")); + throw (gcnew System::Exception("In Sheet, " + fItem->getOgnString(i) + " mismatch a string for \"Disable\"")); return; } } diff --git a/build/tools/MasterEditor/MasterEditorTWLChecker/checker.bat b/build/tools/MasterEditor/MasterEditorTWLChecker/checker.bat new file mode 100644 index 0000000..dde1842 --- /dev/null +++ b/build/tools/MasterEditor/MasterEditorTWLChecker/checker.bat @@ -0,0 +1,70 @@ +@echo off + +rem +rem mastering & comparing sample batch file +rem +rem Simple usage: SRLファイルをドラッグすると%output_path%にマスタリング +rem 結果を出力し、正しくできたか検証を行う +rem +rem 要確認変数: mastering_tool, comparing_tool, output_path +rem 補足: %~d0%~p0はバッチファイルのパスです +rem 補足: %~d1%~p1は各入力ファイルのパスです +rem + +rem 引数チェック +set usage=USAGE: %~nx0 INPUT_FILE... +if ""%1"" == """" ( + echo %usage% + echo 使用方法が間違っています。 + echo SRLもしくはXMLをドラッグアンドドロップしてください。 + echo. + goto end +) + +rem パス設定 +set checker_tool=%~d0%~p0MasterEditorTWLChecker.exe +set org_file=%~d0%~p0ORG.SRL + +rem ループ開始 (%0を使うのはここまで、%1を使うのはここから、%2以降は使わない) +:begin + +rem 出力パス設定 +set input_file=%~dpnx1 +set log_file=%~dp1%\log.txt + +rem プログラム確認 +if not exist "%checker_tool%" ( + echo checker tool "%checker_tool%" is not found. + goto end +) + +if not exist "%org_file%" ( + echo original file "%org_file%" is not found. + goto end +) + +if not exist "%input_file%" ( + echo %input_file% is not found. + goto end +) + +rem 処理本体 +echo. +echo %~nx1をチェックします。 +echo. +"%checker_tool%" "%org_file%" "%input_file%" >> "%log_file%" + +if not %ERRORLEVEL% == 0 ( + echo %input_file% のチェックに失敗しました。 +rem goto end +) + +rem 入力ファイルが残っているならbeginに戻る +shift +if ""%1"" neq """" goto begin + +rem 終了 (キー入力待ち) +:end +echo. +echo すべてのチェックが終了しました。 +pause