From ea6dbf342bee46522eb6f771f81a2368692d0889 Mon Sep 17 00:00:00 2001 From: nishikawa_takeshi Date: Mon, 22 Jun 2009 08:38:52 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=82=AD=E3=83=83=E3=83=97=E3=83=95=E3=83=A9=E3=82=B0=E7=AB=8B?= =?UTF-8?q?=E3=81=A6=E3=83=84=E3=83=BC=E3=83=AB:return=20FALSE=E3=81=8C?= =?UTF-8?q?=E6=8A=9C=E3=81=91=E3=81=A6=E3=81=84=E3=81=9F=E7=AE=87=E6=89=80?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@300 7061adef-622a-194b-ae81-725974e89856 --- .../MenuSkipFlagTool/check_diff.sh | 14 +++++++++++++ .../MasterEditor/MenuSkipFlagTool/main.c | 7 +++++-- .../MenuSkipFlagTool/make_test_rom.sh | 20 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100755 build/tools/MasterEditor/MenuSkipFlagTool/check_diff.sh create mode 100755 build/tools/MasterEditor/MenuSkipFlagTool/make_test_rom.sh 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