1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-29 03:34:07 +00:00

Decompile 2 small files (code_8006BA00.c and code_8006C3A0.c) (#101)

* Decompile code_8006C3A0.c (handling "env" flags)

* Decompile code_8006BA00.c (handling sound sources)
This commit is contained in:
Roman971 2020-05-01 04:00:39 +02:00 committed by GitHub
parent d0ba37b148
commit 4932e93ba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 143 additions and 296 deletions

View file

@ -1,137 +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 .text
.align 4
glabel func_8006BA00
/* AE2BA0 8006BA00 24831DB4 */ addiu $v1, $a0, 0x1db4
/* AE2BA4 8006BA04 24040010 */ li $a0, 16
/* AE2BA8 8006BA08 00001025 */ move $v0, $zero
.L8006BA0C:
/* AE2BAC 8006BA0C 24420004 */ addiu $v0, $v0, 4
/* AE2BB0 8006BA10 A4600000 */ sh $zero, ($v1)
/* AE2BB4 8006BA14 A460001C */ sh $zero, 0x1c($v1)
/* AE2BB8 8006BA18 A4600038 */ sh $zero, 0x38($v1)
/* AE2BBC 8006BA1C A4600054 */ sh $zero, 0x54($v1)
/* AE2BC0 8006BA20 1444FFFA */ bne $v0, $a0, .L8006BA0C
/* AE2BC4 8006BA24 24630070 */ addiu $v1, $v1, 0x70
/* AE2BC8 8006BA28 03E00008 */ jr $ra
/* AE2BCC 8006BA2C 00000000 */ nop
glabel func_8006BA30
/* AE2BD0 8006BA30 27BDFFD0 */ addiu $sp, $sp, -0x30
/* AE2BD4 8006BA34 AFB40028 */ sw $s4, 0x28($sp)
/* AE2BD8 8006BA38 AFB30024 */ sw $s3, 0x24($sp)
/* AE2BDC 8006BA3C AFB20020 */ sw $s2, 0x20($sp)
/* AE2BE0 8006BA40 AFB1001C */ sw $s1, 0x1c($sp)
/* AE2BE4 8006BA44 AFB00018 */ sw $s0, 0x18($sp)
/* AE2BE8 8006BA48 3C140001 */ lui $s4, (0x00011D60 >> 16) # lui $s4, 1
/* AE2BEC 8006BA4C 00809025 */ move $s2, $a0
/* AE2BF0 8006BA50 AFBF002C */ sw $ra, 0x2c($sp)
/* AE2BF4 8006BA54 24901DB4 */ addiu $s0, $a0, 0x1db4
/* AE2BF8 8006BA58 36941D60 */ ori $s4, (0x00011D60 & 0xFFFF) # ori $s4, $s4, 0x1d60
/* AE2BFC 8006BA5C 00008825 */ move $s1, $zero
/* AE2C00 8006BA60 24130010 */ li $s3, 16
.L8006BA64:
/* AE2C04 8006BA64 96020000 */ lhu $v0, ($s0)
/* AE2C08 8006BA68 50400011 */ beql $v0, $zero, .L8006BAB0
/* AE2C0C 8006BA6C 26310001 */ addiu $s1, $s1, 1
/* AE2C10 8006BA70 14400003 */ bnez $v0, .L8006BA80
/* AE2C14 8006BA74 244EFFFF */ addiu $t6, $v0, -1
/* AE2C18 8006BA78 10000003 */ b .L8006BA88
/* AE2C1C 8006BA7C 00001825 */ move $v1, $zero
.L8006BA80:
/* AE2C20 8006BA80 A60E0000 */ sh $t6, ($s0)
/* AE2C24 8006BA84 31C3FFFF */ andi $v1, $t6, 0xffff
.L8006BA88:
/* AE2C28 8006BA88 14600005 */ bnez $v1, .L8006BAA0
/* AE2C2C 8006BA8C 02542021 */ addu $a0, $s2, $s4
/* AE2C30 8006BA90 0C03E27A */ jal func_800F89E8
/* AE2C34 8006BA94 26040010 */ addiu $a0, $s0, 0x10
/* AE2C38 8006BA98 10000005 */ b .L8006BAB0
/* AE2C3C 8006BA9C 26310001 */ addiu $s1, $s1, 1
.L8006BAA0:
/* AE2C40 8006BAA0 26050004 */ addiu $a1, $s0, 4
/* AE2C44 8006BAA4 0C029BBD */ jal func_800A6EF4
/* AE2C48 8006BAA8 26060010 */ addiu $a2, $s0, 0x10
/* AE2C4C 8006BAAC 26310001 */ addiu $s1, $s1, 1
.L8006BAB0:
/* AE2C50 8006BAB0 1633FFEC */ bne $s1, $s3, .L8006BA64
/* AE2C54 8006BAB4 2610001C */ addiu $s0, $s0, 0x1c
/* AE2C58 8006BAB8 8FBF002C */ lw $ra, 0x2c($sp)
/* AE2C5C 8006BABC 8FB00018 */ lw $s0, 0x18($sp)
/* AE2C60 8006BAC0 8FB1001C */ lw $s1, 0x1c($sp)
/* AE2C64 8006BAC4 8FB20020 */ lw $s2, 0x20($sp)
/* AE2C68 8006BAC8 8FB30024 */ lw $s3, 0x24($sp)
/* AE2C6C 8006BACC 8FB40028 */ lw $s4, 0x28($sp)
/* AE2C70 8006BAD0 03E00008 */ jr $ra
/* AE2C74 8006BAD4 27BD0030 */ addiu $sp, $sp, 0x30
glabel Audio_PlaySoundAtPosition
/* AE2C78 8006BAD8 27BDFFC8 */ addiu $sp, $sp, -0x38
/* AE2C7C 8006BADC AFA40038 */ sw $a0, 0x38($sp)
/* AE2C80 8006BAE0 AFA5003C */ sw $a1, 0x3c($sp)
/* AE2C84 8006BAE4 24881DB4 */ addiu $t0, $a0, 0x1db4
/* AE2C88 8006BAE8 AFBF001C */ sw $ra, 0x1c($sp)
/* AE2C8C 8006BAEC AFA60040 */ sw $a2, 0x40($sp)
/* AE2C90 8006BAF0 AFA70044 */ sw $a3, 0x44($sp)
/* AE2C94 8006BAF4 340AFFFF */ li $t2, 65535
/* AE2C98 8006BAF8 24040010 */ li $a0, 16
/* AE2C9C 8006BAFC 8FA50028 */ lw $a1, 0x28($sp)
/* AE2CA0 8006BB00 00004825 */ move $t1, $zero
.L8006BB04:
/* AE2CA4 8006BB04 95020000 */ lhu $v0, ($t0)
/* AE2CA8 8006BB08 10400007 */ beqz $v0, .L8006BB28
/* AE2CAC 8006BB0C 004A082A */ slt $at, $v0, $t2
/* AE2CB0 8006BB10 10200003 */ beqz $at, .L8006BB20
/* AE2CB4 8006BB14 25290001 */ addiu $t1, $t1, 1
/* AE2CB8 8006BB18 00405025 */ move $t2, $v0
/* AE2CBC 8006BB1C 01002825 */ move $a1, $t0
.L8006BB20:
/* AE2CC0 8006BB20 1524FFF8 */ bne $t1, $a0, .L8006BB04
/* AE2CC4 8006BB24 2508001C */ addiu $t0, $t0, 0x1c
.L8006BB28:
/* AE2CC8 8006BB28 29210010 */ slti $at, $t1, 0x10
/* AE2CCC 8006BB2C 14200004 */ bnez $at, .L8006BB40
/* AE2CD0 8006BB30 24A40010 */ addiu $a0, $a1, 0x10
/* AE2CD4 8006BB34 0C03E27A */ jal func_800F89E8
/* AE2CD8 8006BB38 AFA50030 */ sw $a1, 0x30($sp)
/* AE2CDC 8006BB3C 8FA80030 */ lw $t0, 0x30($sp)
.L8006BB40:
/* AE2CE0 8006BB40 8FAE003C */ lw $t6, 0x3c($sp)
/* AE2CE4 8006BB44 25050004 */ addiu $a1, $t0, 4
/* AE2CE8 8006BB48 3C010001 */ lui $at, (0x00011D60 >> 16) # lui $at, 1
/* AE2CEC 8006BB4C 8DD80000 */ lw $t8, ($t6)
/* AE2CF0 8006BB50 34211D60 */ ori $at, (0x00011D60 & 0xFFFF) # ori $at, $at, 0x1d60
/* AE2CF4 8006BB54 25060010 */ addiu $a2, $t0, 0x10
/* AE2CF8 8006BB58 ACB80000 */ sw $t8, ($a1)
/* AE2CFC 8006BB5C 8DCF0004 */ lw $t7, 4($t6)
/* AE2D00 8006BB60 ACAF0004 */ sw $t7, 4($a1)
/* AE2D04 8006BB64 8DD80008 */ lw $t8, 8($t6)
/* AE2D08 8006BB68 ACB80008 */ sw $t8, 8($a1)
/* AE2D0C 8006BB6C 8FB90040 */ lw $t9, 0x40($sp)
/* AE2D10 8006BB70 A5190000 */ sh $t9, ($t0)
/* AE2D14 8006BB74 8FA40038 */ lw $a0, 0x38($sp)
/* AE2D18 8006BB78 AFA60020 */ sw $a2, 0x20($sp)
/* AE2D1C 8006BB7C 0C029BBD */ jal func_800A6EF4
/* AE2D20 8006BB80 00812021 */ addu $a0, $a0, $at
/* AE2D24 8006BB84 3C078013 */ lui $a3, %hi(D_801333E0) # $a3, 0x8013
/* AE2D28 8006BB88 3C0B8013 */ lui $t3, %hi(D_801333E8) # $t3, 0x8013
/* AE2D2C 8006BB8C 24E733E0 */ addiu $a3, %lo(D_801333E0) # addiu $a3, $a3, 0x33e0
/* AE2D30 8006BB90 256B33E8 */ addiu $t3, %lo(D_801333E8) # addiu $t3, $t3, 0x33e8
/* AE2D34 8006BB94 AFAB0014 */ sw $t3, 0x14($sp)
/* AE2D38 8006BB98 AFA70010 */ sw $a3, 0x10($sp)
/* AE2D3C 8006BB9C 97A40046 */ lhu $a0, 0x46($sp)
/* AE2D40 8006BBA0 8FA50020 */ lw $a1, 0x20($sp)
/* AE2D44 8006BBA4 0C03DCE3 */ jal Audio_PlaySoundGeneral
/* AE2D48 8006BBA8 24060004 */ li $a2, 4
/* AE2D4C 8006BBAC 8FBF001C */ lw $ra, 0x1c($sp)
/* AE2D50 8006BBB0 27BD0038 */ addiu $sp, $sp, 0x38
/* AE2D54 8006BBB4 03E00008 */ jr $ra
/* AE2D58 8006BBB8 00000000 */ nop

View file

@ -1,15 +0,0 @@
glabel func_8006C3A0
/* AE3540 8006C3A0 00001025 */ move $v0, $zero
/* AE3544 8006C3A4 3C030001 */ lui $v1, 1
.L8006C3A8:
/* AE3548 8006C3A8 00027040 */ sll $t6, $v0, 1
/* AE354C 8006C3AC 24420001 */ addiu $v0, $v0, 1
/* AE3550 8006C3B0 304200FF */ andi $v0, $v0, 0xff
/* AE3554 8006C3B4 008E7821 */ addu $t7, $a0, $t6
/* AE3558 8006C3B8 28410014 */ slti $at, $v0, 0x14
/* AE355C 8006C3BC 01E3C021 */ addu $t8, $t7, $v1
/* AE3560 8006C3C0 1420FFF9 */ bnez $at, .L8006C3A8
/* AE3564 8006C3C4 A70020FC */ sh $zero, 0x20fc($t8)
/* AE3568 8006C3C8 03E00008 */ jr $ra
/* AE356C 8006C3CC 00000000 */ nop

View file

@ -1,30 +0,0 @@
glabel func_8006C3D0
/* AE3570 8006C3D0 AFA50004 */ sw $a1, 4($sp)
/* AE3574 8006C3D4 00052C00 */ sll $a1, $a1, 0x10
/* AE3578 8006C3D8 00052C03 */ sra $a1, $a1, 0x10
/* AE357C 8006C3DC 04A10003 */ bgez $a1, .L8006C3EC
/* AE3580 8006C3E0 00057103 */ sra $t6, $a1, 4
/* AE3584 8006C3E4 24A1000F */ addiu $at, $a1, 0xf
/* AE3588 8006C3E8 00017103 */ sra $t6, $at, 4
.L8006C3EC:
/* AE358C 8006C3EC 000E7C00 */ sll $t7, $t6, 0x10
/* AE3590 8006C3F0 000FC403 */ sra $t8, $t7, 0x10
/* AE3594 8006C3F4 0018C840 */ sll $t9, $t8, 1
/* AE3598 8006C3F8 00991021 */ addu $v0, $a0, $t9
/* AE359C 8006C3FC 3C010001 */ lui $at, 1
/* AE35A0 8006C400 00411021 */ addu $v0, $v0, $at
/* AE35A4 8006C404 944820FC */ lhu $t0, 0x20fc($v0)
/* AE35A8 8006C408 04A10004 */ bgez $a1, .L8006C41C
/* AE35AC 8006C40C 30A9000F */ andi $t1, $a1, 0xf
/* AE35B0 8006C410 11200002 */ beqz $t1, .L8006C41C
/* AE35B4 8006C414 00000000 */ nop
/* AE35B8 8006C418 2529FFF0 */ addiu $t1, $t1, -0x10
.L8006C41C:
/* AE35BC 8006C41C 00095400 */ sll $t2, $t1, 0x10
/* AE35C0 8006C420 000A5C03 */ sra $t3, $t2, 0x10
/* AE35C4 8006C424 240C0001 */ li $t4, 1
/* AE35C8 8006C428 016C7804 */ sllv $t7, $t4, $t3
/* AE35CC 8006C42C 010FC025 */ or $t8, $t0, $t7
/* AE35D0 8006C430 03E00008 */ jr $ra
/* AE35D4 8006C434 A45820FC */ sh $t8, 0x20fc($v0)

View file

@ -1,30 +0,0 @@
glabel func_8006C438
/* AE35D8 8006C438 AFA50004 */ sw $a1, 4($sp)
/* AE35DC 8006C43C 00052C00 */ sll $a1, $a1, 0x10
/* AE35E0 8006C440 00052C03 */ sra $a1, $a1, 0x10
/* AE35E4 8006C444 04A10003 */ bgez $a1, .L8006C454
/* AE35E8 8006C448 00057103 */ sra $t6, $a1, 4
/* AE35EC 8006C44C 24A1000F */ addiu $at, $a1, 0xf
/* AE35F0 8006C450 00017103 */ sra $t6, $at, 4
.L8006C454:
/* AE35F4 8006C454 000E7C00 */ sll $t7, $t6, 0x10
/* AE35F8 8006C458 000FC403 */ sra $t8, $t7, 0x10
/* AE35FC 8006C45C 0018C840 */ sll $t9, $t8, 1
/* AE3600 8006C460 00991021 */ addu $v0, $a0, $t9
/* AE3604 8006C464 3C010001 */ lui $at, 1
/* AE3608 8006C468 00411021 */ addu $v0, $v0, $at
/* AE360C 8006C46C 944820FC */ lhu $t0, 0x20fc($v0)
/* AE3610 8006C470 04A10004 */ bgez $a1, .L8006C484
/* AE3614 8006C474 30A9000F */ andi $t1, $a1, 0xf
/* AE3618 8006C478 11200002 */ beqz $t1, .L8006C484
/* AE361C 8006C47C 00000000 */ nop
/* AE3620 8006C480 2529FFF0 */ addiu $t1, $t1, -0x10
.L8006C484:
/* AE3624 8006C484 00095400 */ sll $t2, $t1, 0x10
/* AE3628 8006C488 000A5C03 */ sra $t3, $t2, 0x10
/* AE362C 8006C48C 240C0001 */ li $t4, 1
/* AE3630 8006C490 016C6804 */ sllv $t5, $t4, $t3
/* AE3634 8006C494 39B8FFFF */ xori $t8, $t5, 0xffff
/* AE3638 8006C498 0118C824 */ and $t9, $t0, $t8
/* AE363C 8006C49C 03E00008 */ jr $ra
/* AE3640 8006C4A0 A45920FC */ sh $t9, 0x20fc($v0)

View file

@ -1,30 +0,0 @@
glabel func_8006C4A4
/* AE3644 8006C4A4 AFA50004 */ sw $a1, 4($sp)
/* AE3648 8006C4A8 00052C00 */ sll $a1, $a1, 0x10
/* AE364C 8006C4AC 00052C03 */ sra $a1, $a1, 0x10
/* AE3650 8006C4B0 04A10003 */ bgez $a1, .L8006C4C0
/* AE3654 8006C4B4 00057103 */ sra $t6, $a1, 4
/* AE3658 8006C4B8 24A1000F */ addiu $at, $a1, 0xf
/* AE365C 8006C4BC 00017103 */ sra $t6, $at, 4
.L8006C4C0:
/* AE3660 8006C4C0 000E7C00 */ sll $t7, $t6, 0x10
/* AE3664 8006C4C4 000FC403 */ sra $t8, $t7, 0x10
/* AE3668 8006C4C8 0018C840 */ sll $t9, $t8, 1
/* AE366C 8006C4CC 00994021 */ addu $t0, $a0, $t9
/* AE3670 8006C4D0 3C090001 */ lui $t1, 1
/* AE3674 8006C4D4 240D0001 */ li $t5, 1
/* AE3678 8006C4D8 01284821 */ addu $t1, $t1, $t0
/* AE367C 8006C4DC 952920FC */ lhu $t1, 0x20fc($t1)
/* AE3680 8006C4E0 04A10004 */ bgez $a1, .L8006C4F4
/* AE3684 8006C4E4 30AA000F */ andi $t2, $a1, 0xf
/* AE3688 8006C4E8 11400002 */ beqz $t2, .L8006C4F4
/* AE368C 8006C4EC 00000000 */ nop
/* AE3690 8006C4F0 254AFFF0 */ addiu $t2, $t2, -0x10
.L8006C4F4:
/* AE3694 8006C4F4 000A5C00 */ sll $t3, $t2, 0x10
/* AE3698 8006C4F8 000B6403 */ sra $t4, $t3, 0x10
/* AE369C 8006C4FC 018D7004 */ sllv $t6, $t5, $t4
/* AE36A0 8006C500 000E7C00 */ sll $t7, $t6, 0x10
/* AE36A4 8006C504 000FC403 */ sra $t8, $t7, 0x10
/* AE36A8 8006C508 03E00008 */ jr $ra
/* AE36AC 8006C50C 01381024 */ and $v0, $t1, $t8

View file

@ -479,7 +479,7 @@ glabel Gameplay_Init
/* B34274 800BD0D4 24841498 */ addiu $a0, %lo(D_80161498) # addiu $a0, $a0, 0x1498 /* B34274 800BD0D4 24841498 */ addiu $a0, %lo(D_80161498) # addiu $a0, $a0, 0x1498
/* B34278 800BD0D8 3C018016 */ lui $at, %hi(D_801614B0+3) # $at, 0x8016 /* B34278 800BD0D8 3C018016 */ lui $at, %hi(D_801614B0+3) # $at, 0x8016
/* B3427C 800BD0DC A02014B3 */ sb $zero, %lo(D_801614B0+3)($at) /* B3427C 800BD0DC A02014B3 */ sb $zero, %lo(D_801614B0+3)($at)
/* B34280 800BD0E0 0C01B0E8 */ jal func_8006C3A0 /* B34280 800BD0E0 0C01B0E8 */ jal Flags_UnsetAllEnv
/* B34284 800BD0E4 02202025 */ move $a0, $s1 /* B34284 800BD0E4 02202025 */ move $a0, $s1
/* B34288 800BD0E8 26300074 */ addiu $s0, $s1, 0x74 /* B34288 800BD0E8 26300074 */ addiu $s0, $s1, 0x74
/* B3428C 800BD0EC 0C030EE2 */ jal THA_GetSize /* B3428C 800BD0EC 0C030EE2 */ jal THA_GetSize

View file

@ -9,7 +9,7 @@ glabel func_808A939C
/* 00554 808A93A4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000 /* 00554 808A93A4 00808025 */ or $s0, $a0, $zero ## $s0 = 00000000
/* 00558 808A93A8 AFBF001C */ sw $ra, 0x001C($sp) /* 00558 808A93A8 AFBF001C */ sw $ra, 0x001C($sp)
/* 0055C 808A93AC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 0055C 808A93AC 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 00560 808A93B0 0C01B129 */ jal func_8006C4A4 /* 00560 808A93B0 0C01B129 */ jal Flags_GetEnv
/* 00564 808A93B4 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005 /* 00564 808A93B4 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005
/* 00568 808A93B8 10400006 */ beq $v0, $zero, .L808A93D4 /* 00568 808A93B8 10400006 */ beq $v0, $zero, .L808A93D4
/* 0056C 808A93BC 26040032 */ addiu $a0, $s0, 0x0032 ## $a0 = 00000032 /* 0056C 808A93BC 26040032 */ addiu $a0, $s0, 0x0032 ## $a0 = 00000032

View file

@ -36,7 +36,7 @@ glabel func_808A9BE8
/* 004E8 808A9C68 51A00016 */ beql $t5, $zero, .L808A9CC4 /* 004E8 808A9C68 51A00016 */ beql $t5, $zero, .L808A9CC4
/* 004EC 808A9C6C 84D800B4 */ lh $t8, 0x00B4($a2) ## 000000B4 /* 004EC 808A9C6C 84D800B4 */ lh $t8, 0x00B4($a2) ## 000000B4
/* 004F0 808A9C70 AFA60020 */ sw $a2, 0x0020($sp) /* 004F0 808A9C70 AFA60020 */ sw $a2, 0x0020($sp)
/* 004F4 808A9C74 0C01B129 */ jal func_8006C4A4 /* 004F4 808A9C74 0C01B129 */ jal Flags_GetEnv
/* 004F8 808A9C78 AFA8001C */ sw $t0, 0x001C($sp) /* 004F8 808A9C78 AFA8001C */ sw $t0, 0x001C($sp)
/* 004FC 808A9C7C 3C078016 */ lui $a3, %hi(gSaveContext) /* 004FC 808A9C7C 3C078016 */ lui $a3, %hi(gSaveContext)
/* 00500 808A9C80 24E7E660 */ addiu $a3, %lo(gSaveContext) /* 00500 808A9C80 24E7E660 */ addiu $a3, %lo(gSaveContext)

View file

@ -4,7 +4,7 @@ glabel func_808B2980
/* 00198 808B2988 AFBF001C */ sw $ra, 0x001C($sp) /* 00198 808B2988 AFBF001C */ sw $ra, 0x001C($sp)
/* 0019C 808B298C AFA50024 */ sw $a1, 0x0024($sp) /* 0019C 808B298C AFA50024 */ sw $a1, 0x0024($sp)
/* 001A0 808B2990 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 001A0 808B2990 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 001A4 808B2994 0C01B129 */ jal func_8006C4A4 /* 001A4 808B2994 0C01B129 */ jal Flags_GetEnv
/* 001A8 808B2998 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005 /* 001A8 808B2998 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005
/* 001AC 808B299C 5040000D */ beql $v0, $zero, .L808B29D4 /* 001AC 808B299C 5040000D */ beql $v0, $zero, .L808B29D4
/* 001B0 808B29A0 8FBF001C */ lw $ra, 0x001C($sp) /* 001B0 808B29A0 8FBF001C */ lw $ra, 0x001C($sp)

View file

@ -5,7 +5,7 @@ glabel func_80972008
/* 010C4 80972014 AFA5002C */ sw $a1, 0x002C($sp) /* 010C4 80972014 AFA5002C */ sw $a1, 0x002C($sp)
/* 010C8 80972018 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 010C8 80972018 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 010CC 8097201C 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 /* 010CC 8097201C 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001
/* 010D0 80972020 0C01B129 */ jal func_8006C4A4 /* 010D0 80972020 0C01B129 */ jal Flags_GetEnv
/* 010D4 80972024 AFA60028 */ sw $a2, 0x0028($sp) /* 010D4 80972024 AFA60028 */ sw $a2, 0x0028($sp)
/* 010D8 80972028 1040001C */ beq $v0, $zero, .L8097209C /* 010D8 80972028 1040001C */ beq $v0, $zero, .L8097209C
/* 010DC 8097202C 8FA60028 */ lw $a2, 0x0028($sp) /* 010DC 8097202C 8FA60028 */ lw $a2, 0x0028($sp)

View file

@ -22,7 +22,7 @@ glabel func_80976404
/* 054DC 8097642C 24010019 */ addiu $at, $zero, 0x0019 ## $at = 00000019 /* 054DC 8097642C 24010019 */ addiu $at, $zero, 0x0019 ## $at = 00000019
/* 054E0 80976430 1041000D */ beq $v0, $at, .L80976468 /* 054E0 80976430 1041000D */ beq $v0, $at, .L80976468
/* 054E4 80976434 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000 /* 054E4 80976434 00A02025 */ or $a0, $a1, $zero ## $a0 = 00000000
/* 054E8 80976438 0C01B129 */ jal func_8006C4A4 /* 054E8 80976438 0C01B129 */ jal Flags_GetEnv
/* 054EC 8097643C 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 /* 054EC 8097643C 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001
/* 054F0 80976440 14400009 */ bne $v0, $zero, .L80976468 /* 054F0 80976440 14400009 */ bne $v0, $zero, .L80976468
/* 054F4 80976444 3C028016 */ lui $v0, %hi(gSaveContext) /* 054F4 80976444 3C028016 */ lui $v0, %hi(gSaveContext)

View file

@ -46,7 +46,7 @@ glabel L809899F8
/* 00B80 80989A00 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000 /* 00B80 80989A00 02202025 */ or $a0, $s1, $zero ## $a0 = 00000000
/* 00B84 80989A04 57010024 */ bnel $t8, $at, .L80989A98 /* 00B84 80989A04 57010024 */ bnel $t8, $at, .L80989A98
/* 00B88 80989A08 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00B88 80989A08 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000
/* 00B8C 80989A0C 0C01B129 */ jal func_8006C4A4 /* 00B8C 80989A0C 0C01B129 */ jal Flags_GetEnv
/* 00B90 80989A10 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001 /* 00B90 80989A10 24050001 */ addiu $a1, $zero, 0x0001 ## $a1 = 00000001
/* 00B94 80989A14 14400003 */ bne $v0, $zero, .L80989A24 /* 00B94 80989A14 14400003 */ bne $v0, $zero, .L80989A24
/* 00B98 80989A18 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000 /* 00B98 80989A18 02002025 */ or $a0, $s0, $zero ## $a0 = 00000000

View file

@ -55,7 +55,7 @@ glabel L80989300
glabel L80989318 glabel L80989318
/* 00498 80989318 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000 /* 00498 80989318 00C02025 */ or $a0, $a2, $zero ## $a0 = 00000000
/* 0049C 8098931C 24050002 */ addiu $a1, $zero, 0x0002 ## $a1 = 00000002 /* 0049C 8098931C 24050002 */ addiu $a1, $zero, 0x0002 ## $a1 = 00000002
/* 004A0 80989320 0C01B129 */ jal func_8006C4A4 /* 004A0 80989320 0C01B129 */ jal Flags_GetEnv
/* 004A4 80989324 AFA70018 */ sw $a3, 0x0018($sp) /* 004A4 80989324 AFA70018 */ sw $a3, 0x0018($sp)
/* 004A8 80989328 104000E8 */ beq $v0, $zero, .L809896CC /* 004A8 80989328 104000E8 */ beq $v0, $zero, .L809896CC
/* 004AC 8098932C 8FA70018 */ lw $a3, 0x0018($sp) /* 004AC 8098932C 8FA70018 */ lw $a3, 0x0018($sp)

View file

@ -444,7 +444,7 @@ glabel EnMag_Update
/* 00918 80AA4418 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002 /* 00918 80AA4418 24010002 */ addiu $at, $zero, 0x0002 ## $at = 00000002
/* 0091C 80AA441C 1460000A */ bne $v1, $zero, .L80AA4448 /* 0091C 80AA441C 1460000A */ bne $v1, $zero, .L80AA4448
/* 00920 80AA4420 00000000 */ nop /* 00920 80AA4420 00000000 */ nop
/* 00924 80AA4424 0C01B129 */ jal func_8006C4A4 /* 00924 80AA4424 0C01B129 */ jal Flags_GetEnv
/* 00928 80AA4428 8FA40044 */ lw $a0, 0x0044($sp) /* 00928 80AA4428 8FA40044 */ lw $a0, 0x0044($sp)
/* 0092C 80AA442C 1040000E */ beq $v0, $zero, .L80AA4468 /* 0092C 80AA442C 1040000E */ beq $v0, $zero, .L80AA4468
/* 00930 80AA4430 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001 /* 00930 80AA4430 24060001 */ addiu $a2, $zero, 0x0001 ## $a2 = 00000001
@ -456,7 +456,7 @@ glabel EnMag_Update
.L80AA4448: .L80AA4448:
/* 00948 80AA4448 14610007 */ bne $v1, $at, .L80AA4468 /* 00948 80AA4448 14610007 */ bne $v1, $at, .L80AA4468
/* 0094C 80AA444C 8FA40044 */ lw $a0, 0x0044($sp) /* 0094C 80AA444C 8FA40044 */ lw $a0, 0x0044($sp)
/* 00950 80AA4450 0C01B129 */ jal func_8006C4A4 /* 00950 80AA4450 0C01B129 */ jal Flags_GetEnv
/* 00954 80AA4454 24050004 */ addiu $a1, $zero, 0x0004 ## $a1 = 00000004 /* 00954 80AA4454 24050004 */ addiu $a1, $zero, 0x0004 ## $a1 = 00000004
/* 00958 80AA4458 10400003 */ beq $v0, $zero, .L80AA4468 /* 00958 80AA4458 10400003 */ beq $v0, $zero, .L80AA4468
/* 0095C 80AA445C 240C0003 */ addiu $t4, $zero, 0x0003 ## $t4 = 00000003 /* 0095C 80AA445C 240C0003 */ addiu $t4, $zero, 0x0003 ## $t4 = 00000003

View file

@ -12,7 +12,7 @@ glabel func_80B90158
/* 01700 80B90180 31CF0040 */ andi $t7, $t6, 0x0040 ## $t7 = 00000000 /* 01700 80B90180 31CF0040 */ andi $t7, $t6, 0x0040 ## $t7 = 00000000
/* 01704 80B90184 15E00020 */ bne $t7, $zero, .L80B90208 /* 01704 80B90184 15E00020 */ bne $t7, $zero, .L80B90208
/* 01708 80B90188 00000000 */ nop /* 01708 80B90188 00000000 */ nop
/* 0170C 80B9018C 0C01B129 */ jal func_8006C4A4 /* 0170C 80B9018C 0C01B129 */ jal Flags_GetEnv
/* 01710 80B90190 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005 /* 01710 80B90190 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005
/* 01714 80B90194 1040001C */ beq $v0, $zero, .L80B90208 /* 01714 80B90194 1040001C */ beq $v0, $zero, .L80B90208
/* 01718 80B90198 3C0380B9 */ lui $v1, %hi(D_80B90E30) ## $v1 = 80B90000 /* 01718 80B90198 3C0380B9 */ lui $v1, %hi(D_80B90E30) ## $v1 = 80B90000
@ -50,7 +50,7 @@ glabel func_80B90158
/* 01794 80B90214 8FA4002C */ lw $a0, 0x002C($sp) /* 01794 80B90214 8FA4002C */ lw $a0, 0x002C($sp)
/* 01798 80B90218 560A0008 */ bnel $s0, $t2, .L80B9023C /* 01798 80B90218 560A0008 */ bnel $s0, $t2, .L80B9023C
/* 0179C 80B9021C 8FBF0024 */ lw $ra, 0x0024($sp) /* 0179C 80B9021C 8FBF0024 */ lw $ra, 0x0024($sp)
/* 017A0 80B90220 0C01B129 */ jal func_8006C4A4 /* 017A0 80B90220 0C01B129 */ jal Flags_GetEnv
/* 017A4 80B90224 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005 /* 017A4 80B90224 24050005 */ addiu $a1, $zero, 0x0005 ## $a1 = 00000005
/* 017A8 80B90228 3C0380B9 */ lui $v1, %hi(D_80B90E30) ## $v1 = 80B90000 /* 017A8 80B90228 3C0380B9 */ lui $v1, %hi(D_80B90E30) ## $v1 = 80B90000
/* 017AC 80B9022C 14400002 */ bne $v0, $zero, .L80B90238 /* 017AC 80B9022C 14400002 */ bne $v0, $zero, .L80B90238

View file

@ -821,16 +821,16 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx);
void Cutscene_SetSegment(GlobalContext* globalCtx, u32 segment); void Cutscene_SetSegment(GlobalContext* globalCtx, u32 segment);
void* MemCopy(void* dest, void* src, s32 size); void* MemCopy(void* dest, void* src, s32 size);
void func_800694A0(GlobalContext* globalCtx, s16 drawId); void func_800694A0(GlobalContext* globalCtx, s16 drawId);
// ? func_8006BA00(?); void func_8006BA00(GlobalContext* globalCtx);
// ? func_8006BA30(?); void func_8006BA30(GlobalContext* globalCtx);
void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos2, s32 radius, u16 sfxId); void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos, s32 duration, u16 sfxId);
u16 ElfMessage_GetSariaText(GlobalContext* globalCtx); u16 ElfMessage_GetSariaText(GlobalContext* globalCtx);
u16 ElfMessage_GetCUpText(GlobalContext* globalCtx); u16 ElfMessage_GetCUpText(GlobalContext* globalCtx);
u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet); u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet);
// ? func_8006C3A0(?); void Flags_UnsetAllEnv(GlobalContext* globalCtx);
// ? func_8006C3D0(?); void Flags_SetEnv(GlobalContext* globalCtx, s16 flag);
void func_8006C438(GlobalContext* globalCtx, s16 arg1); void Flags_UnsetEnv(GlobalContext* globalCtx, s16 flag);
s32 func_8006C4A4(GlobalContext*, s32); s32 Flags_GetEnv(GlobalContext* globalCtx, s16 flag);
// ? func_8006C510(?); // ? func_8006C510(?);
// ? func_8006C5A8(?); // ? func_8006C5A8(?);
// ? func_8006CBAC(?); // ? func_8006CBAC(?);
@ -1249,7 +1249,7 @@ void SkelAnime_Free(SkelAnime* skelAnime, GlobalContext* globalCtx);
// ? func_800A698C(?); // ? func_800A698C(?);
// ? func_800A6AC4(?); // ? func_800A6AC4(?);
// ? func_800A6E10(?); // ? func_800A6E10(?);
// ? func_800A6EF4(?); void func_800A6EF4(MtxF* mf, Vec3f* src, Vec3f* dest);
// ? func_800A6FA0(?); // ? func_800A6FA0(?);
// ? func_800A72FC(?); // ? func_800A72FC(?);
// ? func_800A730C(?); // ? func_800A730C(?);
@ -2190,7 +2190,7 @@ void Audio_PlaySoundGeneral(u16 sfxId, Vec3f* a1, u32 a2, u32* a3, u32* a4, u32*
// ? func_800F8480(?); // ? func_800F8480(?);
// ? func_800F87A0(?); // ? func_800F87A0(?);
// ? func_800F8884(?); // ? func_800F8884(?);
// ? func_800F89E8(?); void func_800F89E8(Vec3f*);
void func_800F8D04(u32 a0); void func_800F8D04(u32 a0);
// ? func_800F8D04(?); // ? func_800F8D04(?);
// ? func_800F8E3C(?); // ? func_800F8E3C(?);

View file

@ -579,6 +579,12 @@ typedef struct {
/* 0x28 */ CsCmdActorAction* actorActions[10]; // "npcdemopnt" /* 0x28 */ CsCmdActorAction* actorActions[10]; // "npcdemopnt"
} CutsceneContext; // size = 0x50 } CutsceneContext; // size = 0x50
typedef struct {
/* 0x00 */ u16 countdown;
/* 0x04 */ Vec3f originPos;
/* 0x10 */ Vec3f relativePos;
} SoundSource; // size = 0x1C
typedef struct { typedef struct {
/* 0x00 */ char unk_0[0x4]; /* 0x00 */ char unk_0[0x4];
} SubGlobalContext1F74; // size = 0x4 } SubGlobalContext1F74; // size = 0x4
@ -1030,7 +1036,7 @@ typedef struct GlobalContext {
/* 0x007C0 */ CollisionContext colCtx; /* 0x007C0 */ CollisionContext colCtx;
/* 0x01C24 */ ActorContext actorCtx; /* 0x01C24 */ ActorContext actorCtx;
/* 0x01D64 */ CutsceneContext csCtx; // "demo_play" /* 0x01D64 */ CutsceneContext csCtx; // "demo_play"
/* 0x01DB4 */ char unk_1DB4[0x1C0]; /* 0x01DB4 */ SoundSource soundSources[16];
/* 0x01F74 */ SubGlobalContext1F74 sub_1F74; /* 0x01F74 */ SubGlobalContext1F74 sub_1F74;
/* 0x01F78 */ SkyboxContext skyboxCtx; /* 0x01F78 */ SkyboxContext skyboxCtx;
/* 0x020C8 */ char unk_20C8[0x10]; /* 0x020C8 */ char unk_20C8[0x10];
@ -1075,9 +1081,8 @@ typedef struct GlobalContext {
/* 0x11E5C */ s8 unk_11E5C; /* 0x11E5C */ s8 unk_11E5C;
/* 0x11E5D */ s8 bombchuBowlingAmmo; // "bombchu_game_flag" /* 0x11E5D */ s8 bombchuBowlingAmmo; // "bombchu_game_flag"
/* 0x11E5E */ u8 fadeTransition; /* 0x11E5E */ u8 fadeTransition;
/* 0x11E5F */ char unk_11E5F[0x1];
/* 0x11E60 */ CollisionCheckContext colChkCtx; /* 0x11E60 */ CollisionCheckContext colChkCtx;
/* 0x120FC */ char unk_120FC[0x28]; /* 0x120FC */ u16 envFlags[20];
/* 0x12124 */ PreRenderContext preRenderCtx; /* 0x12124 */ PreRenderContext preRenderCtx;
/* 0x121C8 */ TransitionContext transitionCtx; /* 0x121C8 */ TransitionContext transitionCtx;
/* 0x12418 */ char unk_12418[0x3]; /* 0x12418 */ char unk_12418[0x3];

2
spec
View file

@ -311,7 +311,7 @@ beginseg
include "build/src/code/z_demo.o" include "build/src/code/z_demo.o"
include "build/src/code/code_80069420.o" include "build/src/code/code_80069420.o"
include "build/src/code/z_draw.o" include "build/src/code/z_draw.o"
include "build/asm/code_8006BA00.o" include "build/src/code/code_8006BA00.o"
include "build/src/code/z_elf_message.o" include "build/src/code/z_elf_message.o"
include "build/src/code/z_face_reaction.o" include "build/src/code/z_face_reaction.o"
include "build/src/code/code_8006C3A0.o" include "build/src/code/code_8006C3A0.o"

65
src/code/code_8006BA00.c Normal file
View file

@ -0,0 +1,65 @@
#include <ultra64.h>
#include <global.h>
void func_8006BA00(GlobalContext* globalCtx) {
SoundSource* sources = &globalCtx->soundSources[0];
s32 i;
// clang-format off
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) { sources[i].countdown = 0; }
// clang-format on
}
void func_8006BA30(GlobalContext* globalCtx) {
SoundSource* source;
s32 i;
source = &globalCtx->soundSources[0];
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) {
if (source->countdown != 0) {
if (DECR(source->countdown) == 0) {
func_800F89E8(&source->relativePos);
} else {
func_800A6EF4(&globalCtx->mf_11D60, &source->originPos, &source->relativePos);
}
}
source++;
}
}
void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos, s32 duration, u16 sfxId) {
s32 countdown;
SoundSource* source;
s32 smallestCountdown;
SoundSource* backupSource;
s32 i;
smallestCountdown = 0xFFFF;
source = &globalCtx->soundSources[0];
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) {
if (source->countdown == 0) {
break;
}
countdown = source->countdown;
if (countdown < smallestCountdown) {
smallestCountdown = countdown;
backupSource = source;
}
source++;
}
if (i >= ARRAY_COUNT(globalCtx->soundSources)) {
source = backupSource;
func_800F89E8(&source->relativePos);
}
source->originPos = *pos;
source->countdown = duration;
func_800A6EF4(&globalCtx->mf_11D60, &source->originPos, &source->relativePos);
Audio_PlaySoundGeneral(sfxId, &source->relativePos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}

View file

@ -1,10 +1,34 @@
#include <ultra64.h> #include <ultra64.h>
#include <global.h> #include <global.h>
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C3A0.s") void Flags_UnsetAllEnv(GlobalContext* globalCtx) {
u8 i;
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C3D0.s") for (i = 0; i < 20; i++) {
globalCtx->envFlags[i] = 0;
}
}
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C438.s") void Flags_SetEnv(GlobalContext* globalCtx, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = 1 << bit;
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8006C3A0/func_8006C4A4.s") globalCtx->envFlags[index] |= mask;
}
void Flags_UnsetEnv(GlobalContext* globalCtx, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = (1 << bit) ^ 0xFFFF;
globalCtx->envFlags[index] &= mask;
}
s32 Flags_GetEnv(GlobalContext* globalCtx, s16 flag) {
s16 index = flag / 16;
s16 bit = flag % 16;
s16 mask = 1 << bit;
return globalCtx->envFlags[index] & mask;
}

View file

@ -3054,7 +3054,7 @@ Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType) {
void func_80032C7C(GlobalContext* globalCtx, Actor* actor) { void func_80032C7C(GlobalContext* globalCtx, Actor* actor) {
globalCtx->actorCtx.unk_00 = 5; globalCtx->actorCtx.unk_00 = 5;
Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 0x14, NA_SE_EN_LAST_DAMAGE); Audio_PlaySoundAtPosition(globalCtx, &actor->posRot.pos, 20, NA_SE_EN_LAST_DAMAGE);
} }
s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) { s16 func_80032CB4(s16* arg0, s16 arg1, s16 arg2, s16 arg3) {

View file

@ -193,9 +193,9 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
break; break;
case 3: case 3:
if (sp3F != 0) { if (sp3F != 0) {
func_8006C3D0(globalCtx, 0); Flags_SetEnv(globalCtx, 0);
if (gSaveContext.entranceIndex == 0x0053) { if (gSaveContext.entranceIndex == 0x0053) {
func_8006C3D0(globalCtx, 2); Flags_SetEnv(globalCtx, 2);
} }
} }
break; break;
@ -225,7 +225,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
globalCtx->envCtx.unk_EE[3] = 0x10; globalCtx->envCtx.unk_EE[3] = 0x10;
break; break;
case 10: case 10:
func_8006C3D0(globalCtx, 1); Flags_SetEnv(globalCtx, 1);
break; break;
case 11: case 11:
if (globalCtx->unk_11D30[0] < 0x672) { if (globalCtx->unk_11D30[0] < 0x672) {
@ -350,10 +350,10 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase*
globalCtx->unk_11DE9 = 0; globalCtx->unk_11DE9 = 0;
break; break;
case 30: case 30:
func_8006C3D0(globalCtx, 3); Flags_SetEnv(globalCtx, 3);
break; break;
case 31: case 31:
func_8006C3D0(globalCtx, 4); Flags_SetEnv(globalCtx, 4);
break; break;
case 32: case 32:
if (sp3F != 0) { if (sp3F != 0) {
@ -1935,7 +1935,7 @@ void func_80068ECC(GlobalContext* globalCtx, CutsceneContext* csCtx) {
} }
if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) { if ((gSaveContext.cutsceneIndex >= 0xFFF0) && (csCtx->state == CS_STATE_IDLE)) {
func_8006C438(globalCtx, 0); Flags_UnsetEnv(globalCtx, 0);
D_8011E1C0 = 0; D_8011E1C0 = 0;
D_8011E1C4 = 0; D_8011E1C4 = 0;

View file

@ -36,7 +36,7 @@ void Effect_SS_Clear(GlobalContext* globalCtx) {
void Effect_SS_Delete(LoadedParticleEntry* particle) { void Effect_SS_Delete(LoadedParticleEntry* particle) {
if (particle->flags & 2) { if (particle->flags & 2) {
func_800F89E8(particle); func_800F89E8(&particle->position);
} }
if (particle->flags & 4) { if (particle->flags & 4) {

View file

@ -2,16 +2,11 @@
#include <global.h> #include <global.h>
void Lib_MemSet(u8* dest, size_t size, u8 val) { void Lib_MemSet(u8* dest, size_t size, u8 val) {
u32 i = 0; u32 i;
// TODO: Convert this to while/for if possible // clang-format off
if (i == size) { for (i = 0; i < size; i++) { *dest++ = val; }
return; // clang-format on
}
do {
*dest++ = val;
i++;
} while (i != size);
} }
f32 Math_Coss(s16 angle) { f32 Math_Coss(s16 angle) {

View file

@ -367,7 +367,7 @@ void Gameplay_Init(GlobalContext* globalCtx) {
TransitionFade_Start(&globalCtx->transitionFade); TransitionFade_Start(&globalCtx->transitionFade);
func_800AD000(&D_80161498); func_800AD000(&D_80161498);
D_801614B0.a = 0x00; D_801614B0.a = 0x00;
func_8006C3A0(globalCtx); Flags_UnsetAllEnv(globalCtx);
osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&globalCtx->state.tha)); osSyncPrintf("ZELDA ALLOC SIZE=%x\n", THA_GetSize(&globalCtx->state.tha));
zAllocSize = THA_GetSize(&globalCtx->state.tha); zAllocSize = THA_GetSize(&globalCtx->state.tha);

View file

@ -81,7 +81,7 @@ void func_808AE5A8(BgSpot05Soko* this, GlobalContext* globalCtx) {
void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) { void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
if (Flags_GetSwitch(globalCtx, this->switchFlag)) { if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 0x1E, NA_SE_EV_METALDOOR_CLOSE); Audio_PlaySoundAtPosition(globalCtx, &thisx->posRot.pos, 30, NA_SE_EV_METALDOOR_CLOSE);
Actor_SetHeight(thisx, 50.0f); Actor_SetHeight(thisx, 50.0f);
func_80080480(globalCtx, thisx); func_80080480(globalCtx, thisx);
this->actionFunc = func_808AE630; this->actionFunc = func_808AE630;

View file

@ -263,7 +263,7 @@ void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx) {
} }
void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) { void func_808BB128(BgTokiSwd* this, GlobalContext* globalCtx) {
if ((func_8006C4A4(globalCtx, 1) != 0) && (globalCtx->unk_11D30[0] < 0xFF)) { if (Flags_GetEnv(globalCtx, 1) && (globalCtx->unk_11D30[0] < 0xFF)) {
globalCtx->unk_11D30[0] += 5; globalCtx->unk_11D30[0] += 5;
} }
} }

View file

@ -80,7 +80,7 @@ void func_8097C8A8(DemoGo* this, GlobalContext* globalCtx) {
if ((thisx->params == 0) || (thisx->params == 1)) { if ((thisx->params == 0) || (thisx->params == 1)) {
func_800A6E10(&globalCtx->mf_11D60, &thisx->posRot.pos, &sp20, &sp1C); func_800A6E10(&globalCtx->mf_11D60, &thisx->posRot.pos, &sp20, &sp1C);
Audio_PlaySoundAtPosition(globalCtx, &sp20, 0x14, 0x28A0); Audio_PlaySoundAtPosition(globalCtx, &sp20, 20, 0x28A0);
} }
} }

View file

@ -87,7 +87,7 @@ void DoorAna_Update_Hidden(DoorAna* this, GlobalContext* globalCtx) {
bool openGrotto = false; bool openGrotto = false;
if ((this->actor.params & 0x200) == 0) { if ((this->actor.params & 0x200) == 0) {
// opening with song of storms // opening with song of storms
if (this->actor.waterSurfaceDist < 40000.0f && func_8006C4A4(globalCtx, 5) != 0) { if (this->actor.waterSurfaceDist < 40000.0f && Flags_GetEnv(globalCtx, 5)) {
openGrotto = true; openGrotto = true;
this->actor.flags &= ~0x10; this->actor.flags &= ~0x10;
} }

View file

@ -73,7 +73,7 @@ void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCt
} }
void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) { void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) {
func_8006C438(globalCtx, 5); // clear bean grow env flag Flags_UnsetEnv(globalCtx, 5); // clear storms env flag
if (((globalCtx->pauseCtx.state == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->msgCtx.unk_E300 == 0) && if (((globalCtx->pauseCtx.state == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->msgCtx.unk_E300 == 0) &&
(func_800C0D28(globalCtx) == 0) && ((globalCtx->transitionMode == 0) || (gSaveContext.gameMode != 0))) || (func_800C0D28(globalCtx) == 0) && ((globalCtx->transitionMode == 0) || (gSaveContext.gameMode != 0))) ||
(this->timer >= 250)) { (this->timer >= 250)) {
@ -84,7 +84,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
if (this->timer == 308) { if (this->timer == 308) {
// "Let's grow some beans" // "Let's grow some beans"
osSyncPrintf("\n\n\n豆よ のびろ 指定\n\n\n"); osSyncPrintf("\n\n\n豆よ のびろ 指定\n\n\n");
func_8006C3D0(globalCtx, 5); // set bean grow env flag Flags_SetEnv(globalCtx, 5); // set storms env flag
} }
} }

View file

@ -1930,7 +1930,7 @@ void func_80AEF40C(EnRu1* this) {
} }
void func_80AEF4A8(EnRu1* this, GlobalContext* globalCtx) { void func_80AEF4A8(EnRu1* this, GlobalContext* globalCtx) {
Audio_PlaySoundAtPosition(globalCtx, &this->actor.unk_E4, 0x14, NA_SE_VO_RT_FALL); Audio_PlaySoundAtPosition(globalCtx, &this->actor.unk_E4, 20, NA_SE_VO_RT_FALL);
} }
void func_80AEF4E0(EnRu1* this) { void func_80AEF4E0(EnRu1* this) {