From f64174730c8a27e8b604d1219915ca2b07c7b08a Mon Sep 17 00:00:00 2001 From: Roman971 Date: Mon, 30 Mar 2020 22:29:51 +0200 Subject: [PATCH] Decompile z_elf_message.c (1 non matching left) --- ...8006BBC0.s => ElfMessage_CheckCondition.s} | 2 +- .../code/z_elf_message/func_8006BE88.s | 44 ----- .../code/z_elf_message/func_8006BF1C.s | 144 --------------- .../code/z_elf_message/func_8006C0FC.s | 145 --------------- .../code/z_elf_message/func_8006C2B0.s | 32 ---- .../code/z_elf_message/func_8006C318.s | 18 -- .../actors/ovl_En_Elf/func_80A05040.s | 2 +- .../actors/ovl_En_Elf/func_80A05188.s | 2 +- .../actors/ovl_En_Elf/func_80A05208.s | 2 +- .../actors/ovl_En_Elf/func_80A053F0.s | 4 +- data/z_elf_message.data.s | 14 -- include/functions.h | 6 +- include/variables.h | 2 - include/z64.h | 9 +- include/z64scene.h | 2 +- spec | 1 - src/code/z_elf_message.c | 170 +++++++++++++++++- src/code/z_play.c | 2 +- src/code/z_scene.c | 4 +- 19 files changed, 184 insertions(+), 421 deletions(-) rename asm/non_matchings/code/z_elf_message/{func_8006BBC0.s => ElfMessage_CheckCondition.s} (99%) delete mode 100644 asm/non_matchings/code/z_elf_message/func_8006BE88.s delete mode 100644 asm/non_matchings/code/z_elf_message/func_8006BF1C.s delete mode 100644 asm/non_matchings/code/z_elf_message/func_8006C0FC.s delete mode 100644 asm/non_matchings/code/z_elf_message/func_8006C2B0.s delete mode 100644 asm/non_matchings/code/z_elf_message/func_8006C318.s delete mode 100644 data/z_elf_message.data.s diff --git a/asm/non_matchings/code/z_elf_message/func_8006BBC0.s b/asm/non_matchings/code/z_elf_message/ElfMessage_CheckCondition.s similarity index 99% rename from asm/non_matchings/code/z_elf_message/func_8006BBC0.s rename to asm/non_matchings/code/z_elf_message/ElfMessage_CheckCondition.s index 56f71e7c88..abff1734ae 100644 --- a/asm/non_matchings/code/z_elf_message/func_8006BBC0.s +++ b/asm/non_matchings/code/z_elf_message/ElfMessage_CheckCondition.s @@ -91,7 +91,7 @@ glabel jtbl_8013B8C8 .word L8006BE10 .text -glabel func_8006BBC0 +glabel ElfMessage_CheckCondition /* AE2D60 8006BBC0 27BDFFE8 */ addiu $sp, $sp, -0x18 /* AE2D64 8006BBC4 AFBF0014 */ sw $ra, 0x14($sp) /* AE2D68 8006BBC8 90850000 */ lbu $a1, ($a0) diff --git a/asm/non_matchings/code/z_elf_message/func_8006BE88.s b/asm/non_matchings/code/z_elf_message/func_8006BE88.s deleted file mode 100644 index 0915b36fbe..0000000000 --- a/asm/non_matchings/code/z_elf_message/func_8006BE88.s +++ /dev/null @@ -1,44 +0,0 @@ -glabel func_8006BE88 -/* AE3028 8006BE88 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* AE302C 8006BE8C AFBF0024 */ sw $ra, 0x24($sp) -/* AE3030 8006BE90 AFB20020 */ sw $s2, 0x20($sp) -/* AE3034 8006BE94 AFB1001C */ sw $s1, 0x1c($sp) -/* AE3038 8006BE98 AFB00018 */ sw $s0, 0x18($sp) -/* AE303C 8006BE9C 8C850000 */ lw $a1, ($a0) -/* AE3040 8006BEA0 24120020 */ li $s2, 32 -/* AE3044 8006BEA4 00808025 */ move $s0, $a0 -/* AE3048 8006BEA8 90AE0000 */ lbu $t6, ($a1) -/* AE304C 8006BEAC 24110001 */ li $s1, 1 -/* AE3050 8006BEB0 31CF00E0 */ andi $t7, $t6, 0xe0 -/* AE3054 8006BEB4 164F000D */ bne $s2, $t7, .L8006BEEC -/* AE3058 8006BEB8 00000000 */ nop -.L8006BEBC: -/* AE305C 8006BEBC 0C01AEF0 */ jal func_8006BBC0 -/* AE3060 8006BEC0 00A02025 */ move $a0, $a1 -/* AE3064 8006BEC4 54400003 */ bnezl $v0, .L8006BED4 -/* AE3068 8006BEC8 8E180000 */ lw $t8, ($s0) -/* AE306C 8006BECC 00008825 */ move $s1, $zero -/* AE3070 8006BED0 8E180000 */ lw $t8, ($s0) -.L8006BED4: -/* AE3074 8006BED4 27050004 */ addiu $a1, $t8, 4 -/* AE3078 8006BED8 AE050000 */ sw $a1, ($s0) -/* AE307C 8006BEDC 90A80000 */ lbu $t0, ($a1) -/* AE3080 8006BEE0 310900E0 */ andi $t1, $t0, 0xe0 -/* AE3084 8006BEE4 1249FFF5 */ beq $s2, $t1, .L8006BEBC -/* AE3088 8006BEE8 00000000 */ nop -.L8006BEEC: -/* AE308C 8006BEEC 12200005 */ beqz $s1, .L8006BF04 -/* AE3090 8006BEF0 00001025 */ move $v0, $zero -/* AE3094 8006BEF4 0C01AEF0 */ jal func_8006BBC0 -/* AE3098 8006BEF8 00A02025 */ move $a0, $a1 -/* AE309C 8006BEFC 10000002 */ b .L8006BF08 -/* AE30A0 8006BF00 8FBF0024 */ lw $ra, 0x24($sp) -.L8006BF04: -/* AE30A4 8006BF04 8FBF0024 */ lw $ra, 0x24($sp) -.L8006BF08: -/* AE30A8 8006BF08 8FB00018 */ lw $s0, 0x18($sp) -/* AE30AC 8006BF0C 8FB1001C */ lw $s1, 0x1c($sp) -/* AE30B0 8006BF10 8FB20020 */ lw $s2, 0x20($sp) -/* AE30B4 8006BF14 03E00008 */ jr $ra -/* AE30B8 8006BF18 27BD0028 */ addiu $sp, $sp, 0x28 - diff --git a/asm/non_matchings/code/z_elf_message/func_8006BF1C.s b/asm/non_matchings/code/z_elf_message/func_8006BF1C.s deleted file mode 100644 index 3f686b48de..0000000000 --- a/asm/non_matchings/code/z_elf_message/func_8006BF1C.s +++ /dev/null @@ -1,144 +0,0 @@ -glabel func_8006BF1C -/* AE30BC 8006BF1C 27BDFF90 */ addiu $sp, $sp, -0x70 -/* AE30C0 8006BF20 AFB30020 */ sw $s3, 0x20($sp) -/* AE30C4 8006BF24 AFB2001C */ sw $s2, 0x1c($sp) -/* AE30C8 8006BF28 AFB10018 */ sw $s1, 0x18($sp) -/* AE30CC 8006BF2C AFBF0024 */ sw $ra, 0x24($sp) -/* AE30D0 8006BF30 AFB00014 */ sw $s0, 0x14($sp) -/* AE30D4 8006BF34 00808825 */ move $s1, $a0 -/* AE30D8 8006BF38 8C900000 */ lw $s0, ($a0) -/* AE30DC 8006BF3C 00009025 */ move $s2, $zero -/* AE30E0 8006BF40 00009825 */ move $s3, $zero -/* AE30E4 8006BF44 27A30044 */ addiu $v1, $sp, 0x44 -.L8006BF48: -/* AE30E8 8006BF48 02002025 */ move $a0, $s0 -/* AE30EC 8006BF4C 0C01AEF0 */ jal func_8006BBC0 -/* AE30F0 8006BF50 AFA30030 */ sw $v1, 0x30($sp) -/* AE30F4 8006BF54 8FA30030 */ lw $v1, 0x30($sp) -/* AE30F8 8006BF58 24010040 */ li $at, 64 -/* AE30FC 8006BF5C 02429021 */ addu $s2, $s2, $v0 -/* AE3100 8006BF60 AC620000 */ sw $v0, ($v1) -/* AE3104 8006BF64 920E0004 */ lbu $t6, 4($s0) -/* AE3108 8006BF68 26730001 */ addiu $s3, $s3, 1 -/* AE310C 8006BF6C 26100004 */ addiu $s0, $s0, 4 -/* AE3110 8006BF70 31CF00E0 */ andi $t7, $t6, 0xe0 -/* AE3114 8006BF74 11E1FFF4 */ beq $t7, $at, .L8006BF48 -/* AE3118 8006BF78 24630004 */ addiu $v1, $v1, 4 -/* AE311C 8006BF7C 56400004 */ bnezl $s2, .L8006BF90 -/* AE3120 8006BF80 44922000 */ mtc1 $s2, $f4 -/* AE3124 8006BF84 10000056 */ b .L8006C0E0 -/* AE3128 8006BF88 00001025 */ move $v0, $zero -/* AE312C 8006BF8C 44922000 */ mtc1 $s2, $f4 -.L8006BF90: -/* AE3130 8006BF90 0C00CFBE */ jal Math_Rand_ZeroFloat -/* AE3134 8006BF94 46802320 */ cvt.s.w $f12, $f4 -/* AE3138 8006BF98 4600018D */ trunc.w.s $f6, $f0 -/* AE313C 8006BF9C 00009025 */ move $s2, $zero -/* AE3140 8006BFA0 32650003 */ andi $a1, $s3, 3 -/* AE3144 8006BFA4 44023000 */ mfc1 $v0, $f6 -/* AE3148 8006BFA8 5A60004D */ blezl $s3, .L8006C0E0 -/* AE314C 8006BFAC 00001025 */ move $v0, $zero -/* AE3150 8006BFB0 10A00014 */ beqz $a1, .L8006C004 -/* AE3154 8006BFB4 00A02025 */ move $a0, $a1 -/* AE3158 8006BFB8 0000C880 */ sll $t9, $zero, 2 -/* AE315C 8006BFBC 27A80044 */ addiu $t0, $sp, 0x44 -/* AE3160 8006BFC0 03281821 */ addu $v1, $t9, $t0 -.L8006BFC4: -/* AE3164 8006BFC4 8C690000 */ lw $t1, ($v1) -/* AE3168 8006BFC8 51200008 */ beql $t1, $zero, .L8006BFEC -/* AE316C 8006BFCC 8E2A0000 */ lw $t2, ($s1) -/* AE3170 8006BFD0 18400003 */ blez $v0, .L8006BFE0 -/* AE3174 8006BFD4 00000000 */ nop -/* AE3178 8006BFD8 10000003 */ b .L8006BFE8 -/* AE317C 8006BFDC 2442FFFF */ addiu $v0, $v0, -1 -.L8006BFE0: -/* AE3180 8006BFE0 1000003F */ b .L8006C0E0 -/* AE3184 8006BFE4 24020001 */ li $v0, 1 -.L8006BFE8: -/* AE3188 8006BFE8 8E2A0000 */ lw $t2, ($s1) -.L8006BFEC: -/* AE318C 8006BFEC 26520001 */ addiu $s2, $s2, 1 -/* AE3190 8006BFF0 24630004 */ addiu $v1, $v1, 4 -/* AE3194 8006BFF4 254B0004 */ addiu $t3, $t2, 4 -/* AE3198 8006BFF8 1492FFF2 */ bne $a0, $s2, .L8006BFC4 -/* AE319C 8006BFFC AE2B0000 */ sw $t3, ($s1) -/* AE31A0 8006C000 12530036 */ beq $s2, $s3, .L8006C0DC -.L8006C004: -/* AE31A4 8006C004 00126080 */ sll $t4, $s2, 2 -/* AE31A8 8006C008 27AD0044 */ addiu $t5, $sp, 0x44 -/* AE31AC 8006C00C 018D1821 */ addu $v1, $t4, $t5 -.L8006C010: -/* AE31B0 8006C010 8C6E0000 */ lw $t6, ($v1) -/* AE31B4 8006C014 51C00008 */ beql $t6, $zero, .L8006C038 -/* AE31B8 8006C018 8E2F0000 */ lw $t7, ($s1) -/* AE31BC 8006C01C 18400003 */ blez $v0, .L8006C02C -/* AE31C0 8006C020 00000000 */ nop -/* AE31C4 8006C024 10000003 */ b .L8006C034 -/* AE31C8 8006C028 2442FFFF */ addiu $v0, $v0, -1 -.L8006C02C: -/* AE31CC 8006C02C 1000002C */ b .L8006C0E0 -/* AE31D0 8006C030 24020001 */ li $v0, 1 -.L8006C034: -/* AE31D4 8006C034 8E2F0000 */ lw $t7, ($s1) -.L8006C038: -/* AE31D8 8006C038 25F80004 */ addiu $t8, $t7, 4 -/* AE31DC 8006C03C AE380000 */ sw $t8, ($s1) -/* AE31E0 8006C040 8C790004 */ lw $t9, 4($v1) -/* AE31E4 8006C044 53200008 */ beql $t9, $zero, .L8006C068 -/* AE31E8 8006C048 8E280000 */ lw $t0, ($s1) -/* AE31EC 8006C04C 18400003 */ blez $v0, .L8006C05C -/* AE31F0 8006C050 00000000 */ nop -/* AE31F4 8006C054 10000003 */ b .L8006C064 -/* AE31F8 8006C058 2442FFFF */ addiu $v0, $v0, -1 -.L8006C05C: -/* AE31FC 8006C05C 10000020 */ b .L8006C0E0 -/* AE3200 8006C060 24020001 */ li $v0, 1 -.L8006C064: -/* AE3204 8006C064 8E280000 */ lw $t0, ($s1) -.L8006C068: -/* AE3208 8006C068 25090004 */ addiu $t1, $t0, 4 -/* AE320C 8006C06C AE290000 */ sw $t1, ($s1) -/* AE3210 8006C070 8C6A0008 */ lw $t2, 8($v1) -/* AE3214 8006C074 51400008 */ beql $t2, $zero, .L8006C098 -/* AE3218 8006C078 8E2B0000 */ lw $t3, ($s1) -/* AE321C 8006C07C 18400003 */ blez $v0, .L8006C08C -/* AE3220 8006C080 00000000 */ nop -/* AE3224 8006C084 10000003 */ b .L8006C094 -/* AE3228 8006C088 2442FFFF */ addiu $v0, $v0, -1 -.L8006C08C: -/* AE322C 8006C08C 10000014 */ b .L8006C0E0 -/* AE3230 8006C090 24020001 */ li $v0, 1 -.L8006C094: -/* AE3234 8006C094 8E2B0000 */ lw $t3, ($s1) -.L8006C098: -/* AE3238 8006C098 256C0004 */ addiu $t4, $t3, 4 -/* AE323C 8006C09C AE2C0000 */ sw $t4, ($s1) -/* AE3240 8006C0A0 8C6D000C */ lw $t5, 0xc($v1) -/* AE3244 8006C0A4 51A00008 */ beql $t5, $zero, .L8006C0C8 -/* AE3248 8006C0A8 8E2E0000 */ lw $t6, ($s1) -/* AE324C 8006C0AC 18400003 */ blez $v0, .L8006C0BC -/* AE3250 8006C0B0 00000000 */ nop -/* AE3254 8006C0B4 10000003 */ b .L8006C0C4 -/* AE3258 8006C0B8 2442FFFF */ addiu $v0, $v0, -1 -.L8006C0BC: -/* AE325C 8006C0BC 10000008 */ b .L8006C0E0 -/* AE3260 8006C0C0 24020001 */ li $v0, 1 -.L8006C0C4: -/* AE3264 8006C0C4 8E2E0000 */ lw $t6, ($s1) -.L8006C0C8: -/* AE3268 8006C0C8 26520004 */ addiu $s2, $s2, 4 -/* AE326C 8006C0CC 24630010 */ addiu $v1, $v1, 0x10 -/* AE3270 8006C0D0 25CF0004 */ addiu $t7, $t6, 4 -/* AE3274 8006C0D4 1653FFCE */ bne $s2, $s3, .L8006C010 -/* AE3278 8006C0D8 AE2F0000 */ sw $t7, ($s1) -.L8006C0DC: -/* AE327C 8006C0DC 00001025 */ move $v0, $zero -.L8006C0E0: -/* AE3280 8006C0E0 8FBF0024 */ lw $ra, 0x24($sp) -/* AE3284 8006C0E4 8FB00014 */ lw $s0, 0x14($sp) -/* AE3288 8006C0E8 8FB10018 */ lw $s1, 0x18($sp) -/* AE328C 8006C0EC 8FB2001C */ lw $s2, 0x1c($sp) -/* AE3290 8006C0F0 8FB30020 */ lw $s3, 0x20($sp) -/* AE3294 8006C0F4 03E00008 */ jr $ra -/* AE3298 8006C0F8 27BD0070 */ addiu $sp, $sp, 0x70 - diff --git a/asm/non_matchings/code/z_elf_message/func_8006C0FC.s b/asm/non_matchings/code/z_elf_message/func_8006C0FC.s deleted file mode 100644 index 8fb62237d1..0000000000 --- a/asm/non_matchings/code/z_elf_message/func_8006C0FC.s +++ /dev/null @@ -1,145 +0,0 @@ -.rdata -glabel D_8013B87C - .asciz "../z_elf_message.c" - .balign 4 - -glabel D_8013B890 - .asciz "\"企画外 条件\" = %s\n" - # EUC-JP: 企画外 条件 | Unplanned conditions - .balign 4 - -glabel D_8013B8A4 - .asciz "企画外 条件" - # EUC-JP: 企画外 条件 | Unplanned conditions - .balign 4 - -glabel D_8013B8B0 - .asciz "0" - .balign 4 - -glabel D_8013B8B4 - .asciz "../z_elf_message.c" - .balign 4 - -.text -glabel func_8006C0FC -/* AE329C 8006C0FC 27BDFFC0 */ addiu $sp, $sp, -0x40 -/* AE32A0 8006C100 AFBE0038 */ sw $fp, 0x38($sp) -/* AE32A4 8006C104 AFB70034 */ sw $s7, 0x34($sp) -/* AE32A8 8006C108 AFB60030 */ sw $s6, 0x30($sp) -/* AE32AC 8006C10C AFB5002C */ sw $s5, 0x2c($sp) -/* AE32B0 8006C110 AFB40028 */ sw $s4, 0x28($sp) -/* AE32B4 8006C114 AFB30024 */ sw $s3, 0x24($sp) -/* AE32B8 8006C118 AFB20020 */ sw $s2, 0x20($sp) -/* AE32BC 8006C11C AFB1001C */ sw $s1, 0x1c($sp) -/* AE32C0 8006C120 AFB00018 */ sw $s0, 0x18($sp) -/* AE32C4 8006C124 3C158014 */ lui $s5, %hi(D_8013B87C) # $s5, 0x8014 -/* AE32C8 8006C128 3C168014 */ lui $s6, %hi(D_8013B890) # $s6, 0x8014 -/* AE32CC 8006C12C 3C178014 */ lui $s7, %hi(D_8013B8A4) # $s7, 0x8014 -/* AE32D0 8006C130 3C1E8014 */ lui $fp, %hi(D_8013B8B0) # $fp, 0x8014 -/* AE32D4 8006C134 AFBF003C */ sw $ra, 0x3c($sp) -/* AE32D8 8006C138 AFA40040 */ sw $a0, 0x40($sp) -/* AE32DC 8006C13C 27DEB8B0 */ addiu $fp, %lo(D_8013B8B0) # addiu $fp, $fp, -0x4750 -/* AE32E0 8006C140 26F7B8A4 */ addiu $s7, %lo(D_8013B8A4) # addiu $s7, $s7, -0x475c -/* AE32E4 8006C144 26D6B890 */ addiu $s6, %lo(D_8013B890) # addiu $s6, $s6, -0x4770 -/* AE32E8 8006C148 26B5B87C */ addiu $s5, %lo(D_8013B87C) # addiu $s5, $s5, -0x4784 -/* AE32EC 8006C14C 27B00040 */ addiu $s0, $sp, 0x40 -/* AE32F0 8006C150 24110020 */ li $s1, 32 -/* AE32F4 8006C154 24120040 */ li $s2, 64 -/* AE32F8 8006C158 24130060 */ li $s3, 96 -/* AE32FC 8006C15C 241400E0 */ li $s4, 224 -.L8006C160: -/* AE3300 8006C160 8FAE0040 */ lw $t6, 0x40($sp) -/* AE3304 8006C164 91C20000 */ lbu $v0, ($t6) -/* AE3308 8006C168 304200E0 */ andi $v0, $v0, 0xe0 -/* AE330C 8006C16C 1040000B */ beqz $v0, .L8006C19C -/* AE3310 8006C170 00000000 */ nop -/* AE3314 8006C174 10510012 */ beq $v0, $s1, .L8006C1C0 -/* AE3318 8006C178 00000000 */ nop -/* AE331C 8006C17C 10520019 */ beq $v0, $s2, .L8006C1E4 -/* AE3320 8006C180 00000000 */ nop -/* AE3324 8006C184 10530020 */ beq $v0, $s3, .L8006C208 -/* AE3328 8006C188 02A02025 */ move $a0, $s5 -/* AE332C 8006C18C 5054002A */ beql $v0, $s4, .L8006C238 -/* AE3330 8006C190 8FAE0040 */ lw $t6, 0x40($sp) -/* AE3334 8006C194 1000002C */ b .L8006C248 -/* AE3338 8006C198 00000000 */ nop -.L8006C19C: -/* AE333C 8006C19C 0C01AEF0 */ jal func_8006BBC0 -/* AE3340 8006C1A0 8FA40040 */ lw $a0, 0x40($sp) -/* AE3344 8006C1A4 50400033 */ beql $v0, $zero, .L8006C274 -/* AE3348 8006C1A8 8FAF0040 */ lw $t7, 0x40($sp) -/* AE334C 8006C1AC 8FAF0040 */ lw $t7, 0x40($sp) -/* AE3350 8006C1B0 91E20002 */ lbu $v0, 2($t7) -/* AE3354 8006C1B4 34420100 */ ori $v0, $v0, 0x100 -/* AE3358 8006C1B8 10000031 */ b .L8006C280 -/* AE335C 8006C1BC 3042FFFF */ andi $v0, $v0, 0xffff -.L8006C1C0: -/* AE3360 8006C1C0 0C01AFA2 */ jal func_8006BE88 -/* AE3364 8006C1C4 02002025 */ move $a0, $s0 -/* AE3368 8006C1C8 5040002A */ beql $v0, $zero, .L8006C274 -/* AE336C 8006C1CC 8FAF0040 */ lw $t7, 0x40($sp) -/* AE3370 8006C1D0 8FB80040 */ lw $t8, 0x40($sp) -/* AE3374 8006C1D4 93020002 */ lbu $v0, 2($t8) -/* AE3378 8006C1D8 34420100 */ ori $v0, $v0, 0x100 -/* AE337C 8006C1DC 10000028 */ b .L8006C280 -/* AE3380 8006C1E0 3042FFFF */ andi $v0, $v0, 0xffff -.L8006C1E4: -/* AE3384 8006C1E4 0C01AFC7 */ jal func_8006BF1C -/* AE3388 8006C1E8 02002025 */ move $a0, $s0 -/* AE338C 8006C1EC 50400021 */ beql $v0, $zero, .L8006C274 -/* AE3390 8006C1F0 8FAF0040 */ lw $t7, 0x40($sp) -/* AE3394 8006C1F4 8FB90040 */ lw $t9, 0x40($sp) -/* AE3398 8006C1F8 93220002 */ lbu $v0, 2($t9) -/* AE339C 8006C1FC 34420100 */ ori $v0, $v0, 0x100 -/* AE33A0 8006C200 1000001F */ b .L8006C280 -/* AE33A4 8006C204 3042FFFF */ andi $v0, $v0, 0xffff -.L8006C208: -/* AE33A8 8006C208 0C01AEF0 */ jal func_8006BBC0 -/* AE33AC 8006C20C 8FA40040 */ lw $a0, 0x40($sp) -/* AE33B0 8006C210 10400017 */ beqz $v0, .L8006C270 -/* AE33B4 8006C214 8FA80040 */ lw $t0, 0x40($sp) -/* AE33B8 8006C218 910A0002 */ lbu $t2, 2($t0) -/* AE33BC 8006C21C 000A5880 */ sll $t3, $t2, 2 -/* AE33C0 8006C220 010B6021 */ addu $t4, $t0, $t3 -/* AE33C4 8006C224 AFAC0040 */ sw $t4, 0x40($sp) -/* AE33C8 8006C228 258DFFFC */ addiu $t5, $t4, -4 -/* AE33CC 8006C22C 10000010 */ b .L8006C270 -/* AE33D0 8006C230 AFAD0040 */ sw $t5, 0x40($sp) -/* AE33D4 8006C234 8FAE0040 */ lw $t6, 0x40($sp) -.L8006C238: -/* AE33D8 8006C238 91C20002 */ lbu $v0, 2($t6) -/* AE33DC 8006C23C 34420100 */ ori $v0, $v0, 0x100 -/* AE33E0 8006C240 1000000F */ b .L8006C280 -/* AE33E4 8006C244 3042FFFF */ andi $v0, $v0, 0xffff -.L8006C248: -/* AE33E8 8006C248 0C000B84 */ jal LogUtils_LogThreadId -/* AE33EC 8006C24C 24050119 */ li $a1, 281 -/* AE33F0 8006C250 02C02025 */ move $a0, $s6 -/* AE33F4 8006C254 0C00084C */ jal osSyncPrintf -/* AE33F8 8006C258 02E02825 */ move $a1, $s7 -/* AE33FC 8006C25C 3C058014 */ lui $a1, %hi(D_8013B8B4) # $a1, 0x8014 -/* AE3400 8006C260 24A5B8B4 */ addiu $a1, %lo(D_8013B8B4) # addiu $a1, $a1, -0x474c -/* AE3404 8006C264 03C02025 */ move $a0, $fp -/* AE3408 8006C268 0C0007FC */ jal __assert -/* AE340C 8006C26C 2406011A */ li $a2, 282 -.L8006C270: -/* AE3410 8006C270 8FAF0040 */ lw $t7, 0x40($sp) -.L8006C274: -/* AE3414 8006C274 25F80004 */ addiu $t8, $t7, 4 -/* AE3418 8006C278 1000FFB9 */ b .L8006C160 -/* AE341C 8006C27C AFB80040 */ sw $t8, 0x40($sp) -.L8006C280: -/* AE3420 8006C280 8FBF003C */ lw $ra, 0x3c($sp) -/* AE3424 8006C284 8FB00018 */ lw $s0, 0x18($sp) -/* AE3428 8006C288 8FB1001C */ lw $s1, 0x1c($sp) -/* AE342C 8006C28C 8FB20020 */ lw $s2, 0x20($sp) -/* AE3430 8006C290 8FB30024 */ lw $s3, 0x24($sp) -/* AE3434 8006C294 8FB40028 */ lw $s4, 0x28($sp) -/* AE3438 8006C298 8FB5002C */ lw $s5, 0x2c($sp) -/* AE343C 8006C29C 8FB60030 */ lw $s6, 0x30($sp) -/* AE3440 8006C2A0 8FB70034 */ lw $s7, 0x34($sp) -/* AE3444 8006C2A4 8FBE0038 */ lw $fp, 0x38($sp) -/* AE3448 8006C2A8 03E00008 */ jr $ra -/* AE344C 8006C2AC 27BD0040 */ addiu $sp, $sp, 0x40 - diff --git a/asm/non_matchings/code/z_elf_message/func_8006C2B0.s b/asm/non_matchings/code/z_elf_message/func_8006C2B0.s deleted file mode 100644 index 578fa29f27..0000000000 --- a/asm/non_matchings/code/z_elf_message/func_8006C2B0.s +++ /dev/null @@ -1,32 +0,0 @@ -glabel func_8006C2B0 -/* AE3450 8006C2B0 3C0E8016 */ lui $t6, %hi(gSaveContext+4) # $t6, 0x8016 -/* AE3454 8006C2B4 8DCEE664 */ lw $t6, %lo(gSaveContext+4)($t6) -/* AE3458 8006C2B8 27BDFFE0 */ addiu $sp, $sp, -0x20 -/* AE345C 8006C2BC AFBF001C */ sw $ra, 0x1c($sp) -/* AE3460 8006C2C0 11C0000D */ beqz $t6, .L8006C2F8 -/* AE3464 8006C2C4 8C851C44 */ lw $a1, 0x1c44($a0) -/* AE3468 8006C2C8 3C014448 */ li $at, 0x44480000 # 0.000000 -/* AE346C 8006C2CC 44812000 */ mtc1 $at, $f4 -/* AE3470 8006C2D0 24060146 */ li $a2, 326 -/* AE3474 8006C2D4 24070004 */ li $a3, 4 -/* AE3478 8006C2D8 0C00D4FD */ jal Actor_FindNearby -/* AE347C 8006C2DC E7A40010 */ swc1 $f4, 0x10($sp) -/* AE3480 8006C2E0 14400003 */ bnez $v0, .L8006C2F0 -/* AE3484 8006C2E4 3C048012 */ lui $a0, %hi(D_8011F3A0) # $a0, 0x8012 -/* AE3488 8006C2E8 10000005 */ b .L8006C300 -/* AE348C 8006C2EC 2484F3A0 */ addiu $a0, %lo(D_8011F3A0) # addiu $a0, $a0, -0xc60 -.L8006C2F0: -/* AE3490 8006C2F0 10000005 */ b .L8006C308 -/* AE3494 8006C2F4 24020160 */ li $v0, 352 -.L8006C2F8: -/* AE3498 8006C2F8 3C048012 */ lui $a0, %hi(D_8011F3D4) # $a0, 0x8012 -/* AE349C 8006C2FC 2484F3D4 */ addiu $a0, %lo(D_8011F3D4) # addiu $a0, $a0, -0xc2c -.L8006C300: -/* AE34A0 8006C300 0C01B03F */ jal func_8006C0FC -/* AE34A4 8006C304 00000000 */ nop -.L8006C308: -/* AE34A8 8006C308 8FBF001C */ lw $ra, 0x1c($sp) -/* AE34AC 8006C30C 27BD0020 */ addiu $sp, $sp, 0x20 -/* AE34B0 8006C310 03E00008 */ jr $ra -/* AE34B4 8006C314 00000000 */ nop - diff --git a/asm/non_matchings/code/z_elf_message/func_8006C318.s b/asm/non_matchings/code/z_elf_message/func_8006C318.s deleted file mode 100644 index 8b96baa558..0000000000 --- a/asm/non_matchings/code/z_elf_message/func_8006C318.s +++ /dev/null @@ -1,18 +0,0 @@ -glabel func_8006C318 -/* AE34B8 8006C318 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* AE34BC 8006C31C 3C050001 */ lui $a1, 1 -/* AE34C0 8006C320 AFBF0014 */ sw $ra, 0x14($sp) -/* AE34C4 8006C324 00A42821 */ addu $a1, $a1, $a0 -/* AE34C8 8006C328 8CA51E0C */ lw $a1, 0x1e0c($a1) -/* AE34CC 8006C32C 14A00003 */ bnez $a1, .L8006C33C -/* AE34D0 8006C330 00000000 */ nop -/* AE34D4 8006C334 10000003 */ b .L8006C344 -/* AE34D8 8006C338 00001025 */ move $v0, $zero -.L8006C33C: -/* AE34DC 8006C33C 0C01B03F */ jal func_8006C0FC -/* AE34E0 8006C340 00A02025 */ move $a0, $a1 -.L8006C344: -/* AE34E4 8006C344 8FBF0014 */ lw $ra, 0x14($sp) -/* AE34E8 8006C348 27BD0018 */ addiu $sp, $sp, 0x18 -/* AE34EC 8006C34C 03E00008 */ jr $ra -/* AE34F0 8006C350 00000000 */ nop diff --git a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05040.s b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05040.s index 3ff5a00dfc..98cad4d3c3 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05040.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05040.s @@ -25,7 +25,7 @@ glabel func_80A05040 /* 0346C 80A0509C 10000016 */ beq $zero, $zero, .L80A050F8 /* 03470 80A050A0 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 .L80A050A4: -/* 03474 80A050A4 0C01B0AC */ jal func_8006C2B0 +/* 03474 80A050A4 0C01B0AC */ jal ElfMessage_GetSariaText /* 03478 80A050A8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0347C 80A050AC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 03480 80A050B0 0C042DC8 */ jal func_8010B720 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05188.s b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05188.s index 43fb335086..9be1706cce 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05188.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05188.s @@ -14,7 +14,7 @@ glabel func_80A05188 /* 03588 80A051B8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0358C 80A051BC 5040000B */ beql $v0, $zero, .L80A051EC /* 03590 80A051C0 8FA40020 */ lw $a0, 0x0020($sp) -/* 03594 80A051C4 0C01B0AC */ jal func_8006C2B0 +/* 03594 80A051C4 0C01B0AC */ jal ElfMessage_GetSariaText /* 03598 80A051C8 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 0359C 80A051CC 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 035A0 80A051D0 0C042DC8 */ jal func_8010B720 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05208.s b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05208.s index 3591cf30b6..71cbb064cd 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05208.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A05208.s @@ -25,7 +25,7 @@ glabel func_80A05208 /* 03634 80A05264 1000001C */ beq $zero, $zero, .L80A052D8 /* 03638 80A05268 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 .L80A0526C: -/* 0363C 80A0526C 0C01B0C6 */ jal func_8006C318 +/* 0363C 80A0526C 0C01B0C6 */ jal ElfMessage_GetCUpText /* 03640 80A05270 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 03644 80A05274 10400006 */ beq $v0, $zero, .L80A05290 /* 03648 80A05278 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 diff --git a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A053F0.s b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A053F0.s index 79339d9553..35c9df9098 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A053F0.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Elf/func_80A053F0.s @@ -26,7 +26,7 @@ glabel func_80A053F0 /* 0381C 80A0544C 51000012 */ beql $t0, $zero, .L80A05498 /* 03820 80A05450 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 .L80A05454: -/* 03824 80A05454 0C01B0C6 */ jal func_8006C318 +/* 03824 80A05454 0C01B0C6 */ jal ElfMessage_GetCUpText /* 03828 80A05458 8FA4003C */ lw $a0, 0x003C($sp) /* 0382C 80A0545C 8FA3002C */ lw $v1, 0x002C($sp) /* 03830 80A05460 2401015F */ addiu $at, $zero, 0x015F ## $at = 0000015F @@ -60,7 +60,7 @@ glabel func_80A053F0 /* 03894 80A054C4 8E0D002C */ lw $t5, 0x002C($s0) ## 0000002C /* 03898 80A054C8 AE0C003C */ sw $t4, 0x003C($s0) ## 0000003C /* 0389C 80A054CC AE0D0040 */ sw $t5, 0x0040($s0) ## 00000040 -/* 038A0 80A054D0 0C01B0C6 */ jal func_8006C318 +/* 038A0 80A054D0 0C01B0C6 */ jal ElfMessage_GetCUpText /* 038A4 80A054D4 8FA4003C */ lw $a0, 0x003C($sp) /* 038A8 80A054D8 960E010E */ lhu $t6, 0x010E($s0) ## 0000010E /* 038AC 80A054DC 3C0C80A0 */ lui $t4, %hi(func_80A052F4) ## $t4 = 80A00000 diff --git a/data/z_elf_message.data.s b/data/z_elf_message.data.s deleted file mode 100644 index 6d6ef86d23..0000000000 --- a/data/z_elf_message.data.s +++ /dev/null @@ -1,14 +0,0 @@ -.include "macro.inc" - -# assembler directives -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches -.set gp=64 # allow use of 64-bit general purposee registers - -.section .data - -glabel D_8011F3A0 - .incbin "baserom.z64", 0xB96540, 0x34 - -glabel D_8011F3D4 - .incbin "baserom.z64", 0xB96574, 0x1C diff --git a/include/functions.h b/include/functions.h index b5262044f6..63231e6983 100644 --- a/include/functions.h +++ b/include/functions.h @@ -796,10 +796,8 @@ void func_800694A0(GlobalContext* globalCtx, s16 drawId); // ? func_8006BA00(?); // ? func_8006BA30(?); void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos2, s32 radius, u16 sfxId); -// ? func_8006BBC0(?); -// ? func_8006BE88(?); -// ? func_8006BF1C(?); -// ? func_8006C0FC(?); +u16 ElfMessage_GetSariaText(GlobalContext* globalCtx); +u16 ElfMessage_GetCUpText(GlobalContext* globalCtx); u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet); // ? func_8006C3A0(?); // ? func_8006C3D0(?); diff --git a/include/variables.h b/include/variables.h index e44e42f026..acfee0d086 100644 --- a/include/variables.h +++ b/include/variables.h @@ -263,8 +263,6 @@ extern s32 D_8011D3AC; extern s16 D_8011E0B0; extern Color_RGBA8 D_8011E0B4[]; //extern ? D_8011E0D4; -//extern ? D_8011F3A0; -//extern ? D_8011F3D4; //extern ? D_8011F830; //extern ? D_8011F860; //extern ? D_8011F890; diff --git a/include/z64.h b/include/z64.h index dfa5d3376f..4339f7fd86 100644 --- a/include/z64.h +++ b/include/z64.h @@ -801,6 +801,13 @@ typedef struct /* 0x00A8 */ View view; } SampleContext; +typedef struct { + /* 0x00 */ u8 byte0; + /* 0x01 */ u8 byte1; + /* 0x02 */ u8 byte2; + /* 0x03 */ u8 byte3; +} ElfMessage; // size = 0x4 + // Global Context (dbg ram start: 80212020) typedef struct GlobalContext { /* 0x00000 */ GameState state; @@ -902,7 +909,7 @@ typedef struct GlobalContext { /* 0x11E00 */ EntranceEntry* setupEntranceList; /* 0x11E04 */ UNK_PTR setupExitList; /* 0x11E08 */ Path* setupPathList; - /* 0x11E0C */ UNK_PTR naviMsgSegment; + /* 0x11E0C */ ElfMessage* cUpElfMsgs; /* 0x11E10 */ char unk_11E10[0x4]; /* 0x11E14 */ u8 skyboxId; /* 0x11E15 */ s8 sceneLoadFlag; // "fade_direction" diff --git a/include/z64scene.h b/include/z64scene.h index 28db2047e1..c808395878 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -66,7 +66,7 @@ typedef struct { typedef struct { /* 0x00 */ u8 code; - /* 0x01 */ u8 naviMsgNum; + /* 0x01 */ u8 cUpElfMsgNum; /* 0x04 */ u32 keepObjectId; } SCmdSpecialFiles; diff --git a/spec b/spec index da12c066a4..fae8d82790 100644 --- a/spec +++ b/spec @@ -314,7 +314,6 @@ beginseg include "build/src/code/z_draw.o" include "build/asm/code_8006BA00.o" include "build/src/code/z_elf_message.o" - include "build/data/z_elf_message.data.o" include "build/src/code/z_face_reaction.o" include "build/src/code/code_8006C3A0.o" include "build/src/code/code_8006C510.o" diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index dabceae8c1..3828c6823c 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -1,14 +1,172 @@ #include #include -#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006BBC0.s") +// TODO: use macros to define elf messages once the format is fully documented +ElfMessage sChildSariaMsgs[] = { + { 0x66, 0x00, 0x03, 0x00 }, { 0x00, 0x37, 0x61, 0x00 }, { 0xE0, 0x00, 0x64, 0x00 }, { 0x00, 0x25, 0x62, 0x00 }, + { 0x00, 0x37, 0x63, 0x00 }, { 0x00, 0x43, 0x65, 0x00 }, { 0x06, 0x30, 0x66, 0x66 }, { 0x06, 0x30, 0x66, 0x67 }, + { 0x06, 0x30, 0x66, 0x68 }, { 0x06, 0x20, 0x67, 0x65 }, { 0x06, 0x30, 0x68, 0x69 }, { 0x06, 0x30, 0x68, 0x6A }, + { 0xE0, 0x00, 0x69, 0x00 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006BE88.s") +ElfMessage sAdultSariaMsgs[] = { + { 0x06, 0x30, 0x6A, 0x66 }, { 0x06, 0x30, 0x6B, 0x67 }, { 0x06, 0x30, 0x6B, 0x68 }, + { 0x06, 0x30, 0x6C, 0x69 }, { 0x06, 0x30, 0x6C, 0x6A }, { 0xE0, 0x00, 0x6D, 0x00 }, +}; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006BF1C.s") +#ifdef NON_MATCHING +// minor ordering and regalloc differences +u32 ElfMessage_CheckCondition(ElfMessage* msg) { + u16 temp; -#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006C0FC.s") + switch (msg->byte0 & 0x1E) { + case 0: + temp = 1 << (msg->byte1 & 0x0F); + return ((msg->byte0 & 1) == 1) == !!(gSaveContext.event_chk_inf[(msg->byte1 & 0xF0) >> 4] & temp); + case 2: + return ((msg->byte0 & 1) == 1) == + !!(gBitFlags[msg->byte1 - ITEM_KEY_BOSS] & gSaveContext.dungeon_items[gSaveContext.dungeon_index]); + case 4: + return ((msg->byte0 & 1) == 1) == (msg->byte3 == INV_CONTENT(msg->byte1)); + case 6: + switch (msg->byte1 & 0xF0) { + case 0x00: + return ((msg->byte0 & 1) == 1) == ((msg->byte1 & 0x0F) == CUR_UPG_VALUE(UPG_STRENGTH)); + case 0x10: + return ((msg->byte0 & 1) == 1) == + !!((gBitFlags[msg->byte3 - ITEM_BOOTS_KOKIRI] << gEquipShifts[EQUIP_BOOTS]) & + gSaveContext.equipment); + case 0x20: + return ((msg->byte0 & 1) == 1) == + !!(gBitFlags[msg->byte3 - ITEM_SONG_MINUET + 6] & gSaveContext.quest_items); + case 0x30: + return ((msg->byte0 & 1) == 1) == + !!(gBitFlags[msg->byte3 - ITEM_MEDALLION_FOREST] & gSaveContext.quest_items); + case 0x40: + return ((msg->byte0 & 1) == 1) == !!gSaveContext.magic_acquired; + } + } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006C2B0.s") + LogUtils_LogThreadId("../z_elf_message.c", 156); + osSyncPrintf("\"企画外 条件\" = %s\n", "企画外 条件"); // "Unplanned conditions" + __assert("0", "../z_elf_message.c", 157); -#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/func_8006C318.s") + return false; +} +#else +u32 ElfMessage_CheckCondition(ElfMessage* msg); +#pragma GLOBAL_ASM("asm/non_matchings/code/z_elf_message/ElfMessage_CheckCondition.s") +#endif + +u32 func_8006BE88(ElfMessage** msgp) { + u32 temp = true; + + while (((*msgp)->byte0 & 0xE0) == 0x20) { + if (!ElfMessage_CheckCondition(*msgp)) { + temp = false; + } + *msgp += 1; + } + + if (temp) { + return ElfMessage_CheckCondition(*msgp); + } else { + return false; + } +} + +u32 func_8006BF1C(ElfMessage** msgp) { + ElfMessage* msg; + u32 sp44[10]; + s32 temp1; + s32 temp2; + s32 temp3; + + msg = *msgp; + temp1 = 0; + temp2 = 0; + do { + sp44[temp2] = ElfMessage_CheckCondition(msg); + temp1 += sp44[temp2]; + temp2++; + msg++; + } while ((msg->byte0 & 0xE0) == 0x40); + + if (temp1 == 0) { + return false; + } + + temp3 = Math_Rand_ZeroFloat(temp1); + for (temp1 = 0; temp1 < temp2; temp1++) { + if (sp44[temp1]) { + if (temp3 > 0) { + temp3--; + } else { + return true; + } + } + *msgp += 1; + } + + return false; +} + +u16 ElfMessage_GetTextFromMsgs(ElfMessage* msg) { + while (true) { + switch (msg->byte0 & 0xE0) { + case 0x00: + if (ElfMessage_CheckCondition(msg)) { + return msg->byte2 | 0x100; + } + break; + case 0x20: + if (func_8006BE88(&msg)) { + return msg->byte2 | 0x100; + } + break; + case 0x40: + if (func_8006BF1C(&msg)) { + return msg->byte2 | 0x100; + } + break; + case 0x60: + if (ElfMessage_CheckCondition(msg)) { + msg += msg->byte2; + msg--; + } + break; + case 0xE0: + return msg->byte2 | 0x100; + default: + LogUtils_LogThreadId("../z_elf_message.c", 281); + osSyncPrintf("\"企画外 条件\" = %s\n", "企画外 条件"); // "Unplanned conditions" + __assert("0", "../z_elf_message.c", 282); + } + msg++; + } +} + +u16 ElfMessage_GetSariaText(GlobalContext* globalCtx) { + Player* player = PLAYER; + ElfMessage* msgs; + + if (LINK_IS_CHILD) { + if (Actor_FindNearby(globalCtx, &player->actor, ACTOR_EN_SA, 4, 800.0f) == NULL) { + msgs = sChildSariaMsgs; + } else { + return 0x0160; // Special text about Saria preferring to talk to you face-to-face + } + } else { + msgs = sAdultSariaMsgs; + } + + return ElfMessage_GetTextFromMsgs(msgs); +} + +u16 ElfMessage_GetCUpText(GlobalContext* globalCtx) { + if (globalCtx->cUpElfMsgs == NULL) { + return 0; + } else { + return ElfMessage_GetTextFromMsgs(globalCtx->cUpElfMsgs); + } +} diff --git a/src/code/z_play.c b/src/code/z_play.c index 8494f9b99b..a34ab16f7a 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -58,7 +58,7 @@ void func_800BFF0C(GlobalContext* globalCtx, s32 a1) { globalCtx->unk_11DFC = NULL; globalCtx->setupEntranceList = NULL; globalCtx->setupExitList = NULL; - globalCtx->naviMsgSegment = NULL; + globalCtx->cUpElfMsgs = NULL; globalCtx->setupPathList = NULL; globalCtx->nbSetupActors = 0; Object_InitBank(globalCtx, &globalCtx->objectCtx); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 3a7121b040..6ad51d2ee3 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -260,8 +260,8 @@ void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) { gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment); } - if (cmd->specialFiles.naviMsgNum != 0) { - globalCtx->naviMsgSegment = func_800BFE5C(globalCtx, &sNaviMsgFiles[cmd->specialFiles.naviMsgNum - 1]); + if (cmd->specialFiles.cUpElfMsgNum != 0) { + globalCtx->cUpElfMsgs = func_800BFE5C(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]); } }