mirror of
https://github.com/pmret/papermario.git
synced 2024-09-16 14:32:37 +02:00
parent
c55c2c0017
commit
9b96f91dc6
@ -259,7 +259,7 @@ def write_ninja_rules(
|
||||
ninja.rule(
|
||||
"msg",
|
||||
description="msg $in",
|
||||
command=f"$python {BUILD_TOOLS}/msg/parse_compile.py $in $out",
|
||||
command=f"$python {BUILD_TOOLS}/msg/parse_compile.py $version $in $out",
|
||||
)
|
||||
|
||||
ninja.rule(
|
||||
|
@ -116,7 +116,7 @@ def color_to_code(color, style):
|
||||
).get(color)
|
||||
|
||||
|
||||
CHARSET = {
|
||||
CHARSET_STANDARD = {
|
||||
# "𝅘𝅥𝅮": 0x00,
|
||||
"!": 0x01,
|
||||
'"': 0x02,
|
||||
@ -274,6 +274,7 @@ CHARSET = {
|
||||
"‘": 0xA4,
|
||||
"’": 0xA5,
|
||||
" ": 0xF7,
|
||||
" ": 0xF7,
|
||||
# "Ⓐ": [0xFF, 0x24, 0xFF, 0x05, 0x10, 0x98, 0xFF, 0x25],
|
||||
# "Ⓑ": [0xFF, 0x24, 0xFF, 0x05, 0x11, 0x99, 0xFF, 0x25],
|
||||
# "Ⓢ": [0xFF, 0x24, 0xFF, 0x05, 0x12, 0xA1, 0xFF, 0x25],
|
||||
@ -329,8 +330,454 @@ CHARSET_CREDITS = {
|
||||
"©": 0x27,
|
||||
"&": 0x28,
|
||||
" ": 0xF7,
|
||||
" ": 0xF8,
|
||||
}
|
||||
|
||||
CHARSET_KANA = {
|
||||
"あ": 0x00,
|
||||
"い": 0x01,
|
||||
"う": 0x02,
|
||||
"え": 0x03,
|
||||
"お": 0x04,
|
||||
"か": 0x05,
|
||||
"き": 0x06,
|
||||
"く": 0x07,
|
||||
"け": 0x08,
|
||||
"こ": 0x09,
|
||||
"さ": 0x0A,
|
||||
"し": 0x0B,
|
||||
"す": 0x0C,
|
||||
"せ": 0x0D,
|
||||
"そ": 0x0E,
|
||||
"た": 0x0F,
|
||||
"ち": 0x10,
|
||||
"つ": 0x11,
|
||||
"て": 0x12,
|
||||
"と": 0x13,
|
||||
"な": 0x14,
|
||||
"に": 0x15,
|
||||
"ぬ": 0x16,
|
||||
"ね": 0x17,
|
||||
"の": 0x18,
|
||||
"は": 0x19,
|
||||
"ひ": 0x1A,
|
||||
"ふ": 0x1B,
|
||||
"へ": 0x1C,
|
||||
"ほ": 0x1D,
|
||||
"ま": 0x1E,
|
||||
"み": 0x1F,
|
||||
"む": 0x20,
|
||||
"め": 0x21,
|
||||
"も": 0x22,
|
||||
"や": 0x23,
|
||||
"ゆ": 0x24,
|
||||
"よ": 0x25,
|
||||
"ら": 0x26,
|
||||
"り": 0x27,
|
||||
"る": 0x28,
|
||||
"れ": 0x29,
|
||||
"ろ": 0x2A,
|
||||
"わ": 0x2B,
|
||||
"を": 0x2C,
|
||||
"ん": 0x2D,
|
||||
"ゔ": 0x2E,
|
||||
"が": 0x2F,
|
||||
"ぎ": 0x30,
|
||||
"ぐ": 0x31,
|
||||
"げ": 0x32,
|
||||
"ご": 0x33,
|
||||
"ざ": 0x34,
|
||||
"じ": 0x35,
|
||||
"ず": 0x36,
|
||||
"ぜ": 0x37,
|
||||
"ぞ": 0x38,
|
||||
"だ": 0x39,
|
||||
"ぢ": 0x3A,
|
||||
"づ": 0x3B,
|
||||
"で": 0x3C,
|
||||
"ど": 0x3D,
|
||||
"ば": 0x3E,
|
||||
"び": 0x3F,
|
||||
"ぶ": 0x40,
|
||||
"べ": 0x41,
|
||||
"ぼ": 0x42,
|
||||
"ぱ": 0x43,
|
||||
"ぴ": 0x44,
|
||||
"ぷ": 0x45,
|
||||
"ぺ": 0x46,
|
||||
"ぽ": 0x47,
|
||||
"ぁ": 0x48,
|
||||
"ぃ": 0x49,
|
||||
"ぅ": 0x4A,
|
||||
"ぇ": 0x4B,
|
||||
"ぉ": 0x4C,
|
||||
"っ": 0x4D,
|
||||
"ゃ": 0x4E,
|
||||
"ゅ": 0x4F,
|
||||
"ょ": 0x50,
|
||||
"ア": 0x51,
|
||||
"イ": 0x52,
|
||||
"ウ": 0x53,
|
||||
"エ": 0x54,
|
||||
"オ": 0x55,
|
||||
"カ": 0x56,
|
||||
"キ": 0x57,
|
||||
"ク": 0x58,
|
||||
"ケ": 0x59,
|
||||
"コ": 0x5A,
|
||||
"サ": 0x5B,
|
||||
"シ": 0x5C,
|
||||
"ス": 0x5D,
|
||||
"セ": 0x5E,
|
||||
"ソ": 0x5F,
|
||||
"タ": 0x60,
|
||||
"チ": 0x61,
|
||||
"ツ": 0x62,
|
||||
"テ": 0x63,
|
||||
"ト": 0x64,
|
||||
"ナ": 0x65,
|
||||
"ニ": 0x66,
|
||||
"ヌ": 0x67,
|
||||
"ネ": 0x68,
|
||||
"ノ": 0x69,
|
||||
"ハ": 0x6A,
|
||||
"ヒ": 0x6B,
|
||||
"フ": 0x6C,
|
||||
"ヘ": 0x6D,
|
||||
"ホ": 0x6E,
|
||||
"マ": 0x6F,
|
||||
"ミ": 0x70,
|
||||
"ム": 0x71,
|
||||
"メ": 0x72,
|
||||
"モ": 0x73,
|
||||
"ヤ": 0x74,
|
||||
"ユ": 0x75,
|
||||
"ヨ": 0x76,
|
||||
"ラ": 0x77,
|
||||
"リ": 0x78,
|
||||
"ル": 0x79,
|
||||
"レ": 0x7A,
|
||||
"ロ": 0x7B,
|
||||
"ワ": 0x7C,
|
||||
"ヲ": 0x7D,
|
||||
"ン": 0x7E,
|
||||
"ヴ": 0x7F,
|
||||
"ガ": 0x80,
|
||||
"ギ": 0x81,
|
||||
"グ": 0x82,
|
||||
"ゲ": 0x83,
|
||||
"ゴ": 0x84,
|
||||
"ザ": 0x85,
|
||||
"ジ": 0x86,
|
||||
"ズ": 0x87,
|
||||
"ゼ": 0x88,
|
||||
"ゾ": 0x89,
|
||||
"ダ": 0x8A,
|
||||
"ヂ": 0x8B,
|
||||
"ヅ": 0x8C,
|
||||
"デ": 0x8D,
|
||||
"ド": 0x8E,
|
||||
"バ": 0x8F,
|
||||
"ビ": 0x90,
|
||||
"ブ": 0x91,
|
||||
"ベ": 0x92,
|
||||
"ボ": 0x93,
|
||||
"パ": 0x94,
|
||||
"ピ": 0x95,
|
||||
"プ": 0x96,
|
||||
"ペ": 0x97,
|
||||
"ポ": 0x98,
|
||||
"ァ": 0x99,
|
||||
"ィ": 0x9A,
|
||||
"ゥ": 0x9B,
|
||||
"ェ": 0x9C,
|
||||
"ォ": 0x9D,
|
||||
"ッ": 0x9E,
|
||||
"ャ": 0x9F,
|
||||
"ュ": 0xA0,
|
||||
"ョ": 0xA1,
|
||||
"ー": 0xA2,
|
||||
"~": 0xA3,
|
||||
"~": 0xA3,
|
||||
# "―": 0xA4,
|
||||
# "―": 0xA5,
|
||||
# "―": 0xA6,
|
||||
"0": 0xA7,
|
||||
"0": 0xA7,
|
||||
"1": 0xA8,
|
||||
"1": 0xA8,
|
||||
"2": 0xA9,
|
||||
"2": 0xA9,
|
||||
"3": 0xAA,
|
||||
"3": 0xAA,
|
||||
"4": 0xAB,
|
||||
"4": 0xAB,
|
||||
"5": 0xAC,
|
||||
"5": 0xAC,
|
||||
"6": 0xAD,
|
||||
"6": 0xAD,
|
||||
"7": 0xAE,
|
||||
"7": 0xAE,
|
||||
"8": 0xAF,
|
||||
"8": 0xAF,
|
||||
"9": 0xB0,
|
||||
"9": 0xB0,
|
||||
"[up]": 0xB1,
|
||||
"[down]": 0xB2,
|
||||
"[left]": 0xB3,
|
||||
"[right]": 0xB4,
|
||||
"!": 0xB5,
|
||||
"!": 0xB5,
|
||||
"?": 0xB6,
|
||||
"?": 0xB6,
|
||||
"+": 0xB7,
|
||||
"+": 0xB7,
|
||||
"-": 0xB8,
|
||||
"/": 0xB9,
|
||||
"/": 0xB9,
|
||||
".": 0xBA,
|
||||
".": 0xBA,
|
||||
"&": 0xBB,
|
||||
"&": 0xBB,
|
||||
"#": 0xBC,
|
||||
"#": 0xBC,
|
||||
"[heart]": 0xBD,
|
||||
"[star]": 0xBE,
|
||||
"(": 0xBF,
|
||||
"(": 0xBF,
|
||||
")": 0xC0,
|
||||
")": 0xC0,
|
||||
"『": 0xC1,
|
||||
"』": 0xC2,
|
||||
"・": 0xC3,
|
||||
"[hiragana smalln]": 0xC4,
|
||||
"[katakana smalln]": 0xC5,
|
||||
"星": 0xC6,
|
||||
# 0xC7 is unused
|
||||
" ": 0xF7,
|
||||
" ": 0xF8,
|
||||
}
|
||||
|
||||
CHARSET_LATIN = {
|
||||
"A": 0x00,
|
||||
"A": 0x00,
|
||||
"B": 0x01,
|
||||
"B": 0x01,
|
||||
"C": 0x02,
|
||||
"C": 0x02,
|
||||
"D": 0x03,
|
||||
"D": 0x03,
|
||||
"E": 0x04,
|
||||
"E": 0x04,
|
||||
"F": 0x05,
|
||||
"F": 0x05,
|
||||
"G": 0x06,
|
||||
"G": 0x06,
|
||||
"H": 0x07,
|
||||
"H": 0x07,
|
||||
"I": 0x08,
|
||||
"I": 0x08,
|
||||
"J": 0x09,
|
||||
"J": 0x09,
|
||||
"K": 0x0A,
|
||||
"K": 0x0A,
|
||||
"L": 0x0B,
|
||||
"L": 0x0B,
|
||||
"M": 0x0C,
|
||||
"M": 0x0C,
|
||||
"N": 0x0D,
|
||||
"N": 0x0D,
|
||||
"O": 0x0E,
|
||||
"O": 0x0E,
|
||||
"P": 0x0F,
|
||||
"P": 0x0F,
|
||||
"Q": 0x10,
|
||||
"Q": 0x10,
|
||||
"R": 0x11,
|
||||
"R": 0x11,
|
||||
"S": 0x12,
|
||||
"S": 0x12,
|
||||
"T": 0x13,
|
||||
"T": 0x13,
|
||||
"U": 0x14,
|
||||
"U": 0x14,
|
||||
"V": 0x15,
|
||||
"V": 0x15,
|
||||
"W": 0x16,
|
||||
"W": 0x16,
|
||||
"X": 0x17,
|
||||
"X": 0x17,
|
||||
"Y": 0x18,
|
||||
"Y": 0x18,
|
||||
"Z": 0x19,
|
||||
"Z": 0x19,
|
||||
"z": 0x1A,
|
||||
"z": 0x1A,
|
||||
" ": 0xF7,
|
||||
" ": 0xF8,
|
||||
}
|
||||
|
||||
CHARSET_KANJI = {
|
||||
"上": 0x00,
|
||||
"下": 0x01,
|
||||
"左": 0x02,
|
||||
"右": 0x03,
|
||||
"中": 0x04,
|
||||
"東": 0x05,
|
||||
"西": 0x06,
|
||||
"南": 0x07,
|
||||
"北": 0x08,
|
||||
"一": 0x09,
|
||||
"二": 0x0A,
|
||||
"三": 0x0B,
|
||||
"名": 0x0C,
|
||||
"国": 0x0D,
|
||||
"城": 0x0E,
|
||||
"姫": 0x0F,
|
||||
"大": 0x10,
|
||||
"王": 0x11,
|
||||
"花": 0x12,
|
||||
"世": 0x13,
|
||||
"界": 0x14,
|
||||
"草": 0x15,
|
||||
"気": 0x16,
|
||||
"間": 0x17,
|
||||
"門": 0x18,
|
||||
"家": 0x19,
|
||||
"地": 0x1A,
|
||||
"岩": 0x1B,
|
||||
"駅": 0x1C,
|
||||
"山": 0x1D,
|
||||
"海": 0x1E,
|
||||
"火": 0x1F,
|
||||
"水": 0x20,
|
||||
"氷": 0x21,
|
||||
"日": 0x22,
|
||||
"根": 0x23,
|
||||
"雲": 0x24,
|
||||
"口": 0x25,
|
||||
"原": 0x26,
|
||||
"前": 0x27,
|
||||
"店": 0x28,
|
||||
"天": 0x29,
|
||||
"森": 0x2A,
|
||||
"木": 0x2B,
|
||||
"力": 0x2C,
|
||||
"空": 0x2D,
|
||||
"人": 0x2E,
|
||||
"島": 0x2F,
|
||||
"出": 0x30,
|
||||
"入": 0x31,
|
||||
"本": 0x32,
|
||||
"石": 0x33,
|
||||
"村": 0x34,
|
||||
"休": 0x35,
|
||||
"先": 0x36,
|
||||
"見": 0x37,
|
||||
"近": 0x38,
|
||||
"方": 0x39,
|
||||
"法": 0x3A,
|
||||
"手": 0x3B,
|
||||
"紙": 0x3C,
|
||||
"引": 0x3D,
|
||||
"場": 0x3E,
|
||||
"所": 0x3F,
|
||||
"使": 0x40,
|
||||
"回": 0x41,
|
||||
"道": 0x42,
|
||||
"物": 0x43,
|
||||
"弟": 0x44,
|
||||
"子": 0x45,
|
||||
"汽": 0x46,
|
||||
"車": 0x47,
|
||||
"何": 0x48,
|
||||
"黒": 0x49,
|
||||
"分": 0x4A,
|
||||
"時": 0x4B,
|
||||
"屋": 0x4C,
|
||||
"音": 0x4D,
|
||||
"目": 0x4E,
|
||||
"行": 0x4F,
|
||||
"絵": 0x50,
|
||||
"月": 0x51,
|
||||
"野": 0x52,
|
||||
"外": 0x53,
|
||||
"図": 0x54,
|
||||
"部": 0x55,
|
||||
"小": 0x56,
|
||||
"風": 0x57,
|
||||
"魔": 0x58,
|
||||
"元": 0x59,
|
||||
"太": 0x5A,
|
||||
"陽": 0x5B,
|
||||
"実": 0x5C,
|
||||
"赤": 0x5D,
|
||||
"雪": 0x5E,
|
||||
"谷": 0x5F,
|
||||
"通": 0x60,
|
||||
"[circle]": 0x61,
|
||||
"[cross]": 0x62,
|
||||
"長": 0x63,
|
||||
"話": 0x64,
|
||||
"色": 0x65,
|
||||
"光": 0x66,
|
||||
"合": 0x67,
|
||||
"青": 0x68,
|
||||
"黄": 0x69,
|
||||
"[note]": 0x6A,
|
||||
"当": 0x6B,
|
||||
"数": 0x6C,
|
||||
"兄": 0x6D,
|
||||
"用": 0x6E,
|
||||
"心": 0x6F,
|
||||
"今": 0x70,
|
||||
"正": 0x71,
|
||||
"直": 0x72,
|
||||
"全": 0x73,
|
||||
"体": 0x74,
|
||||
"夜": 0x75,
|
||||
"面": 0x76,
|
||||
"虫": 0x77,
|
||||
"x": 0x78,
|
||||
"x": 0x78,
|
||||
" ": 0xF7,
|
||||
" ": 0xF8,
|
||||
}
|
||||
|
||||
CHARSET_BUTTONS = {
|
||||
"[~a]": 0x00,
|
||||
"[~b]": 0x01,
|
||||
"[~start]": 0x02,
|
||||
"[~c-up]": 0x03,
|
||||
"[~c-down]": 0x04,
|
||||
"[~c-left]": 0x05,
|
||||
"[~c-right]": 0x06,
|
||||
"[~z]": 0x07,
|
||||
"[~l]": 0x08,
|
||||
"[~r]": 0x09,
|
||||
}
|
||||
|
||||
|
||||
def check_if_correct_charset(char, cur_charset, filename, lineno):
|
||||
warn_msg = f"{filename}:{lineno}: Warning: character '{char}' is present but is completely in a wrong charset currently set. Add {{}} before the character to silence this warning."
|
||||
|
||||
if char == " " or char == " ":
|
||||
return -1, cur_charset
|
||||
elif char in CHARSET_KANA and cur_charset is not CHARSET_KANA:
|
||||
print(warn_msg.format("[Charset Kana]"))
|
||||
return 0, CHARSET_KANA
|
||||
elif char in CHARSET_LATIN and cur_charset is not CHARSET_LATIN:
|
||||
print(warn_msg.format("[Charset Latin]"))
|
||||
return 1, CHARSET_LATIN
|
||||
elif char in CHARSET_KANJI and cur_charset is not CHARSET_KANJI:
|
||||
print(warn_msg.format("[Charset Kanji]"))
|
||||
return 2, CHARSET_KANJI
|
||||
elif char in CHARSET_BUTTONS and cur_charset is not CHARSET_BUTTONS:
|
||||
print(warn_msg.format("[Charset Buttons]"))
|
||||
return 3, CHARSET_BUTTONS
|
||||
|
||||
return -1, cur_charset
|
||||
|
||||
|
||||
def strip_c_comments(text):
|
||||
def replacer(match):
|
||||
@ -349,11 +796,12 @@ def strip_c_comments(text):
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(argv) < 3:
|
||||
print("usage: parse_compile.py [in.msg] [out.msgpack] [--c]")
|
||||
print("usage: parse_compile.py [version] [in.msg] [out.msgpack] [--c]")
|
||||
exit(1)
|
||||
|
||||
filename = argv[1]
|
||||
outfile = argv[2]
|
||||
version = argv[1]
|
||||
filename = argv[2]
|
||||
outfile = argv[3]
|
||||
is_output_format_c = "--c" in argv
|
||||
|
||||
messages = []
|
||||
@ -366,7 +814,10 @@ if __name__ == "__main__":
|
||||
directive = ""
|
||||
indent_level = 0
|
||||
|
||||
charset = CHARSET
|
||||
if version == "jp":
|
||||
charset = CHARSET_KANA
|
||||
else:
|
||||
charset = CHARSET_STANDARD
|
||||
font_stack = [0]
|
||||
sound_stack = [0]
|
||||
color_stack = [0x0A]
|
||||
@ -433,6 +884,11 @@ if __name__ == "__main__":
|
||||
message = Message(name, section, index)
|
||||
messages.append(message)
|
||||
|
||||
if version == "jp":
|
||||
charset = CHARSET_KANA
|
||||
else:
|
||||
charset = CHARSET_STANDARD
|
||||
|
||||
while source[0] != "{":
|
||||
source = source[1:]
|
||||
|
||||
@ -557,6 +1013,8 @@ if __name__ == "__main__":
|
||||
message.bytes += [0x09, index]
|
||||
elif style == "popup":
|
||||
message.bytes += [0x0A]
|
||||
elif style == "popup2":
|
||||
message.bytes += [0x0B]
|
||||
elif style == "upgrade":
|
||||
pos = named_args.get("pos")
|
||||
|
||||
@ -592,6 +1050,8 @@ if __name__ == "__main__":
|
||||
font = 0
|
||||
elif font == "menu":
|
||||
font = 1
|
||||
elif font == "menu2":
|
||||
font = 2
|
||||
elif font == "title":
|
||||
font = 3
|
||||
elif font == "subtitle":
|
||||
@ -607,7 +1067,10 @@ if __name__ == "__main__":
|
||||
if font == 3 or font == 4:
|
||||
charset = CHARSET_CREDITS
|
||||
else:
|
||||
charset = CHARSET
|
||||
if version == "jp":
|
||||
charset = CHARSET_KANA
|
||||
else:
|
||||
charset = CHARSET_STANDARD
|
||||
# elif command == "/font":
|
||||
# font_stack.pop()
|
||||
# message.bytes += [0xFF, 0x00, font_stack[0]]
|
||||
@ -616,6 +1079,41 @@ if __name__ == "__main__":
|
||||
# charset = CHARSET_CREDITS
|
||||
# else:
|
||||
# charset = CHARSET
|
||||
elif command == "charset":
|
||||
if version != "jp":
|
||||
print(f"{filename}:{lineno}: charset command is only supported in the JP version")
|
||||
exit(1)
|
||||
|
||||
if len(args) != 1:
|
||||
print(f"{filename}:{lineno}: charset command requires 1 parameter")
|
||||
exit(1)
|
||||
|
||||
arg_charset = args[0]
|
||||
|
||||
if arg_charset == "kana":
|
||||
arg_charset = 0
|
||||
elif arg_charset == "latin":
|
||||
arg_charset = 1
|
||||
elif arg_charset == "kanji":
|
||||
arg_charset = 2
|
||||
elif arg_charset == "buttons":
|
||||
arg_charset = 3
|
||||
|
||||
if type(arg_charset) is not int:
|
||||
print(f"{filename}:{lineno}: unknown charset '{arg_charset}'")
|
||||
exit(1)
|
||||
|
||||
message.bytes += [0xF3 + arg_charset]
|
||||
|
||||
if arg_charset == 0:
|
||||
charset = CHARSET_KANA
|
||||
elif arg_charset == 1:
|
||||
charset = CHARSET_LATIN
|
||||
elif arg_charset == 2:
|
||||
charset = CHARSET_KANJI
|
||||
elif arg_charset == 3:
|
||||
charset = CHARSET_BUTTONS
|
||||
|
||||
elif command == "inputoff":
|
||||
message.bytes += [0xFF, 0x07]
|
||||
elif command == "inputon":
|
||||
@ -686,6 +1184,12 @@ if __name__ == "__main__":
|
||||
message.bytes += [0xFF, 0x11, *args]
|
||||
elif command == "right":
|
||||
if len(args) == 0:
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[right]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xB4]
|
||||
else:
|
||||
message.bytes += [0x95]
|
||||
else:
|
||||
if len(args) != 1:
|
||||
@ -695,6 +1199,12 @@ if __name__ == "__main__":
|
||||
message.bytes += [0xFF, 0x12, args[0]]
|
||||
elif command == "down":
|
||||
if len(args) == 0:
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[down]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xB2]
|
||||
else:
|
||||
message.bytes += [0x93]
|
||||
else:
|
||||
if len(args) != 1:
|
||||
@ -704,6 +1214,12 @@ if __name__ == "__main__":
|
||||
message.bytes += [0xFF, 0x13, args[0]]
|
||||
elif command == "up":
|
||||
if len(args) == 0:
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[up]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xB1]
|
||||
else:
|
||||
message.bytes += [0x92]
|
||||
else:
|
||||
if len(args) != 1:
|
||||
@ -1015,6 +1531,19 @@ if __name__ == "__main__":
|
||||
elif command == "a":
|
||||
color_code = color_to_code("blue", "button")
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x00,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1031,6 +1560,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
)
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x01,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1047,6 +1589,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
)
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x08,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1063,6 +1618,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
)
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x09,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1076,6 +1644,19 @@ if __name__ == "__main__":
|
||||
elif command == "z":
|
||||
color_code = color_to_code("grey", "button")
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x07,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1092,6 +1673,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
)
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x03,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1108,6 +1702,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
)
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x04,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1124,6 +1731,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
)
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x05,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1140,6 +1760,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
)
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x06,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1156,6 +1789,19 @@ if __name__ == "__main__":
|
||||
named_args.get("ctx", "button"),
|
||||
) #
|
||||
assert color_code is not None
|
||||
if version == "jp":
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
0xFF,
|
||||
0x05,
|
||||
color_code,
|
||||
0xF6,
|
||||
0x02,
|
||||
0xFF,
|
||||
0x25,
|
||||
]
|
||||
else:
|
||||
message.bytes += [
|
||||
0xFF,
|
||||
0x24,
|
||||
@ -1167,37 +1813,171 @@ if __name__ == "__main__":
|
||||
0x25,
|
||||
]
|
||||
elif command == "~a":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~a]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x00]
|
||||
else:
|
||||
message.bytes += [0x98]
|
||||
elif command == "~b":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~b]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x01]
|
||||
else:
|
||||
message.bytes += [0x99]
|
||||
elif command == "~l":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~l]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x08]
|
||||
else:
|
||||
message.bytes += [0x9A]
|
||||
elif command == "~r":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~r]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x09]
|
||||
else:
|
||||
message.bytes += [0x9B]
|
||||
elif command == "~z":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~z]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x07]
|
||||
else:
|
||||
message.bytes += [0x9C]
|
||||
elif command == "~c-up":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~c-up]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x03]
|
||||
else:
|
||||
message.bytes += [0x9D]
|
||||
elif command == "~c-down":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~c-down]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x04]
|
||||
else:
|
||||
message.bytes += [0x9E]
|
||||
elif command == "~c-left":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~c-left]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x05]
|
||||
else:
|
||||
message.bytes += [0x9F]
|
||||
elif command == "~c-right":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~c-right]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x06]
|
||||
else:
|
||||
message.bytes += [0xA0]
|
||||
elif command == "~start":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[~start]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x02]
|
||||
else:
|
||||
message.bytes += [0xA1]
|
||||
elif command == "note":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[note]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x6A]
|
||||
else:
|
||||
message.bytes += [0x00]
|
||||
elif command == "heart":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[heart]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xBD]
|
||||
else:
|
||||
message.bytes += [0x90]
|
||||
elif command == "star":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[star]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xBE]
|
||||
else:
|
||||
message.bytes += [0x91]
|
||||
elif command == "left":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[left]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xB3]
|
||||
else:
|
||||
message.bytes += [0x94]
|
||||
elif command == "circle":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[circle]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x61]
|
||||
else:
|
||||
message.bytes += [0x96]
|
||||
elif command == "cross":
|
||||
if version == "jp":
|
||||
charset_byte, charset = check_if_correct_charset("[cross]", charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0x62]
|
||||
else:
|
||||
message.bytes += [0x97]
|
||||
elif command == "katakana":
|
||||
if version != "jp":
|
||||
print(f"{filename}:{lineno}: Command katakana is only supported in the JP version")
|
||||
exit(1)
|
||||
|
||||
kana_char = args[0]
|
||||
|
||||
if kana_char == "smalln":
|
||||
charset_byte, charset = check_if_correct_charset(
|
||||
"[katakana smalln]", charset, filename, lineno
|
||||
)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xC5]
|
||||
else:
|
||||
print(f"{filename}:{lineno}: Invalid or unimplemented katakana character name {kana_char}")
|
||||
exit(1)
|
||||
elif command == "hiragana":
|
||||
if version != "jp":
|
||||
print(f"{filename}:{lineno}: Command hiragana is only supported in the JP version")
|
||||
exit(1)
|
||||
|
||||
kana_char = args[0]
|
||||
|
||||
if kana_char == "smalln":
|
||||
charset_byte, charset = check_if_correct_charset(
|
||||
"[hiragana smalln]", charset, filename, lineno
|
||||
)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
message.bytes += [0xC4]
|
||||
else:
|
||||
print(f"{filename}:{lineno}: Invalid or unimplemented hiragana character name {kana_char}")
|
||||
exit(1)
|
||||
elif command == "fullspace":
|
||||
message.bytes += [0xF8]
|
||||
elif command == "halfspace":
|
||||
message.bytes += [0xF9]
|
||||
elif command == "savepos":
|
||||
message.bytes += [0xFF, 0x22]
|
||||
elif command == "restorepos":
|
||||
@ -1255,6 +2035,28 @@ if __name__ == "__main__":
|
||||
if source[0] == "\\":
|
||||
source = source[1:]
|
||||
|
||||
if version == "jp" and charset is not CHARSET_CREDITS:
|
||||
charset_byte, charset = check_if_correct_charset(source[0], charset, filename, lineno)
|
||||
if charset_byte != -1:
|
||||
message.bytes += [0xF3 + charset_byte]
|
||||
elif (
|
||||
source[0] not in CHARSET_KANA
|
||||
and source[0] not in CHARSET_LATIN
|
||||
and source[0] not in CHARSET_KANJI
|
||||
and source[0] not in CHARSET_BUTTONS
|
||||
):
|
||||
print(f"{filename}:{lineno}: unsupported character '{source[0]}' for current font")
|
||||
exit(1)
|
||||
|
||||
data = charset[source[0]]
|
||||
|
||||
if type(data) is int:
|
||||
message.bytes.append(data)
|
||||
else:
|
||||
message.bytes += data
|
||||
|
||||
source = source[1:]
|
||||
else:
|
||||
if source[0] in charset:
|
||||
data = charset[source[0]]
|
||||
|
||||
|
1152
tools/splat_ext/msg_jp.yaml
Normal file
1152
tools/splat_ext/msg_jp.yaml
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,182 @@ import re
|
||||
import pylibyaml
|
||||
import yaml as yaml_loader
|
||||
|
||||
CHARSET = {
|
||||
|
||||
CHARSET_COMMON = {
|
||||
0xF7: " ",
|
||||
0xF0: "[BR]\n",
|
||||
0xF1: "[Wait]",
|
||||
0xF2: {None: lambda d: (f"[Pause {d[0]}]", 1)},
|
||||
0xF3: "[Variant0]",
|
||||
0xF4: "[Variant1]",
|
||||
0xF5: "[Variant2]",
|
||||
0xF6: "[Variant3]",
|
||||
0xFB: "[Next]\n",
|
||||
0xFC: {
|
||||
0x01: "[Style right]\n",
|
||||
0x02: "[Style left]\n",
|
||||
0x03: "[Style center]\n",
|
||||
0x04: "[Style tattle]\n",
|
||||
0x05: {
|
||||
None: lambda d: (
|
||||
f"[Style choice pos={d[0]},{d[1]} size={d[2]},{d[3]}]\n",
|
||||
4,
|
||||
)
|
||||
},
|
||||
0x06: "[Style inspect]\n",
|
||||
0x07: "[Style sign]\n",
|
||||
0x08: {None: lambda d: (f"[Style lamppost height={d[0]}]\n", 1)},
|
||||
0x09: {None: lambda d: (f"[Style postcard index={d[0]}]\n", 1)},
|
||||
0x0A: "[Style popup]\n",
|
||||
0x0B: "[Style popup2]\n",
|
||||
0x0C: {
|
||||
None: lambda d: (
|
||||
f"[Style upgrade pos={d[0]},{d[1]} size={d[2]},{d[3]}]\n",
|
||||
4,
|
||||
)
|
||||
},
|
||||
0x0D: "[Style narrate]\n",
|
||||
0x0E: "[Style epilogue]\n",
|
||||
},
|
||||
0xFF: {
|
||||
0x00: {
|
||||
0: "[Font standard]\n",
|
||||
1: "[Font menu]\n",
|
||||
2: "[Font menu2]\n",
|
||||
3: "[Font title]\n",
|
||||
4: "[Font subtitle]\n",
|
||||
},
|
||||
0x04: "[Yield]",
|
||||
0x05: {
|
||||
# 0x0A: "[color:normal]",
|
||||
# 0x20: "[color:red]",
|
||||
# 0x21: "[color:pink]",
|
||||
# 0x22: "[color:purple]",
|
||||
# 0x23: "[color:blue]",
|
||||
# 0x24: "[color:cyan]",
|
||||
# 0x25: "[color:green]",
|
||||
# 0x26: "[color:yellow]",
|
||||
# 0x00: "[color=normal ctx=diary]",
|
||||
# 0x07: "[color=red ctx=diary]",
|
||||
# 0x17: "[color=dark ctx=inspect]",
|
||||
# 0x18: "[color=normal ctx=sign]",
|
||||
# 0x19: "[color=red ctx=sign]",
|
||||
# 0x1A: "[color=blue ctx=sign]",
|
||||
# 0x1B: "[color=green ctx=sign]",
|
||||
# 0x28: "[color=red ctx=popup]",
|
||||
# 0x29: "[color=pink ctx=popup]",
|
||||
# 0x2A: "[color=purple ctx=popup]",
|
||||
# 0x2B: "[color=blue ctx=popup]",
|
||||
# 0x2C: "[color=teal ctx=popup]",
|
||||
# 0x2D: "[color=green ctx=popup]",
|
||||
# 0x2E: "[color=yellow ctx=popup]",
|
||||
# 0x2F: "[color=normal ctx=popup]",
|
||||
None: lambda d: (f"[Color 0x{d[0]:X}]", 1),
|
||||
},
|
||||
0x07: "[InputOff]\n",
|
||||
0x08: "[InputOn]\n",
|
||||
0x09: "[DelayOff]\n",
|
||||
0x0A: "[DelayOn]\n",
|
||||
0x0B: {None: lambda d: (f"[CharWidth {d[0]}]", 1)},
|
||||
0x0C: {None: lambda d: (f"[Scroll {d[0]}]", 1)},
|
||||
0x0D: {None: lambda d: (f"[Size {d[0]},{d[1]}]\n", 2)},
|
||||
0x0E: "[SizeReset]\n",
|
||||
0x0F: {None: lambda d: (f"[Speed delay={d[0]} chars={d[1]}]", 2)},
|
||||
0x10: {None: lambda d: (f"[SetPosX {(d[0] << 8) + d[1]}]", 2)},
|
||||
0x11: {None: lambda d: (f"[SetPosY {d[0]}]", 1)},
|
||||
0x12: {None: lambda d: (f"[Right {d[0]}]", 1)},
|
||||
0x13: {None: lambda d: (f"[Down {d[0]}]", 1)},
|
||||
0x14: {None: lambda d: (f"[Up {d[0]}]", 1)},
|
||||
0x15: {None: lambda d: (f"[InlineImage index={d[0]}]\n", 1)},
|
||||
0x16: {
|
||||
None: lambda d: (
|
||||
f"[AnimSprite spriteID=0x{d[0]:02X}{d[1]:02X} raster={d[2]}]\n",
|
||||
3,
|
||||
)
|
||||
},
|
||||
0x17: {None: lambda d: (f"[ItemIcon itemID=0x{d[0]:02X}{d[1]:02X}]\n", 2)},
|
||||
0x18: {
|
||||
None: lambda d: (
|
||||
f"[Image index={d[0]} pos={(d[1] << 8) + d[2]},{d[3]} hasBorder={d[4]} alpha={d[5]} fadeAmount={d[6]}]\n",
|
||||
7,
|
||||
)
|
||||
},
|
||||
0x19: {None: lambda d: (f"[HideImage fadeAmount={d[0]}]\n", 1)},
|
||||
0x1A: {None: lambda d: (f"[AnimDelay index={d[1]} delay={d[2]}]", 3)},
|
||||
0x1B: {None: lambda d: (f"[AnimLoop {d[0]} {d[1]}]", 2)},
|
||||
0x1C: {None: lambda d: (f"[AnimDone {d[0]}]", 1)},
|
||||
0x1E: {None: lambda d: (f"[Cursor {d[0]}]", 1)},
|
||||
0x1F: {None: lambda d: (f"[EndChoice {d[0]}]", 1)},
|
||||
0x20: {None: lambda d: (f"[SetCancel {d[0]}]", 1)},
|
||||
0x21: {None: lambda d: (f"[Option {d[0]}]", 1)},
|
||||
0x22: "[SavePos]",
|
||||
0x23: "[RestorePos]",
|
||||
0x24: {
|
||||
0xFF: {
|
||||
0x05: {
|
||||
0x10: {0x98: {0xFF: {0x25: "[A]"}}},
|
||||
0x11: {0x99: {0xFF: {0x25: "[B]"}}},
|
||||
0x12: {0xA1: {0xFF: {0x25: "[START]"}}},
|
||||
0x13: {
|
||||
0x9D: {0xFF: {0x25: "[C-UP]"}},
|
||||
0x9E: {0xFF: {0x25: "[C-DOWN]"}},
|
||||
0x9F: {0xFF: {0x25: "[C-LEFT]"}},
|
||||
0xA0: {0xFF: {0x25: "[C-RIGHT]"}},
|
||||
},
|
||||
0x14: {0x9C: {0xFF: {0x25: "[Z]"}}},
|
||||
}
|
||||
}
|
||||
},
|
||||
# 0x24: "[SaveColor]",
|
||||
# 0x25: "[RestoreColor]",
|
||||
0x26: {
|
||||
0x00: "[Shake]",
|
||||
0x01: "[Wave]",
|
||||
0x02: "[NoiseOutline]",
|
||||
0x03: {None: lambda d: (f"[Static {d[0]}]", 1)},
|
||||
0x05: {None: lambda d: (f"[Blur dir={['x', 'y', 'xy'][d[0]]}]", 1)},
|
||||
0x07: {None: lambda d: (f"[DitherFade {d[0]}]", 1)},
|
||||
0x0A: "[PrintRising]",
|
||||
0x0B: "[PrintGrowing]",
|
||||
0x0C: "[SizeJitter]",
|
||||
0x0D: "[SizeWave]",
|
||||
0x0E: "[DropShadow]",
|
||||
},
|
||||
0x27: {
|
||||
0x00: "[/Shake]",
|
||||
0x01: "[/Wave]",
|
||||
0x03: "[/Static]",
|
||||
0x05: "[/Blur]",
|
||||
0x07: "[/DitherFade]",
|
||||
0x0A: "[/PrintRising]",
|
||||
0x0B: "[/PrintGrowing]",
|
||||
0x0C: "[/SizeJitter]",
|
||||
0x0D: "[/SizeWave]",
|
||||
0x0E: "[/DropShadow]",
|
||||
},
|
||||
0x28: {None: lambda d: (f"[Var {d[0]}]", 1)},
|
||||
0x29: {None: lambda d: (f"[CenterX {d[0]}]", 1)},
|
||||
0x2B: "[EnableCDownNext]",
|
||||
0x2C: {
|
||||
None: lambda d: (
|
||||
f"[CustomVoice soundIDs=0x{d[0]:02X}{d[1]:02X}{d[2]:02X}{d[3]:02X},0x{d[4]:02X}{d[5]:02X}{d[6]:02X}{d[7]:02X}]",
|
||||
8,
|
||||
)
|
||||
},
|
||||
0x2E: {None: lambda d: (f"[Volume {d[0]}]", 1)},
|
||||
0x2F: {
|
||||
0: "[Voice normal]\n",
|
||||
1: "[Voice bowser]\n",
|
||||
2: "[Voice star]\n",
|
||||
None: lambda d: (f"[Voice {d[0]}]\n", 1),
|
||||
},
|
||||
# None: lambda d: (f"[func_{d[0]:02X}]", 1),
|
||||
},
|
||||
None: lambda d: (f"[Raw 0x{d[0]:02X}]", 1),
|
||||
}
|
||||
|
||||
CHARSET_STANDARD = {
|
||||
**CHARSET_COMMON,
|
||||
0x00: "[NOTE]",
|
||||
0x01: "!",
|
||||
0x02: '"',
|
||||
@ -174,178 +349,10 @@ CHARSET = {
|
||||
0xA3: "”",
|
||||
0xA4: "‘",
|
||||
0xA5: "’",
|
||||
0xF7: " ",
|
||||
0xF0: "[BR]\n",
|
||||
0xF1: "[Wait]",
|
||||
0xF2: {None: lambda d: (f"[Pause {d[0]}]", 1)},
|
||||
0xF3: "[Variant0]",
|
||||
0xF4: "[Variant1]",
|
||||
0xF5: "[Variant2]",
|
||||
0xF6: "[Variant3]",
|
||||
0xFB: "[Next]\n",
|
||||
0xFC: {
|
||||
0x01: "[Style right]\n",
|
||||
0x02: "[Style left]\n",
|
||||
0x03: "[Style center]\n",
|
||||
0x04: "[Style tattle]\n",
|
||||
0x05: {
|
||||
None: lambda d: (
|
||||
f"[Style choice pos={d[0]},{d[1]} size={d[2]},{d[3]}]\n",
|
||||
4,
|
||||
)
|
||||
},
|
||||
0x06: "[Style inspect]\n",
|
||||
0x07: "[Style sign]\n",
|
||||
0x08: {None: lambda d: (f"[Style lamppost height={d[0]}]\n", 1)},
|
||||
0x09: {None: lambda d: (f"[Style postcard index={d[0]}]\n", 1)},
|
||||
0x0A: "[Style popup]\n",
|
||||
0x0C: {
|
||||
None: lambda d: (
|
||||
f"[Style upgrade pos={d[0]},{d[1]} size={d[2]},{d[3]}]\n",
|
||||
4,
|
||||
)
|
||||
},
|
||||
0x0D: "[Style narrate]\n",
|
||||
0x0E: "[Style epilogue]\n",
|
||||
},
|
||||
0xFF: {
|
||||
0x00: {
|
||||
0: "[Font standard]\n",
|
||||
1: "[Font menu]\n",
|
||||
3: "[Font title]\n",
|
||||
4: "[Font subtitle]\n",
|
||||
},
|
||||
0x04: "[Yield]",
|
||||
0x05: {
|
||||
# 0x0A: "[color:normal]",
|
||||
# 0x20: "[color:red]",
|
||||
# 0x21: "[color:pink]",
|
||||
# 0x22: "[color:purple]",
|
||||
# 0x23: "[color:blue]",
|
||||
# 0x24: "[color:cyan]",
|
||||
# 0x25: "[color:green]",
|
||||
# 0x26: "[color:yellow]",
|
||||
# 0x00: "[color=normal ctx=diary]",
|
||||
# 0x07: "[color=red ctx=diary]",
|
||||
# 0x17: "[color=dark ctx=inspect]",
|
||||
# 0x18: "[color=normal ctx=sign]",
|
||||
# 0x19: "[color=red ctx=sign]",
|
||||
# 0x1A: "[color=blue ctx=sign]",
|
||||
# 0x1B: "[color=green ctx=sign]",
|
||||
# 0x28: "[color=red ctx=popup]",
|
||||
# 0x29: "[color=pink ctx=popup]",
|
||||
# 0x2A: "[color=purple ctx=popup]",
|
||||
# 0x2B: "[color=blue ctx=popup]",
|
||||
# 0x2C: "[color=teal ctx=popup]",
|
||||
# 0x2D: "[color=green ctx=popup]",
|
||||
# 0x2E: "[color=yellow ctx=popup]",
|
||||
# 0x2F: "[color=normal ctx=popup]",
|
||||
None: lambda d: (f"[Color 0x{d[0]:X}]", 1),
|
||||
},
|
||||
0x07: "[InputOff]\n",
|
||||
0x08: "[InputOn]\n",
|
||||
0x09: "[DelayOff]\n",
|
||||
0x0A: "[DelayOn]\n",
|
||||
0x0B: {None: lambda d: (f"[CharWidth {d[0]}]", 1)},
|
||||
0x0C: {None: lambda d: (f"[Scroll {d[0]}]", 1)},
|
||||
0x0D: {None: lambda d: (f"[Size {d[0]},{d[1]}]\n", 2)},
|
||||
0x0E: "[SizeReset]\n",
|
||||
0x0F: {None: lambda d: (f"[Speed delay={d[0]} chars={d[1]}]", 2)},
|
||||
0x10: {None: lambda d: (f"[SetPosX {(d[0] << 8) + d[1]}]", 2)},
|
||||
0x11: {None: lambda d: (f"[SetPosY {d[0]}]", 1)},
|
||||
0x12: {None: lambda d: (f"[Right {d[0]}]", 1)},
|
||||
0x13: {None: lambda d: (f"[Down {d[0]}]", 1)},
|
||||
0x14: {None: lambda d: (f"[Up {d[0]}]", 1)},
|
||||
0x15: {None: lambda d: (f"[InlineImage index={d[0]}]\n", 1)},
|
||||
0x16: {
|
||||
None: lambda d: (
|
||||
f"[AnimSprite spriteID=0x{d[0]:02X}{d[1]:02X} raster={d[2]}]\n",
|
||||
3,
|
||||
)
|
||||
},
|
||||
0x17: {None: lambda d: (f"[ItemIcon itemID=0x{d[0]:02X}{d[1]:02X}]\n", 2)},
|
||||
0x18: {
|
||||
None: lambda d: (
|
||||
f"[Image index={d[0]} pos={(d[1] << 8) + d[2]},{d[3]} hasBorder={d[4]} alpha={d[5]} fadeAmount={d[6]}]\n",
|
||||
7,
|
||||
)
|
||||
},
|
||||
0x19: {None: lambda d: (f"[HideImage fadeAmount={d[0]}]\n", 1)},
|
||||
0x1A: {None: lambda d: (f"[AnimDelay index={d[1]} delay={d[2]}]", 3)},
|
||||
0x1B: {None: lambda d: (f"[AnimLoop {d[0]} {d[1]}]", 2)},
|
||||
0x1C: {None: lambda d: (f"[AnimDone {d[0]}]", 1)},
|
||||
0x1E: {None: lambda d: (f"[Cursor {d[0]}]", 1)},
|
||||
0x1F: {None: lambda d: (f"[EndChoice {d[0]}]", 1)},
|
||||
0x20: {None: lambda d: (f"[SetCancel {d[0]}]", 1)},
|
||||
0x21: {None: lambda d: (f"[Option {d[0]}]", 1)},
|
||||
0x22: "[SavePos]",
|
||||
0x23: "[RestorePos]",
|
||||
0x24: {
|
||||
0xFF: {
|
||||
0x05: {
|
||||
0x10: {0x98: {0xFF: {0x25: "[A]"}}},
|
||||
0x11: {0x99: {0xFF: {0x25: "[B]"}}},
|
||||
0x12: {0xA1: {0xFF: {0x25: "[START]"}}},
|
||||
0x13: {
|
||||
0x9D: {0xFF: {0x25: "[C-UP]"}},
|
||||
0x9E: {0xFF: {0x25: "[C-DOWN]"}},
|
||||
0x9F: {0xFF: {0x25: "[C-LEFT]"}},
|
||||
0xA0: {0xFF: {0x25: "[C-RIGHT]"}},
|
||||
},
|
||||
0x14: {0x9C: {0xFF: {0x25: "[Z]"}}},
|
||||
}
|
||||
}
|
||||
},
|
||||
# 0x24: "[SaveColor]",
|
||||
# 0x25: "[RestoreColor]",
|
||||
0x26: {
|
||||
0x00: "[Shake]",
|
||||
0x01: "[Wave]",
|
||||
0x02: "[NoiseOutline]",
|
||||
0x03: {None: lambda d: (f"[Static {d[0]}]", 1)},
|
||||
0x05: {None: lambda d: (f"[Blur dir={['x', 'y', 'xy'][d[0]]}]", 1)},
|
||||
0x07: {None: lambda d: (f"[DitherFade {d[0]}]", 1)},
|
||||
0x0A: "[PrintRising]",
|
||||
0x0B: "[PrintGrowing]",
|
||||
0x0C: "[SizeJitter]",
|
||||
0x0D: "[SizeWave]",
|
||||
0x0E: "[DropShadow]",
|
||||
},
|
||||
0x27: {
|
||||
0x00: "[/Shake]",
|
||||
0x01: "[/Wave]",
|
||||
0x03: "[/Static]",
|
||||
0x05: "[/Blur]",
|
||||
0x07: "[/DitherFade]",
|
||||
0x0A: "[/PrintRising]",
|
||||
0x0B: "[/PrintGrowing]",
|
||||
0x0C: "[/SizeJitter]",
|
||||
0x0D: "[/SizeWave]",
|
||||
0x0E: "[/DropShadow]",
|
||||
},
|
||||
0x28: {None: lambda d: (f"[Var {d[0]}]", 1)},
|
||||
0x29: {None: lambda d: (f"[CenterX {d[0]}]", 1)},
|
||||
0x2B: "[EnableCDownNext]",
|
||||
0x2C: {
|
||||
None: lambda d: (
|
||||
f"[CustomVoice soundIDs=0x{d[0]:02X}{d[1]:02X}{d[2]:02X}{d[3]:02X},{d[4]:02X}{d[5]:02X}{d[6]:02X}{d[7]:02X}]",
|
||||
8,
|
||||
)
|
||||
},
|
||||
0x2E: {None: lambda d: (f"[Volume {d[0]}]", 1)},
|
||||
0x2F: {
|
||||
0: "[Voice normal]\n",
|
||||
1: "[Voice bowser]\n",
|
||||
2: "[Voice star]\n",
|
||||
None: lambda d: (f"[Voice {d[0]}]\n", 1),
|
||||
},
|
||||
# None: lambda d: (f"[func_{d[0]:02X}]", 1),
|
||||
},
|
||||
None: lambda d: (f"[Raw 0x{d[0]:02X}]", 1),
|
||||
}
|
||||
|
||||
CHARSET_CREDITS = {
|
||||
**CHARSET,
|
||||
**CHARSET_COMMON,
|
||||
0x00: "A",
|
||||
0x01: "B",
|
||||
0x02: "C",
|
||||
@ -387,7 +394,419 @@ CHARSET_CREDITS = {
|
||||
0x26: "9",
|
||||
0x27: "©",
|
||||
0x28: "&",
|
||||
}
|
||||
|
||||
CHARSET_JP_COMMON = {
|
||||
**CHARSET_COMMON,
|
||||
0xF3: "[Charset Kana]",
|
||||
0xF4: "[Charset Latin]",
|
||||
0xF5: "[Charset Kanji]",
|
||||
0xF6: "[Charset Buttons]",
|
||||
0xF7: " ",
|
||||
0xF8: " ",
|
||||
0xF9: "[HALFSPACE]",
|
||||
0xFF: {
|
||||
**CHARSET_COMMON[0xFF],
|
||||
0x24: {
|
||||
0xFF: {
|
||||
0x05: {
|
||||
0x10: {0xF6: {0x00: {0xFF: {0x25: "[A]"}}}},
|
||||
0x11: {0xF6: {0x01: {0xFF: {0x25: "[B]"}}}},
|
||||
0x12: {0xF6: {0x02: {0xFF: {0x25: "[START]"}}}},
|
||||
0x13: {
|
||||
0xF6: {
|
||||
0x03: {0xFF: {0x25: "[C-UP]"}},
|
||||
0x04: {0xFF: {0x25: "[C-DOWN]"}},
|
||||
0x05: {0xFF: {0x25: "[C-LEFT]"}},
|
||||
0x06: {0xFF: {0x25: "[C-RIGHT]"}},
|
||||
}
|
||||
},
|
||||
0x14: {
|
||||
0xF6: {
|
||||
0x07: {0xFF: {0x25: "[Z]"}},
|
||||
0x08: {0xFF: {0x25: "[L]"}},
|
||||
0x09: {0xFF: {0x25: "[R]"}},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
CHARSET_KANA = {
|
||||
**CHARSET_JP_COMMON,
|
||||
0x00: "あ",
|
||||
0x01: "い",
|
||||
0x02: "う",
|
||||
0x03: "え",
|
||||
0x04: "お",
|
||||
0x05: "か",
|
||||
0x06: "き",
|
||||
0x07: "く",
|
||||
0x08: "け",
|
||||
0x09: "こ",
|
||||
0x0A: "さ",
|
||||
0x0B: "し",
|
||||
0x0C: "す",
|
||||
0x0D: "せ",
|
||||
0x0E: "そ",
|
||||
0x0F: "た",
|
||||
0x10: "ち",
|
||||
0x11: "つ",
|
||||
0x12: "て",
|
||||
0x13: "と",
|
||||
0x14: "な",
|
||||
0x15: "に",
|
||||
0x16: "ぬ",
|
||||
0x17: "ね",
|
||||
0x18: "の",
|
||||
0x19: "は",
|
||||
0x1A: "ひ",
|
||||
0x1B: "ふ",
|
||||
0x1C: "へ",
|
||||
0x1D: "ほ",
|
||||
0x1E: "ま",
|
||||
0x1F: "み",
|
||||
0x20: "む",
|
||||
0x21: "め",
|
||||
0x22: "も",
|
||||
0x23: "や",
|
||||
0x24: "ゆ",
|
||||
0x25: "よ",
|
||||
0x26: "ら",
|
||||
0x27: "り",
|
||||
0x28: "る",
|
||||
0x29: "れ",
|
||||
0x2A: "ろ",
|
||||
0x2B: "わ",
|
||||
0x2C: "を",
|
||||
0x2D: "ん",
|
||||
0x2E: "ゔ",
|
||||
0x2F: "が",
|
||||
0x30: "ぎ",
|
||||
0x31: "ぐ",
|
||||
0x32: "げ",
|
||||
0x33: "ご",
|
||||
0x34: "ざ",
|
||||
0x35: "じ",
|
||||
0x36: "ず",
|
||||
0x37: "ぜ",
|
||||
0x38: "ぞ",
|
||||
0x39: "だ",
|
||||
0x3A: "ぢ",
|
||||
0x3B: "づ",
|
||||
0x3C: "で",
|
||||
0x3D: "ど",
|
||||
0x3E: "ば",
|
||||
0x3F: "び",
|
||||
0x40: "ぶ",
|
||||
0x41: "べ",
|
||||
0x42: "ぼ",
|
||||
0x43: "ぱ",
|
||||
0x44: "ぴ",
|
||||
0x45: "ぷ",
|
||||
0x46: "ぺ",
|
||||
0x47: "ぽ",
|
||||
0x48: "ぁ",
|
||||
0x49: "ぃ",
|
||||
0x4A: "ぅ",
|
||||
0x4B: "ぇ",
|
||||
0x4C: "ぉ",
|
||||
0x4D: "っ",
|
||||
0x4E: "ゃ",
|
||||
0x4F: "ゅ",
|
||||
0x50: "ょ",
|
||||
0x51: "ア",
|
||||
0x52: "イ",
|
||||
0x53: "ウ",
|
||||
0x54: "エ",
|
||||
0x55: "オ",
|
||||
0x56: "カ",
|
||||
0x57: "キ",
|
||||
0x58: "ク",
|
||||
0x59: "ケ",
|
||||
0x5A: "コ",
|
||||
0x5B: "サ",
|
||||
0x5C: "シ",
|
||||
0x5D: "ス",
|
||||
0x5E: "セ",
|
||||
0x5F: "ソ",
|
||||
0x60: "タ",
|
||||
0x61: "チ",
|
||||
0x62: "ツ",
|
||||
0x63: "テ",
|
||||
0x64: "ト",
|
||||
0x65: "ナ",
|
||||
0x66: "ニ",
|
||||
0x67: "ヌ",
|
||||
0x68: "ネ",
|
||||
0x69: "ノ",
|
||||
0x6A: "ハ",
|
||||
0x6B: "ヒ",
|
||||
0x6C: "フ",
|
||||
0x6D: "ヘ",
|
||||
0x6E: "ホ",
|
||||
0x6F: "マ",
|
||||
0x70: "ミ",
|
||||
0x71: "ム",
|
||||
0x72: "メ",
|
||||
0x73: "モ",
|
||||
0x74: "ヤ",
|
||||
0x75: "ユ",
|
||||
0x76: "ヨ",
|
||||
0x77: "ラ",
|
||||
0x78: "リ",
|
||||
0x79: "ル",
|
||||
0x7A: "レ",
|
||||
0x7B: "ロ",
|
||||
0x7C: "ワ",
|
||||
0x7D: "ヲ",
|
||||
0x7E: "ン",
|
||||
0x7F: "ヴ",
|
||||
0x80: "ガ",
|
||||
0x81: "ギ",
|
||||
0x82: "グ",
|
||||
0x83: "ゲ",
|
||||
0x84: "ゴ",
|
||||
0x85: "ザ",
|
||||
0x86: "ジ",
|
||||
0x87: "ズ",
|
||||
0x88: "ゼ",
|
||||
0x89: "ゾ",
|
||||
0x8A: "ダ",
|
||||
0x8B: "ヂ",
|
||||
0x8C: "ヅ",
|
||||
0x8D: "デ",
|
||||
0x8E: "ド",
|
||||
0x8F: "バ",
|
||||
0x90: "ビ",
|
||||
0x91: "ブ",
|
||||
0x92: "ベ",
|
||||
0x93: "ボ",
|
||||
0x94: "パ",
|
||||
0x95: "ピ",
|
||||
0x96: "プ",
|
||||
0x97: "ペ",
|
||||
0x98: "ポ",
|
||||
0x99: "ァ",
|
||||
0x9A: "ィ",
|
||||
0x9B: "ゥ",
|
||||
0x9C: "ェ",
|
||||
0x9D: "ォ",
|
||||
0x9E: "ッ",
|
||||
0x9F: "ャ",
|
||||
0xA0: "ュ",
|
||||
0xA1: "ョ",
|
||||
0xA2: "ー",
|
||||
0xA3: "~",
|
||||
0xA4: {0xA5: {0xA6: "[LONGDASH]"}},
|
||||
0xA7: "0",
|
||||
0xA8: "1",
|
||||
0xA9: "2",
|
||||
0xAA: "3",
|
||||
0xAB: "4",
|
||||
0xAC: "5",
|
||||
0xAD: "6",
|
||||
0xAE: "7",
|
||||
0xAF: "8",
|
||||
0xB0: "9",
|
||||
0xB1: "[UP]",
|
||||
0xB2: "[DOWN]",
|
||||
0xB3: "[LEFT]",
|
||||
0xB4: "[RIGHT]",
|
||||
0xB5: "!",
|
||||
0xB6: "?",
|
||||
0xB7: "+",
|
||||
0xB8: "-",
|
||||
0xB9: "/",
|
||||
0xBA: ".",
|
||||
0xBB: "&",
|
||||
0xBC: "#",
|
||||
0xBD: "[HEART]",
|
||||
0xBE: "[STAR]",
|
||||
0xBF: "(",
|
||||
0xC0: ")",
|
||||
0xC1: "『",
|
||||
0xC2: "』",
|
||||
0xC3: "・",
|
||||
0xC4: "[HIRAGANA SmallN]",
|
||||
0xC5: "[KATAKANA SmallN]",
|
||||
# existing characters without small counterparts
|
||||
# 0xC4: "ん",
|
||||
# 0xC5: "ン",
|
||||
0xC6: "星",
|
||||
# 0xC7 is unused
|
||||
}
|
||||
|
||||
CHARSET_LATIN = {
|
||||
**CHARSET_JP_COMMON,
|
||||
0x00: "A",
|
||||
0x01: "B",
|
||||
0x02: "C",
|
||||
0x03: "D",
|
||||
0x04: "E",
|
||||
0x05: "F",
|
||||
0x06: "G",
|
||||
0x07: "H",
|
||||
0x08: "I",
|
||||
0x09: "J",
|
||||
0x0A: "K",
|
||||
0x0B: "L",
|
||||
0x0C: "M",
|
||||
0x0D: "N",
|
||||
0x0E: "O",
|
||||
0x0F: "P",
|
||||
0x10: "Q",
|
||||
0x11: "R",
|
||||
0x12: "S",
|
||||
0x13: "T",
|
||||
0x14: "U",
|
||||
0x15: "V",
|
||||
0x16: "W",
|
||||
0x17: "X",
|
||||
0x18: "Y",
|
||||
0x19: "Z",
|
||||
0x1A: "z",
|
||||
}
|
||||
|
||||
CHARSET_KANJI = {
|
||||
**CHARSET_JP_COMMON,
|
||||
0x00: "上",
|
||||
0x01: "下",
|
||||
0x02: "左",
|
||||
0x03: "右",
|
||||
0x04: "中",
|
||||
0x05: "東",
|
||||
0x06: "西",
|
||||
0x07: "南",
|
||||
0x08: "北",
|
||||
0x09: "一",
|
||||
0x0A: "二",
|
||||
0x0B: "三",
|
||||
0x0C: "名",
|
||||
0x0D: "国",
|
||||
0x0E: "城",
|
||||
0x0F: "姫",
|
||||
0x10: "大",
|
||||
0x11: "王",
|
||||
0x12: "花",
|
||||
0x13: "世",
|
||||
0x14: "界",
|
||||
0x15: "草",
|
||||
0x16: "気",
|
||||
0x17: "間",
|
||||
0x18: "門",
|
||||
0x19: "家",
|
||||
0x1A: "地",
|
||||
0x1B: "岩",
|
||||
0x1C: "駅",
|
||||
0x1D: "山",
|
||||
0x1E: "海",
|
||||
0x1F: "火",
|
||||
0x20: "水",
|
||||
0x21: "氷",
|
||||
0x22: "日",
|
||||
0x23: "根",
|
||||
0x24: "雲",
|
||||
0x25: "口",
|
||||
0x26: "原",
|
||||
0x27: "前",
|
||||
0x28: "店",
|
||||
0x29: "天",
|
||||
0x2A: "森",
|
||||
0x2B: "木",
|
||||
0x2C: "力",
|
||||
0x2D: "空",
|
||||
0x2E: "人",
|
||||
0x2F: "島",
|
||||
0x30: "出",
|
||||
0x31: "入",
|
||||
0x32: "本",
|
||||
0x33: "石",
|
||||
0x34: "村",
|
||||
0x35: "休",
|
||||
0x36: "先",
|
||||
0x37: "見",
|
||||
0x38: "近",
|
||||
0x39: "方",
|
||||
0x3A: "法",
|
||||
0x3B: "手",
|
||||
0x3C: "紙",
|
||||
0x3D: "引",
|
||||
0x3E: "場",
|
||||
0x3F: "所",
|
||||
0x40: "使",
|
||||
0x41: "回",
|
||||
0x42: "道",
|
||||
0x43: "物",
|
||||
0x44: "弟",
|
||||
0x45: "子",
|
||||
0x46: "汽",
|
||||
0x47: "車",
|
||||
0x48: "何",
|
||||
0x49: "黒",
|
||||
0x4A: "分",
|
||||
0x4B: "時",
|
||||
0x4C: "屋",
|
||||
0x4D: "音",
|
||||
0x4E: "目",
|
||||
0x4F: "行",
|
||||
0x50: "絵",
|
||||
0x51: "月",
|
||||
0x52: "野",
|
||||
0x53: "外",
|
||||
0x54: "図",
|
||||
0x55: "部",
|
||||
0x56: "小",
|
||||
0x57: "風",
|
||||
0x58: "魔",
|
||||
0x59: "元",
|
||||
0x5A: "太",
|
||||
0x5B: "陽",
|
||||
0x5C: "実",
|
||||
0x5D: "赤",
|
||||
0x5E: "雪",
|
||||
0x5F: "谷",
|
||||
0x60: "通",
|
||||
0x61: "[CIRCLE]",
|
||||
0x62: "[CROSS]",
|
||||
0x63: "長",
|
||||
0x64: "話",
|
||||
0x65: "色",
|
||||
0x66: "光",
|
||||
0x67: "合",
|
||||
0x68: "青",
|
||||
0x69: "黄",
|
||||
0x6A: "[NOTE]",
|
||||
0x6B: "当",
|
||||
0x6C: "数",
|
||||
0x6D: "兄",
|
||||
0x6E: "用",
|
||||
0x6F: "心",
|
||||
0x70: "今",
|
||||
0x71: "正",
|
||||
0x72: "直",
|
||||
0x73: "全",
|
||||
0x74: "体",
|
||||
0x75: "夜",
|
||||
0x76: "面",
|
||||
0x77: "虫",
|
||||
0x78: "x",
|
||||
}
|
||||
|
||||
CHARSET_BUTTONS = {
|
||||
**CHARSET_JP_COMMON,
|
||||
0x00: "[~A]",
|
||||
0x01: "[~B]",
|
||||
0x02: "[~START]",
|
||||
0x03: "[~C-UP]",
|
||||
0x04: "[~C-DOWN]",
|
||||
0x05: "[~C-LEFT]",
|
||||
0x06: "[~C-RIGHT]",
|
||||
0x07: "[~Z]",
|
||||
0x08: "[~L]",
|
||||
0x09: "[~R]",
|
||||
}
|
||||
|
||||
|
||||
@ -488,7 +907,10 @@ class N64SegPm_msg(N64Segment):
|
||||
|
||||
def write_message_markup(self, data):
|
||||
pos = 0
|
||||
self.root_charset = CHARSET
|
||||
if "ver/jp" in str(options.opts.target_path):
|
||||
self.root_charset = CHARSET_KANA
|
||||
else:
|
||||
self.root_charset = CHARSET_STANDARD
|
||||
|
||||
while data[pos] != 0xFD:
|
||||
self.charset = self.root_charset
|
||||
@ -531,7 +953,16 @@ class N64SegPm_msg(N64Segment):
|
||||
if markup_lower == "[font title]\n" or markup_lower == "[font subtitle]\n":
|
||||
self.root_charset = CHARSET_CREDITS
|
||||
elif markup_lower == "[font standard]":
|
||||
self.root_charset = CHARSET
|
||||
self.root_charset = CHARSET_STANDARD
|
||||
elif "ver/jp" in str(options.opts.target_path):
|
||||
if markup_lower == "[charset kana]":
|
||||
self.root_charset = CHARSET_KANA
|
||||
elif markup_lower == "[charset latin]":
|
||||
self.root_charset = CHARSET_LATIN
|
||||
elif markup_lower == "[charset kanji]":
|
||||
self.root_charset = CHARSET_KANJI
|
||||
elif markup_lower == "[charset buttons]":
|
||||
self.root_charset = CHARSET_BUTTONS
|
||||
|
||||
def cache(self):
|
||||
return (self.yaml, self.rom_end, self.msg_names)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -3282,8 +3282,60 @@ segments:
|
||||
- [0x1C7F208, bin ]
|
||||
|
||||
- start: 0x1D40000
|
||||
type: bin
|
||||
name: pm_msg # TODO: fix message dumping for JP
|
||||
type: pm_msg
|
||||
name: msg_jp
|
||||
files:
|
||||
- 00_Intro
|
||||
- 01_Outro
|
||||
- 02_ToadTownGate
|
||||
- 03_ToadTownPlaza
|
||||
- 04_ToadTownBridge
|
||||
- 05_ToadTownStation
|
||||
- 06_ToadTownHousing
|
||||
- 07_ToadTownPort
|
||||
- 08_Minigame
|
||||
- 09_CastleGrounds
|
||||
- 0A_ShootingStarSummit
|
||||
- 0B_Prologue
|
||||
- 0C_Chapter1
|
||||
- 0D_Chapter2
|
||||
- 0E_Chapter3
|
||||
- 0F_Chapter4
|
||||
- 10_Chapter5
|
||||
- 11_Chapter6
|
||||
- 12_Chapter7
|
||||
- 13_Chapter8
|
||||
- 14_Peach
|
||||
- 15_KootFavors
|
||||
- 16_RussTHints
|
||||
- 17_Unused
|
||||
- 18_Unused
|
||||
- 19_NewsBoard
|
||||
- 1A_GossipBoard
|
||||
- 1B_MapTattles
|
||||
- 1C_NpcTattles
|
||||
- 1D_EntityTattles
|
||||
- 1E_EnemyTattles
|
||||
- 1F_Unused
|
||||
- 20_Menus
|
||||
- 21_Choices
|
||||
- 22_MenuTips
|
||||
- 23_Documents
|
||||
- 24_QuizQuestions
|
||||
- 25_QuizChoices
|
||||
- 26_MerlonHints
|
||||
- 27_MerluvleeHints
|
||||
- 28_ShortItemDesc
|
||||
- 29_ShopItemDesc
|
||||
- 2A_FullItemDesc
|
||||
- 2B_ItemNames
|
||||
- 2C_PlayerMoves
|
||||
- 2D_Shops
|
||||
- 2E_PartnerDesc
|
||||
- 2F_PartnerMoves
|
||||
- 30_TestStrings
|
||||
- 31_EnemyNames
|
||||
- 32_Credits
|
||||
|
||||
- [0x1DDBE60, bin]
|
||||
- [0x1E00000, pm_map_data, mapfs]
|
||||
|
Loading…
Reference in New Issue
Block a user