特殊版の更新

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/TwlToolsRED@554 7061adef-622a-194b-ae81-725974e89856
This commit is contained in:
N2205 2011-04-28 09:29:29 +00:00
parent 60d2d29c13
commit baf97e6069
5 changed files with 13265 additions and 602 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,165 @@
# ---------------------------------------
#
# 出力切り替え(適時編集して下さい)
#
# ---------------------------------------
# true の場合は 通常版
# false の場合は 特殊版
normal_flg = false
# ---------------------------------------
#
# 処理
#
# ---------------------------------------
if normal_flg == true then
input_file_name = "data_normal.txt"
output_file_name = "SdkInfoData_normal.h"
else
input_file_name = "data_special.txt"
output_file_name = "SdkInfoData_special.h"
end
temp_output_file_name = "temp_output.txt"
backup_file_name = "data.txt.BAK"
# 複製作成
src = open(input_file_name)
dst = open(backup_file_name,"w")
cont = src.read
dst.write(cont)
src.close
dst.close
#
# 被りチェック処理開始
#
copy_in_file = open(input_file_name,"r")
out_file = open(temp_output_file_name,"w+")
while (inLine = copy_in_file.gets)
# 改行削除
inLine.chomp!
# 1行の文字列を「,」で分ける
inCulm = inLine.split(/,/)
# outファイルを先頭からサーチして重複チェック
# ファイルポインタを最初に戻す
out_file.rewind
isEntry = false
while (outLine = out_file.gets)
outLine.chomp!
outCulm = outLine.split(/,/)
# 重複があったとき
if (outCulm[0] == inCulm[0]) then
isEntry = true
break
end
end
# ハッシュ値が同じエントリはここの処理で全て見つけ出す
# out_fileに登録がなかった
if isEntry == false then
in_file = open(backup_file_name,"r")
entry = ""
while (line = in_file.gets)
line.chomp!
culm = line.split(/,/)
if (culm[0] == inCulm[0]) then
temp = entry.split(/\//)
flg = false
temp.each{|elem|
if elem == culm[1] then
flg = true
break
end
}
if flg == false then
entry += culm[1] + "/"
end
end
end
# 冗長なSDKバージョン名は省く
if normal_flg != true then
write_entry = ""
current_sdk_ver = ""
a = entry.split(/\//)
a.each{|elem|
b = elem.split(/;/)
if current_sdk_ver != b[0] then
current_sdk_ver = b[0]
write_entry += b[0]
end
write_entry += "[" + b[1] + "]" + "/"
}
entry = write_entry
end
out_file.seek(0, IO::SEEK_END)
out_file.write(inCulm[0] + "," + entry + "\n")
# puts (" new entry")
in_file.close
end
end
out_file.close
copy_in_file.close
File.delete(backup_file_name)
# 成形作業(ヘッダファイル作成)
src_file = open(temp_output_file_name,"r")
dst_file = open(output_file_name,"w+")
dst_file.write("#include <twl.h>\n\n")
dst_file.write("#define SDK_INFO_NUM \t\t2794\n")
dst_file.write("#define SDK_INFO_NAME_SIZE\t0x200\n\n")
dst_file.write("typedef struct Arm7Info\n")
dst_file.write("{\n")
dst_file.write("\tunsigned char hash[MATH_SHA1_DIGEST_SIZE];\n")
dst_file.write("\tchar name[SDK_INFO_NAME_SIZE];\n")
dst_file.write("}\n")
dst_file.write("Arm7Info;\n\n")
dst_file.write("static Arm7Info s_sdk_info[ SDK_INFO_NUM ] =\n")
dst_file.write("{" + "\n")
while (inLine = src_file.gets)
inLine.chomp!
culm = inLine.split(/,/)
# culm[0] -> hash値
# culm[1] -> SDKバージョン名
elem = culm[0].unpack("a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2")
hash_data = ""
elem.each{|data|
hash_data += "0x" + data + ", "
}
line_data = "\t{{" + hash_data + "}, \"" + culm[1] + "\",},"
dst_file.write(line_data + "\n")
end
dst_file.write("};" + "\n")
src_file.close
dst_file.close

View File

@ -19,7 +19,7 @@
// 通常版・特殊版の切り替えはここの定義で行う
#define NORMAL_CHECK_TOOL
// デバッグビルド切り替え(有効にする場合はどちらか片方に)
// ƒfƒoƒbƒOƒrƒƒh
//#define DEBUG_SHOW_SDK_INFO
@ -175,29 +175,6 @@ static void DrawMainScene( void )
myDp_Printf( 0, 7, TXT_COLOR_BLACK, SUB_SCREEN, "Component SDK Version Identifier");
#ifdef DEBUG_SHOW_SDK_INFO
myDp_Printf( 0, 1, TXT_COLOR_BLUE, MAIN_SCREEN, "s_same_sdk_num : %d", s_same_sdk_num);
myDp_Printf( 0, 2, TXT_COLOR_BLUE, MAIN_SCREEN, "s_hit : %d", s_hit);
{
int i;
for( i = 0; i < s_same_sdk_num; i++ )
{
if( s_sdk_name[i][0] == '2' || s_sdk_name[i][0] == '3' || s_sdk_name[i][0] == '4' || s_sdk_name[i][0] == '5' )
{
myDp_Printf( 1, 5+i, TXT_COLOR_BLUE, MAIN_SCREEN, "SDK %s", s_sdk_name[i]);
}
else
{
myDp_Printf( 5, 5+i, TXT_COLOR_BLACK, MAIN_SCREEN, "[%s", s_sdk_name[i]);
}
}
if( s_show_error )
{
myDp_Printf( 1, 23, TXT_COLOR_RED, MAIN_SCREEN, "Error : Can Not Show SDK Info");
}
}
#endif
switch( s_mode )
{
// カードなし状態
@ -312,6 +289,29 @@ static void DrawMainScene( void )
{
myDp_Printf( 1, 20, TXT_COLOR_BLUE, SUB_SCREEN, "ID : %d", ID_NUM);
}
#ifdef DEBUG_SHOW_SDK_INFO
myDp_Printf( 0, 1, TXT_COLOR_BLUE, MAIN_SCREEN, "s_same_sdk_num : %d", s_same_sdk_num);
myDp_Printf( 0, 2, TXT_COLOR_BLUE, MAIN_SCREEN, "s_hit : %d", s_hit);
{
int i;
for( i = 0; i < s_same_sdk_num; i++ )
{
if( s_sdk_name[i][0] == '2' || s_sdk_name[i][0] == '3' || s_sdk_name[i][0] == '4' || s_sdk_name[i][0] == '5' )
{
myDp_Printf( 1, 5+i, TXT_COLOR_BLUE, MAIN_SCREEN, "SDK %s", s_sdk_name[i]);
}
else
{
myDp_Printf( 5, 5+i, TXT_COLOR_BLACK, MAIN_SCREEN, "[%s", s_sdk_name[i]);
}
}
if( s_show_error )
{
myDp_Printf( 1, 23, TXT_COLOR_RED, MAIN_SCREEN, "Error : Can Not Show SDK Info");
}
}
#endif
}

File diff suppressed because it is too large Load Diff