From d0ae1ed6bfc859c88ec110588b94b327a0bb9154 Mon Sep 17 00:00:00 2001 From: Lavos1 Date: Thu, 12 Nov 2020 00:42:34 +0000 Subject: [PATCH 1/8] Fix a few functions --- src/code_190B20.c | 25 +++++++++---------------- src/code_e79b0_len_1920.c | 8 ++------ 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/code_190B20.c b/src/code_190B20.c index d529a73fd5..f28b96e7d9 100644 --- a/src/code_190B20.c +++ b/src/code_190B20.c @@ -93,7 +93,6 @@ INCLUDE_ASM(s32, "code_190B20", func_80265CE8); INCLUDE_ASM(s32, "code_190B20", func_80265D44); -#ifdef NON_MATCHING typedef struct { Element element; s32 defense; @@ -103,22 +102,20 @@ s32 lookup_defense(DefenseTableEntry* defenseTable, Element elementKey) { DefenseTableEntry* row; s32 normalDefense = 0; - for (row = defenseTable; row->element != Element_END; row++) { + for (row = defenseTable; row->element != Element_END; row++, defenseTable++) { if (row->element == Element_NORMAL) { - normalDefense = row->defense; + normalDefense = defenseTable->defense; } if (row->element == elementKey) { - return row->defense; + normalDefense = defenseTable->defense; + break; } } // Fall back to normal defense if given element is not specified in table return normalDefense; } -#else -INCLUDE_ASM(s32, "code_190B20", lookup_defense); -#endif INCLUDE_ASM(s32, "code_190B20", lookup_status_chance); // exactly (?) the same as lookup_defense @@ -284,23 +281,19 @@ INCLUDE_ASM(s32, "code_190B20", func_8026709C); INCLUDE_ASM(s32, "code_190B20", func_802670C8); -#ifdef NON_MATCHING -// Register allocation issues (decorationIndex is placed in s2 for seemingly no reason?). -// Should be easy to clean up once DecorationTable is more understood void add_part_decoration(ActorPart* part, s32 decorationIndex, DecorationId decorationType) { - if (part->idleAnimations && (part->flags & 2) == 0) { - DecorationTable* decoration = &part->decorationTable->unk_00[decorationIndex]; + if ((part->idleAnimations) && !(part->flags & 2)) { + char* decorationTable = part->decorationTable->unk_00; + DecorationTable* decoration; + _remove_part_decoration(part, decorationIndex); + decoration = decorationTable + decorationIndex; decoration->decorationType[0] = decorationType; decoration->unk_8BA = 1; decoration->unk_8BC = 0; func_8025CEC8(part); } } -#else -INCLUDE_ASM(void, "code_190B20", add_part_decoration, ActorPart* part, s32 decorationIndex, - DecorationId decorationType); -#endif void add_actor_decoration(Actor* actor, s32 decorationIndex, DecorationId decorationType) { ActorPart* part; diff --git a/src/code_e79b0_len_1920.c b/src/code_e79b0_len_1920.c index aa25db64af..4d11e63300 100644 --- a/src/code_e79b0_len_1920.c +++ b/src/code_e79b0_len_1920.c @@ -52,8 +52,6 @@ void sort_scripts(void) { INCLUDE_ASM(s32, "code_e79b0_len_1920", sort_scripts); #endif -#ifdef NON_MATCHING -// Very close. Reordering/branch likely issues void find_script_labels(ScriptInstance* script) { Bytecode* curLine; s32 type; @@ -69,7 +67,7 @@ void find_script_labels(ScriptInstance* script) { j = 0; curLine = script->ptrNextLine; - for (j = 0; j < ARRAY_COUNT(script->labelIndices); j++) { + while (j < ARRAY_COUNT(script->labelIndices)) { type = *curLine++; numArgs = *curLine++; label = *curLine; @@ -82,13 +80,11 @@ void find_script_labels(ScriptInstance* script) { if (type == 3) { script->labelIndices[j] = label; script->labelPositions[j] = curLine; + j++; } } PANIC(); } -#else -INCLUDE_ASM(void, "code_e79b0_len_1920", find_script_labels); -#endif void clear_script_list(void) { s32 i; From b3c8870efb63bc6d8f17bd5216f565dc93cbffe4 Mon Sep 17 00:00:00 2001 From: Lavos1 Date: Thu, 12 Nov 2020 10:27:07 +0000 Subject: [PATCH 2/8] PR --- .../code_190B20/add_part_decoration.s | 36 --------------- asm/nonmatchings/code_190B20/lookup_defense.s | 29 ------------ .../code_e79b0_len_1920/find_script_labels.s | 46 ------------------- src/code_190B20.c | 2 +- 4 files changed, 1 insertion(+), 112 deletions(-) delete mode 100644 asm/nonmatchings/code_190B20/add_part_decoration.s delete mode 100644 asm/nonmatchings/code_190B20/lookup_defense.s delete mode 100644 asm/nonmatchings/code_e79b0_len_1920/find_script_labels.s diff --git a/asm/nonmatchings/code_190B20/add_part_decoration.s b/asm/nonmatchings/code_190B20/add_part_decoration.s deleted file mode 100644 index cf2ec1ff96..0000000000 --- a/asm/nonmatchings/code_190B20/add_part_decoration.s +++ /dev/null @@ -1,36 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel add_part_decoration -/* 1959F4 80267114 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* 1959F8 80267118 AFB10014 */ sw $s1, 0x14($sp) -/* 1959FC 8026711C 0080882D */ daddu $s1, $a0, $zero -/* 195A00 80267120 AFB20018 */ sw $s2, 0x18($sp) -/* 195A04 80267124 00A0902D */ daddu $s2, $a1, $zero -/* 195A08 80267128 AFBF0020 */ sw $ra, 0x20($sp) -/* 195A0C 8026712C AFB3001C */ sw $s3, 0x1c($sp) -/* 195A10 80267130 AFB00010 */ sw $s0, 0x10($sp) -/* 195A14 80267134 8E220094 */ lw $v0, 0x94($s1) -/* 195A18 80267138 1040000E */ beqz $v0, .L80267174 -/* 195A1C 8026713C 00C0982D */ daddu $s3, $a2, $zero -/* 195A20 80267140 8E220000 */ lw $v0, ($s1) -/* 195A24 80267144 30420002 */ andi $v0, $v0, 2 -/* 195A28 80267148 1440000A */ bnez $v0, .L80267174 -/* 195A2C 8026714C 00000000 */ nop -/* 195A30 80267150 8E3000C0 */ lw $s0, 0xc0($s1) -/* 195A34 80267154 0C09740F */ jal _remove_part_decoration -/* 195A38 80267158 02128021 */ addu $s0, $s0, $s2 -/* 195A3C 8026715C 0220202D */ daddu $a0, $s1, $zero -/* 195A40 80267160 24020001 */ addiu $v0, $zero, 1 -/* 195A44 80267164 A21308B8 */ sb $s3, 0x8b8($s0) -/* 195A48 80267168 A20208BA */ sb $v0, 0x8ba($s0) -/* 195A4C 8026716C 0C0973B2 */ jal func_8025CEC8 -/* 195A50 80267170 A20008BC */ sb $zero, 0x8bc($s0) -.L80267174: -/* 195A54 80267174 8FBF0020 */ lw $ra, 0x20($sp) -/* 195A58 80267178 8FB3001C */ lw $s3, 0x1c($sp) -/* 195A5C 8026717C 8FB20018 */ lw $s2, 0x18($sp) -/* 195A60 80267180 8FB10014 */ lw $s1, 0x14($sp) -/* 195A64 80267184 8FB00010 */ lw $s0, 0x10($sp) -/* 195A68 80267188 03E00008 */ jr $ra -/* 195A6C 8026718C 27BD0028 */ addiu $sp, $sp, 0x28 diff --git a/asm/nonmatchings/code_190B20/lookup_defense.s b/asm/nonmatchings/code_190B20/lookup_defense.s deleted file mode 100644 index 748f80c3d8..0000000000 --- a/asm/nonmatchings/code_190B20/lookup_defense.s +++ /dev/null @@ -1,29 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel lookup_defense -/* 194724 80265E44 0080182D */ daddu $v1, $a0, $zero -/* 194728 80265E48 8C620000 */ lw $v0, ($v1) -/* 19472C 80265E4C 1040000F */ beqz $v0, .L80265E8C -/* 194730 80265E50 0000302D */ daddu $a2, $zero, $zero -/* 194734 80265E54 24070001 */ addiu $a3, $zero, 1 -/* 194738 80265E58 24840004 */ addiu $a0, $a0, 4 -/* 19473C 80265E5C 8C620000 */ lw $v0, ($v1) -.L80265E60: -/* 194740 80265E60 14470002 */ bne $v0, $a3, .L80265E6C -/* 194744 80265E64 00000000 */ nop -/* 194748 80265E68 8C860000 */ lw $a2, ($a0) -.L80265E6C: -/* 19474C 80265E6C 14450004 */ bne $v0, $a1, .L80265E80 -/* 194750 80265E70 24630008 */ addiu $v1, $v1, 8 -/* 194754 80265E74 8C860000 */ lw $a2, ($a0) -/* 194758 80265E78 03E00008 */ jr $ra -/* 19475C 80265E7C 00C0102D */ daddu $v0, $a2, $zero -.L80265E80: -/* 194760 80265E80 8C620000 */ lw $v0, ($v1) -/* 194764 80265E84 1440FFF6 */ bnez $v0, .L80265E60 -/* 194768 80265E88 24840008 */ addiu $a0, $a0, 8 -.L80265E8C: -/* 19476C 80265E8C 00C0102D */ daddu $v0, $a2, $zero -/* 194770 80265E90 03E00008 */ jr $ra -/* 194774 80265E94 00000000 */ nop diff --git a/asm/nonmatchings/code_e79b0_len_1920/find_script_labels.s b/asm/nonmatchings/code_e79b0_len_1920/find_script_labels.s deleted file mode 100644 index 943f2006b4..0000000000 --- a/asm/nonmatchings/code_e79b0_len_1920/find_script_labels.s +++ /dev/null @@ -1,46 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel find_script_labels -/* E7AF8 802C3148 0000182D */ daddu $v1, $zero, $zero -/* E7AFC 802C314C 2406FFFF */ addiu $a2, $zero, -1 -/* E7B00 802C3150 0080282D */ daddu $a1, $a0, $zero -.L802C3154: -/* E7B04 802C3154 00831021 */ addu $v0, $a0, $v1 -/* E7B08 802C3158 A0460010 */ sb $a2, 0x10($v0) -/* E7B0C 802C315C ACA00020 */ sw $zero, 0x20($a1) -/* E7B10 802C3160 24630001 */ addiu $v1, $v1, 1 -/* E7B14 802C3164 28620010 */ slti $v0, $v1, 0x10 -/* E7B18 802C3168 1440FFFA */ bnez $v0, .L802C3154 -/* E7B1C 802C316C 24A50004 */ addiu $a1, $a1, 4 -/* E7B20 802C3170 0000382D */ daddu $a3, $zero, $zero -/* E7B24 802C3174 8C830008 */ lw $v1, 8($a0) -/* E7B28 802C3178 240A0001 */ addiu $t2, $zero, 1 -/* E7B2C 802C317C 24090003 */ addiu $t1, $zero, 3 -/* E7B30 802C3180 0080402D */ daddu $t0, $a0, $zero -.L802C3184: -/* E7B34 802C3184 8C650000 */ lw $a1, ($v1) -/* E7B38 802C3188 24630004 */ addiu $v1, $v1, 4 -/* E7B3C 802C318C 8C620000 */ lw $v0, ($v1) -/* E7B40 802C3190 24630004 */ addiu $v1, $v1, 4 -/* E7B44 802C3194 8C660000 */ lw $a2, ($v1) -/* E7B48 802C3198 00021080 */ sll $v0, $v0, 2 -/* E7B4C 802C319C 10AA000D */ beq $a1, $t2, .L802C31D4 -/* E7B50 802C31A0 00621821 */ addu $v1, $v1, $v0 -/* E7B54 802C31A4 14A90007 */ bne $a1, $t1, .L802C31C4 -/* E7B58 802C31A8 28E20010 */ slti $v0, $a3, 0x10 -/* E7B5C 802C31AC 00871021 */ addu $v0, $a0, $a3 -/* E7B60 802C31B0 A0460010 */ sb $a2, 0x10($v0) -/* E7B64 802C31B4 AD030020 */ sw $v1, 0x20($t0) -/* E7B68 802C31B8 25080004 */ addiu $t0, $t0, 4 -/* E7B6C 802C31BC 24E70001 */ addiu $a3, $a3, 1 -/* E7B70 802C31C0 28E20010 */ slti $v0, $a3, 0x10 -.L802C31C4: -/* E7B74 802C31C4 1440FFEF */ bnez $v0, .L802C3184 -/* E7B78 802C31C8 00000000 */ nop -.L802C31CC: -/* E7B7C 802C31CC 080B0C73 */ j .L802C31CC -/* E7B80 802C31D0 00000000 */ nop -.L802C31D4: -/* E7B84 802C31D4 03E00008 */ jr $ra -/* E7B88 802C31D8 00000000 */ nop diff --git a/src/code_190B20.c b/src/code_190B20.c index f28b96e7d9..a795359b82 100644 --- a/src/code_190B20.c +++ b/src/code_190B20.c @@ -287,7 +287,7 @@ void add_part_decoration(ActorPart* part, s32 decorationIndex, DecorationId deco DecorationTable* decoration; _remove_part_decoration(part, decorationIndex); - decoration = decorationTable + decorationIndex; + decoration = &decorationTable[decorationIndex]; decoration->decorationType[0] = decorationType; decoration->unk_8BA = 1; decoration->unk_8BC = 0; From 53158279697745213c5919f48fcdaa6a15063b13 Mon Sep 17 00:00:00 2001 From: Lavos1 Date: Sun, 15 Nov 2020 23:15:59 +0000 Subject: [PATCH 3/8] Update DecorationTable --- include/common_structs.h | 7 +++---- src/code_190B20.c | 10 ++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/common_structs.h b/include/common_structs.h index 55c0498715..6c41cbbd02 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -1135,10 +1135,9 @@ typedef struct DecorationTable { /* 0x8AC */ u8 effectType; /* 0 = blur, 14 = none? */ /* 0x8AD */ char unk_8AD[11]; /* 0x8B8 */ u8 decorationType[2]; - /* 0x8BA */ u8 unk_8BA; - /* 0x8BB */ u8 unk_8BB; - /* 0x8BC */ u8 unk_8BC; - /* 0x8BD */ char unk_8BD[43]; + /* 0x8BA */ u8 unk_8BA[2]; + /* 0x8BC */ u8 unk_8BC[2]; + /* 0x8BD */ char unk_8BD[42]; } DecorationTable; // size = 0x8E8 typedef struct Shop { diff --git a/src/code_190B20.c b/src/code_190B20.c index a795359b82..73d2a494d4 100644 --- a/src/code_190B20.c +++ b/src/code_190B20.c @@ -283,14 +283,12 @@ INCLUDE_ASM(s32, "code_190B20", func_802670C8); void add_part_decoration(ActorPart* part, s32 decorationIndex, DecorationId decorationType) { if ((part->idleAnimations) && !(part->flags & 2)) { - char* decorationTable = part->decorationTable->unk_00; - DecorationTable* decoration; + DecorationTable* decorationTable = part->decorationTable; _remove_part_decoration(part, decorationIndex); - decoration = &decorationTable[decorationIndex]; - decoration->decorationType[0] = decorationType; - decoration->unk_8BA = 1; - decoration->unk_8BC = 0; + decorationTable->decorationType[decorationIndex] = decorationType; + decorationTable->unk_8BA[decorationIndex] = 1; + decorationTable->unk_8BC[decorationIndex] = 0; func_8025CEC8(part); } } From f558d0faa66ed34c0f71e6b5c0b0faaaceeb5306 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 18 Nov 2020 10:25:55 +0000 Subject: [PATCH 4/8] sonic --- tools/splat_ext/PaperMarioMessages.py | 55 ++++++++++++++++----------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/tools/splat_ext/PaperMarioMessages.py b/tools/splat_ext/PaperMarioMessages.py index 6a52397584..32141804f8 100644 --- a/tools/splat_ext/PaperMarioMessages.py +++ b/tools/splat_ext/PaperMarioMessages.py @@ -1,6 +1,8 @@ from segtypes.segment import N64Segment from pathlib import Path +import vmprof + CHARSET = { 0x00: "𝅘𝅥𝅮", 0x01: "!", @@ -349,6 +351,9 @@ class N64SegPaperMarioMessages(N64Segment): section_offsets.append(offset) pos += 4 + log = open("lol.bin", "w+b") + #vmprof.enable(log.fileno(), lines=True) + for i, section_offset in enumerate(section_offsets): name = f"{i:02X}" if len(self.files) >= i: @@ -376,6 +381,8 @@ class N64SegPaperMarioMessages(N64Segment): f.write(f"[message section=0x{i:02X} index={j}]\n") self.write_message_markup(data[msg_offset:], f) f.write("\n[/message]\n") + #vmprof.disable() + log.close() def get_ld_files(self): return [("", self.name, ".data")] @@ -400,31 +407,35 @@ class N64SegPaperMarioMessages(N64Segment): font = CHARSET def char_to_markup(self, data, charset=CHARSET): - value = None - char = int(data[0]) + pos = 0 + markup = [] - if char in charset: - value = charset[char] - elif None in charset: - value = charset[None] + while True: + char = data[pos] - if type(value) is str: - return value, 1 - if callable(value): - return value(data) - if type(value) is dict: - markup, delta = self.char_to_markup(data[1:], charset=value) + if char in charset: + value = charset[char] + elif None in charset: + value = charset[None] - if markup is None: + if value is None: + value = fallback + + if isinstance(value, str): + markup.append(value) + pos += 1 + break + elif callable(value): + more_markup, delta = value(data[1:]) + markup.append(more_markup) + pos += delta + break + elif isinstance(value, dict): if None in charset: - value = charset[None] - - if callable(value): - return value(data) - - return value, 1 + fallback = charset[None] + charset = value + pos += 1 else: - return markup, delta + 1 + raise ValueError(value) - - return None, 0 + return "".join(markup), pos # this is quicker than string appends From ec9684507448314c19b60ea8503126c8a9680005 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 18 Nov 2020 10:37:02 +0000 Subject: [PATCH 5/8] SPEED --- tools/splat_ext/PaperMarioMessages.py | 81 ++++++++++++--------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/tools/splat_ext/PaperMarioMessages.py b/tools/splat_ext/PaperMarioMessages.py index 32141804f8..fc8ee7380a 100644 --- a/tools/splat_ext/PaperMarioMessages.py +++ b/tools/splat_ext/PaperMarioMessages.py @@ -374,13 +374,13 @@ class N64SegPaperMarioMessages(N64Segment): path = Path(base_path, self.name, name + ".msg") path.parent.mkdir(parents=True, exist_ok=True) - with open(path, "w") as f: + with open(path, "w") as self.f: for j, msg_offset in enumerate(msg_offsets): if j != 0: - f.write("\n") - f.write(f"[message section=0x{i:02X} index={j}]\n") - self.write_message_markup(data[msg_offset:], f) - f.write("\n[/message]\n") + self.f.write("\n") + self.f.write(f"[message section=0x{i:02X} index={j}]\n") + self.write_message_markup(data[msg_offset:]) + self.f.write("\n[/message]\n") #vmprof.disable() log.close() @@ -391,51 +391,44 @@ class N64SegPaperMarioMessages(N64Segment): def get_default_name(addr): return "msg" - def write_message_markup(self, data, f): + def write_message_markup(self, data): pos = 0 - font = CHARSET while data[pos] != 0xFD: - markup, delta = self.char_to_markup(data[pos:], charset=font) + self.charset = CHARSET - f.write(markup) - pos += delta + while True: + char = data[pos] - if markup == "[font=title]\n" or markup == "[font=subtitle]\n": - font = CHARSET_CREDITS - elif markup == "[font=normal]": - font = CHARSET + if char in self.charset: + value = self.charset[char] + elif None in self.charset: + value = self.charset[None] - def char_to_markup(self, data, charset=CHARSET): - pos = 0 - markup = [] + if value is None: + value = fallback - while True: - char = data[pos] + if isinstance(value, str): + self.write_markup(value) + pos += 1 + break + elif callable(value): + markup, delta = value(data[1:]) + self.write_markup(markup) + pos += delta + break + elif isinstance(value, dict): + if None in self.charset: + fallback = self.charset[None] + self.charset = value + pos += 1 + else: + raise ValueError(value) - if char in charset: - value = charset[char] - elif None in charset: - value = charset[None] + def write_markup(self, markup): + self.f.write(markup) - if value is None: - value = fallback - - if isinstance(value, str): - markup.append(value) - pos += 1 - break - elif callable(value): - more_markup, delta = value(data[1:]) - markup.append(more_markup) - pos += delta - break - elif isinstance(value, dict): - if None in charset: - fallback = charset[None] - charset = value - pos += 1 - else: - raise ValueError(value) - - return "".join(markup), pos # this is quicker than string appends + if markup == "[font=title]\n" or markup == "[font=subtitle]\n": + self.charset = CHARSET_CREDITS + elif markup == "[font=normal]": + self.charset = CHARSET From a7f5ed8a369da50592931c2ba901258a29cd2e76 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 18 Nov 2020 10:45:01 +0000 Subject: [PATCH 6/8] remove vmprof stuff --- tools/splat_ext/PaperMarioMessages.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tools/splat_ext/PaperMarioMessages.py b/tools/splat_ext/PaperMarioMessages.py index fc8ee7380a..60840a6bf7 100644 --- a/tools/splat_ext/PaperMarioMessages.py +++ b/tools/splat_ext/PaperMarioMessages.py @@ -1,8 +1,6 @@ from segtypes.segment import N64Segment from pathlib import Path -import vmprof - CHARSET = { 0x00: "𝅘𝅥𝅮", 0x01: "!", @@ -351,9 +349,6 @@ class N64SegPaperMarioMessages(N64Segment): section_offsets.append(offset) pos += 4 - log = open("lol.bin", "w+b") - #vmprof.enable(log.fileno(), lines=True) - for i, section_offset in enumerate(section_offsets): name = f"{i:02X}" if len(self.files) >= i: @@ -381,8 +376,6 @@ class N64SegPaperMarioMessages(N64Segment): self.f.write(f"[message section=0x{i:02X} index={j}]\n") self.write_message_markup(data[msg_offset:]) self.f.write("\n[/message]\n") - #vmprof.disable() - log.close() def get_ld_files(self): return [("", self.name, ".data")] From a35b085c174b5e3d08f48ccfaf4a64ec5f00aedd Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 18 Nov 2020 10:56:56 +0000 Subject: [PATCH 7/8] fix credits font --- tools/splat_ext/PaperMarioMessages.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/splat_ext/PaperMarioMessages.py b/tools/splat_ext/PaperMarioMessages.py index 60840a6bf7..1b13cdd153 100644 --- a/tools/splat_ext/PaperMarioMessages.py +++ b/tools/splat_ext/PaperMarioMessages.py @@ -386,9 +386,10 @@ class N64SegPaperMarioMessages(N64Segment): def write_message_markup(self, data): pos = 0 + self.root_charset = CHARSET while data[pos] != 0xFD: - self.charset = CHARSET + self.charset = self.root_charset while True: char = data[pos] @@ -422,6 +423,6 @@ class N64SegPaperMarioMessages(N64Segment): self.f.write(markup) if markup == "[font=title]\n" or markup == "[font=subtitle]\n": - self.charset = CHARSET_CREDITS + self.root_charset = CHARSET_CREDITS elif markup == "[font=normal]": - self.charset = CHARSET + self.root_charset = CHARSET From 3c7ebe536d230d6fbdf3875f8e4e45297da183f1 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 18 Nov 2020 11:16:23 +0000 Subject: [PATCH 8/8] fix fallback lambdas --- tools/splat_ext/PaperMarioMessages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/splat_ext/PaperMarioMessages.py b/tools/splat_ext/PaperMarioMessages.py index 1b13cdd153..07aac08679 100644 --- a/tools/splat_ext/PaperMarioMessages.py +++ b/tools/splat_ext/PaperMarioMessages.py @@ -407,7 +407,7 @@ class N64SegPaperMarioMessages(N64Segment): pos += 1 break elif callable(value): - markup, delta = value(data[1:]) + markup, delta = value(data[pos:]) self.write_markup(markup) pos += delta break