diff --git a/build/tools/MasterEditor/MenuSkipFlagTool/check_diff.sh b/build/tools/MasterEditor/MenuSkipFlagTool/check_diff.sh new file mode 100755 index 0000000..1d19f1e --- /dev/null +++ b/build/tools/MasterEditor/MenuSkipFlagTool/check_diff.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +flag_tool="./MenuSkipFlagTool.exe" +output_dir="output/" + +for file in $* +do + echo "== diff $file ${output_dir}${file%.srl}_0_flag.srl" + diff $file ${output_dir}${file%.srl}_0_flag.srl + echo "== diff $file ${output_dir}${file%.srl}_1_disable.srl" + diff $file ${output_dir}${file%.srl}_1_disable.srl + echo "== diff ${output_dir}${file%.srl}_1_flag.srl ${output_dir}${file%.srl}_0_disable.srl" + diff ${output_dir}${file%.srl}_1_flag.srl ${output_dir}${file%.srl}_0_disable.srl +done diff --git a/build/tools/MasterEditor/MenuSkipFlagTool/main.c b/build/tools/MasterEditor/MenuSkipFlagTool/main.c index 6d8a94b..fd18513 100644 --- a/build/tools/MasterEditor/MenuSkipFlagTool/main.c +++ b/build/tools/MasterEditor/MenuSkipFlagTool/main.c @@ -85,13 +85,13 @@ void usage() { printf( "-----------------------------------------------------------------------------\n" ); printf( "Usage: MenuSkipFlagTool.exe input_file output_file enable-flag\n" ); - printf( " input_file : a ROM data file (generated by makerom.TWL).\n" ); + printf( " input_file : a ROM data file.\n" ); printf( " output_file : a destination file.\n" ); printf( " enable-flag : 1 or 0. If 1, menu-skip flag will be enabled.\n" ); printf( "\nOption:\n" ); printf( "-h : print help only.\n" ); printf( "-f : force to overwrite a output_file.\n" ); - printf( "-d : disable the mesu-skip flag, when enable-flag is 1.\n" ); + printf( "-d : disable the menu-skip flag, when enable-flag is 1.\n" ); printf( "-----------------------------------------------------------------------------\n" ); } @@ -283,6 +283,7 @@ static BOOL iEnableFlag( SContext *pContext ) (rh.s.platform_code != PLATFORM_CODE_TWL_LIMITED) ) { printf("\n*** Error: Illegal platform (%d). ***\n", rh.s.platform_code); + return FALSE; } printf("InitialCode : %c%c%c%c\n", rh.s.game_code[0], rh.s.game_code[1], rh.s.game_code[2], rh.s.game_code[3]); @@ -352,6 +353,7 @@ static BOOL iEnableFlag( SContext *pContext ) if( !DecryptSignRomHeader( &rh ) ) { printf( "Decrypt the sign : Failed\n" ); + printf("\n*** Error: Invalid sigunature. ***\n"); return FALSE; } printf( "Decrypt the sign : Succeeded\n" ); @@ -393,6 +395,7 @@ static BOOL iEnableFlag( SContext *pContext ) if( !SignRomHeader( &rh ) ) { printf( "Encrypt the sign : Failed\n" ); + printf("\n*** Error: Failed to encrypt the sigunature. ***\n"); return FALSE; } printf( "Encrypt the sign : Succeeded\n" ); diff --git a/build/tools/MasterEditor/MenuSkipFlagTool/make_test_rom.sh b/build/tools/MasterEditor/MenuSkipFlagTool/make_test_rom.sh new file mode 100755 index 0000000..87a7678 --- /dev/null +++ b/build/tools/MasterEditor/MenuSkipFlagTool/make_test_rom.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +flag_tool="./MenuSkipFlagTool.exe" +output_dir="output/" + +if [ -d ${output_dir} ]; +then + echo "skip make directory" +else + echo "make directory" + mkdir ${output_dir} +fi + +for file in $* +do + $flag_tool $file ${output_dir}${file%.srl}_1_flag.srl 1 + $flag_tool $file ${output_dir}${file%.srl}_0_flag.srl 0 + $flag_tool ${output_dir}${file%.srl}_1_flag.srl ${output_dir}${file%.srl}_1_disable.srl 1 -d + $flag_tool ${output_dir}${file%.srl}_1_flag.srl ${output_dir}${file%.srl}_0_disable.srl 0 -d +done